pandora-u-boot.git
11 years agoAdd option to display customised memory information
Simon Glass [Fri, 30 Nov 2012 13:01:20 +0000 (13:01 +0000)]
Add option to display customised memory information

Some boards want to report more than just memory size. For example, it
might be useful to display the memory type (DDR2, DDR3) or manufacturer.

Add a weak function to support this requirement, accessed through a new
'meminfo' command.

Any example of the DRAM: output is below, just for illustration:

SMDK5250 # meminfo
DRAM:  2 GiB Elpida DDR3 @ 800MHz

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoarm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCD
Simon Glass [Fri, 30 Nov 2012 13:01:19 +0000 (13:01 +0000)]
arm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCD

This option displays board info after stdio is running, so that it will
appear on the LCD. If it is displayed earlier, the board info will appear
on the serial console but not on the LCD.

Here follows a blow-by-blow description.

1a. Without CONFIG_DISPLAY_BOARDINFO_LATE, on serial:

U-Boot 2011.12-02550-g037e1c5-dirty (Nov 15 2012 - 14:29:42) for SMDK5250

CPU:   S5PC520 @ 1700MHz

Board: Google Snow, rev 0
I2C:   ready
DRAM:  2 GiB Elpida DDR3 @ 800MHz
MMC:   S5P MSHC0: 0, S5P MSHC1: 1
SF: Detected W25Q32 with page size 4 KiB, total 4 MiB
*** Warning - bad CRC, using default environment

In:    mkbp-keyb
Out:   lcd
Err:   lcd
Net:   No ethernet found.
Hit any key to stop autoboot:  0
SMDK5250 #

1b. Without CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info
is missing):

In:    mkbp-keyb
Out:   lcd
Err:   lcd
Net:   No ethernet found.
Hit any key to stop autoboot:  0
SMDK5250 #

2a. With CONFIG_DISPLAY_BOARDINFO_LATE, on serial:

U-Boot 2011.12-02550-g037e1c5 (Nov 15 2012 - 14:27:40) for SMDK5250

CPU:   S5PC520 @ 1700MHz
I2C:   ready
DRAM:  2 GiB Elpida DDR3 @ 800MHz
MMC:   S5P MSHC0: 0, S5P MSHC1: 1
SF: Detected W25Q32 with page size 4 KiB, total 4 MiB
*** Warning - bad CRC, using default environment

Model: Google Snow
In:    mkbp-keyb
Out:   lcd
Err:   lcd
Net:   No ethernet found.
Hit any key to stop autoboot:  0
SMDK5250 #

2b. With CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is present):

Model: Google Snow
In:    mkbp-keyb
Out:   lcd
Err:   lcd
Net:   No ethernet found.
Hit any key to stop autoboot:  0
SMDK5250 #

Since the LCD is all that a typical user sees, it is useful to display
the model there.

We may be able to rearrange things some other way one day, but at
present this seems like a convenient way of getting the required
behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoDocument the CONFIG_DISPLAY_BOARDINFO option
Simon Glass [Fri, 30 Nov 2012 13:01:18 +0000 (13:01 +0000)]
Document the CONFIG_DISPLAY_BOARDINFO option

Add a short note about this in the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoarm: Add CONFIG_DELAY_ENVIRONMENT to delay environment loading
Simon Glass [Fri, 30 Nov 2012 13:01:17 +0000 (13:01 +0000)]
arm: Add CONFIG_DELAY_ENVIRONMENT to delay environment loading

This option delays loading of the environment until later, so that only the
default environment will be available to U-Boot.

This can address the security risk of untrusted data being used during boot.

Any time you load untrusted data you expose yourself to a bug in the
code. The attacker gets to choose the data so can sometimes carefully
craft it to exploit a bug. We try to avoid touching user-controlled
data during a verified boot unless strictly necessary. Since the
default environment is good enough in this case (or you would just
change it), this gets around the problem by just not loading the
environment.

When CONFIG_DELAY_ENVIRONMENT is defined, it is convenient to have a
run-time way of enabling loading of the environment. Add this to the
fdt as /config/delay-environment.

Note: This patch depends on http://patchwork.ozlabs.org/patch/194342/

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
11 years agoarm: Move fdt check earlier so that board_early_init_f() can use it
Simon Glass [Fri, 30 Nov 2012 13:01:16 +0000 (13:01 +0000)]
arm: Move fdt check earlier so that board_early_init_f() can use it

We want to use the fdt inside board_early_init_f(), so check for its
presence earlier in the pre-reloc init sequence.

So far ARM and microblaze are the only only ones that use
CONFIG_OF_CONTROL. Microblaze does not have the same init loop, and in
particular does not have the board_early_init_f() call. So a patch for
microblaze would have no meaning.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoarm: Keep track of the tlb size as well as its location
Gabe Black [Fri, 30 Nov 2012 13:01:15 +0000 (13:01 +0000)]
arm: Keep track of the tlb size as well as its location

It may be necessary to know where the TLB area ends as well as where it
starts. This allows board code to complete a secure memory erase without
destroying the page tables.

Signed-off-by: Gabe Black <gabeblack@google.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoarm: move flush_dcache_all() to just before disable cache
Arun Mankuzhi [Fri, 30 Nov 2012 13:01:14 +0000 (13:01 +0000)]
arm: move flush_dcache_all() to just before disable cache

In Cortex-A15 architecture, when we run cache invalidate
the cache clean operation executes automatically.
So if there are any dirty cache lines before disabling the L2 cache
these will be synchronized with the main memory when
invalidate_dcache_all() runs in the last part of U-boot

The two functions after flush_dcache_all is using the stack. So this
data will be on the cache. After disable when invalidate is called the
data will be flushed from cache to memory. This corrupts the stack in
invalida_dcache_all. So this change is required to avoid the u-boot
hang.

So flush has to be done just before clearing CR_C bit

Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoMerge 'u-boot-atmel/master' into 'u-boot-arm/master'
Albert ARIBAUD [Wed, 9 Jan 2013 19:01:48 +0000 (20:01 +0100)]
Merge 'u-boot-atmel/master' into 'u-boot-arm/master'

11 years agoMerge branch 'u-boot-marvell/master' into 'u-boot-arm/master'
Albert ARIBAUD [Wed, 9 Jan 2013 15:57:03 +0000 (16:57 +0100)]
Merge branch 'u-boot-marvell/master' into 'u-boot-arm/master'

11 years agomv-common.h: increase malloc arena to 4MiB
Andreas Bießmann [Mon, 29 Oct 2012 13:58:55 +0000 (13:58 +0000)]
mv-common.h: increase malloc arena to 4MiB

This will fix the following error:

---8<---
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi:root' errno=-12!
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: prafulla@marvell.com
Cc: dimax.main@gmail.com
Tested-by: Alex Xol <dimax.main@gmail.com>
11 years agoarch-kirkwood: Ethernet port macro returning incorrect address
Luke Lowrey [Mon, 25 Jun 2012 06:37:09 +0000 (06:37 +0000)]
arch-kirkwood: Ethernet port macro returning incorrect address

Modified the arch-kirkwood header so KWGBE_PORT_SERIAL_CONTROL1_REG(x)
returns the correct address.

Originally calling KWGBE_PORT_SERIAL_CONTROL1_REG(1) returned the
address for port 0 and vice versa.

Doesn't have any knock on effects to the u-boot code as the only
time they're used is to do the same function to both addresses

Signed-off-by: Luke Lowrey <luke@chamsys.co.uk>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
Acked-by: Heiko Schocher <hs@denx.de>
11 years agolsxl: unset ncip for rescue mode
Michael Walle [Thu, 4 Oct 2012 06:54:25 +0000 (06:54 +0000)]
lsxl: unset ncip for rescue mode

Instead of using the serverip we get from the DHCP server, implicitly use
the broadcast address, which is automatically set when no ncip environment
variable is set. That way it isn't necessary to use a special DHCP
configuration to set the netconsole peer.

Signed-off-by: Michael Walle <michael@walle.cc>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
11 years agoARM: lacie_kw: add support for WIRELESS_SPACE
Albert ARIBAUD [Mon, 26 Nov 2012 11:27:37 +0000 (11:27 +0000)]
ARM: lacie_kw: add support for WIRELESS_SPACE

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
11 years agokirkwood: make MPP arrays static const
Albert ARIBAUD [Mon, 26 Nov 2012 11:27:36 +0000 (11:27 +0000)]
kirkwood: make MPP arrays static const

This saves stack and code memory for local copy, and
consumes initialized data memory. For 22 of the 29
kirkwood-based boards, this results in a global saving
of about 30 bytes. For 7 of them, it results in an
increase of 6 to 14 bytes.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
11 years agomv88e61xx: refactor PHY and SWITCH level-code
Albert ARIBAUD [Mon, 26 Nov 2012 11:27:35 +0000 (11:27 +0000)]
mv88e61xx: refactor PHY and SWITCH level-code

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
11 years agoarm/km: remove duplicate code
Valentin Longchamp [Fri, 2 Nov 2012 00:15:10 +0000 (00:15 +0000)]
arm/km: remove duplicate code

This patch removes 2 small portions of board specific code that are
duplicated with common ARM code and thus unnecessary. These 2 portions
of code concern the mach id that is given by u-boot to the Linux kernel
to identify the system's MACH.

The first one was the possibility to change the MACH thanks to the
'mach_id' enviroment variable. This is possible thanks to the 'machid'
env variable (see arch/arm/lib/bootm.c:boot_jump_linux()).

The seconde one is the setting of the bi_arch_number. This is already
done in arch/arm/lib/board.c:board_init_f() since km_arm.h does #define
CONFIG_MACH_TYPE.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
11 years agokm/common: cosmetic change reported from checkpatch
Holger Brunck [Fri, 2 Nov 2012 00:15:09 +0000 (00:15 +0000)]
km/common: cosmetic change reported from checkpatch

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
11 years agokm/common: drop unneeded std* environment variables
Holger Brunck [Fri, 2 Nov 2012 00:15:08 +0000 (00:15 +0000)]
km/common: drop unneeded std* environment variables

These variables are only used if CONFIG_SYS_CONSOLE_IS_IN_ENV
is set. This isn't the case, so we can drop them safely.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>

11 years agoarm/km: fix memory settings
Holger Brunck [Fri, 2 Nov 2012 00:15:07 +0000 (00:15 +0000)]
arm/km: fix memory settings

On kmcoge5un we faced some serious problems with the memory during
temperature tests. Reason was that we overwrite some registers for
memory settings which have to leave untouched. These where registers
0x20148 , 0x2014c and 0x20154.
So writing these registers is prohibited and this patch removes them
from all km related config files. Even if the problem was only
seen on kmcoge5un.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>

11 years agoarm: remove useless code in start.S files
Albert ARIBAUD [Tue, 8 Jan 2013 10:18:03 +0000 (10:18 +0000)]
arm: remove useless code in start.S files

Remove code such as unneeded includes or labels.
These removals have no functional effect.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
11 years agoarm: move C runtime setup code in crt0.S
Albert ARIBAUD [Tue, 8 Jan 2013 10:18:02 +0000 (10:18 +0000)]
arm: move C runtime setup code in crt0.S

Move all the C runtime setup code from every start.S
in arch/arm into arch/arm/lib/crt0.S. This covers
the code sequence from setting up the initial stack
to calling into board_init_r().

Also, rewrite the C runtime setup and make functions
board_init_*() and relocate_code() behave according to
normal C semantics (no jumping across the C stack any
more, etc).

Some SPL targets had to be touched because they use
start.S explicitly or for some reason; the relevant
maintainers and custodians are cc:ed.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
11 years agoMerge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Albert ARIBAUD [Tue, 8 Jan 2013 13:59:37 +0000 (14:59 +0100)]
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'

11 years agoMerge branch 'u-boot-ti/master' into 'u-boot-arm/master'
Albert ARIBAUD [Tue, 8 Jan 2013 12:15:45 +0000 (13:15 +0100)]
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'

This required manual merging drivers/mtd/nand/Makefile
and adding am335x_evm support for CONFIG_SPL_NAND_DRIVERS

11 years agotools: imximage: Load a size that is multiple of 512
Fabio Estevam [Thu, 3 Jan 2013 08:24:33 +0000 (08:24 +0000)]
tools: imximage: Load a size that is multiple of 512

In order to mx53 ROM to properly load the U-boot image, its header size should
be multiple of 512 bytes.

This issue was observed with gcc 4.6.2/4.7.3, which caused data aborts:

U-Boot 2013.01-rc2-00172-gf8cfcf1-dirty (Dec 26 2012 - 13:13:28)

Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
In:    serial
Out:   serial
Err:   serial
CPU:   Freescale i.MX53 family rev2.1 at 1000 MHz
Reset cause: WDOG
Net:   FEC
Warning: FEC using MAC address from net device

Hit any key to stop autoboot:  0
data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

pc : [<aff72220>]          lr : [<aff721fc>]
sp : af565e20  ip : af566918     fp : 00000000
r10: 00000003  r9 : affabb5b     r8 : af565f58
r7 : 00000000  r6 : 36747fff     r5 : af5668e8  r4 : 36747fff
r3 : af5668ec  r2 : af5668eb     r1 : 00000000  r0 : af5668e8
Flags: NzcV  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

,and this patch fixes it.

Also, even though the ROUND macro is already defined in common.h,
the reason for redefining it in image.h is explained by Stefano Babic:

"I will remark a previous comment - even if including common.h seems a
good idea to avoid duplications, it makes tools like mkimage to depend
on the selected board, because <board>_config must run. Even if this is
not a problem for us u-boot developers, it becomes an issue when these
tools are included in distros (like u-boot-tools in Ubuntu) and cannot
be packaged."

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx53loco: Improve error handling on power_init()
Fabio Estevam [Fri, 28 Dec 2012 04:05:29 +0000 (04:05 +0000)]
mx53loco: Improve error handling on power_init()

Make the error handling more robust.

Check if each one of the PMIC writes fail and if they do, just return
immediately.

Also, print the cause for the failures.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx53loco: Remove unneeded 'retval' variable
Fabio Estevam [Fri, 28 Dec 2012 04:05:28 +0000 (04:05 +0000)]
mx53loco: Remove unneeded 'retval' variable

commit c73368150 (pmic: Extend PMIC framework to support multiple instances
of PMIC devices) introduced an extra 'retval' variable, but this is not
necessary since we have already the variable 'ret' in place.

So use 'ret' to store the return values from the pmic related calls and remove
'retval'.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx51evk: Remove unneeded comment
Fabio Estevam [Thu, 27 Dec 2012 05:46:33 +0000 (05:46 +0000)]
mx51evk: Remove unneeded comment

Looks like the original comment came from a copy and paste from mx31ads.h.

It does not have a context on mx51evk anymore, so delete it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx6qsabresd: use on-board eMMC to store environment
Shawn Guo [Sun, 30 Dec 2012 14:15:00 +0000 (14:15 +0000)]
mx6qsabresd: use on-board eMMC to store environment

It makes more sense to use on-board eMMC to store environments.  The
boot partition 1 is selected by default.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agomx6qsabresd: add usdhc2 and usdhc4 support
Shawn Guo [Sun, 30 Dec 2012 14:14:59 +0000 (14:14 +0000)]
mx6qsabresd: add usdhc2 and usdhc4 support

The on-board number of available usdhc devices is something board
specific.  The patch moves CONFIG_SYS_FSL_USDHC_NUM out of
mx6qsabre_common.h and adds usdhc2 and usdhc4 support for mx6qsabresd
board.

To keep the default mmc device for environment same as before (usdhc3),
it moves CONFIG_SYS_MMC_ENV_DEV out of mx6qsabre_common.h and changes
it to 1 for mx6qsabresd.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agofsl_esdhc: add MMC_MODE_HC host_caps
Shawn Guo [Sun, 30 Dec 2012 14:14:58 +0000 (14:14 +0000)]
fsl_esdhc: add MMC_MODE_HC host_caps

All esdhc variants we know should support high capacity MMC cards,
so let's add MMC_MODE_HC host_caps unconditionally to support those
MMC cards (capacity > 2 GB).

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agomx35pdk:Use IMX_GPIO_NR macro
Ashok [Wed, 7 Nov 2012 07:37:15 +0000 (07:37 +0000)]
mx35pdk:Use IMX_GPIO_NR macro

Use IMX_GPO_NR macro

Signed-off-by: Ashok Kumar Reddy <ashokkourla2000@gmail.com>
Acked-by: Stefano Babic <sbabic@denx.de>
11 years agomxs: Add NAND fdt and ramdisk partition to m28evk
Marek Vasut [Tue, 25 Dec 2012 15:08:40 +0000 (15:08 +0000)]
mxs: Add NAND fdt and ramdisk partition to m28evk

Adjust the NAND partitioning layout so that there is a separate partition
for the ramdisk and fdt blob on the NAND.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
11 years agomx53loco: Call PMIC related functions from board_late_init()
Fabio Estevam [Wed, 26 Dec 2012 05:50:20 +0000 (05:50 +0000)]
mx53loco: Call PMIC related functions from board_late_init()

Since commit c733681 (pmic: Extend PMIC framework to support multiple instances
of PMIC devices) mx53loco fails to allocate the memory for PMIC:

U-Boot 2013.01-rc2-dirty (Dec 20 2012 - 15:55:01)

Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
pmic_alloc: No available memory for allocation!
pmic_init: POWER allocation error!
CPU:   Freescale i.MX53 family rev2.0 at 800 MHz
Reset cause: POR
MMC:   FSL_SDHC: 0, FSL_SDHC: 1

Calling the PMIC related functions at a later stage, ie, from board_late_init()
fixes the issue.

Reported-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Stefano Babic <sbabic@denx.de>
11 years agomx6qsabre_common: Change default loadaddr to 0x12000000
Otavio Salvador [Fri, 21 Dec 2012 06:59:07 +0000 (06:59 +0000)]
mx6qsabre_common: Change default loadaddr to 0x12000000

This allow use of mainline and Freescale BSP Linux kernel with same
environment.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx6qsabrelite: Change default loadaddr to 0x12000000
Otavio Salvador [Fri, 21 Dec 2012 06:59:06 +0000 (06:59 +0000)]
mx6qsabrelite: Change default loadaddr to 0x12000000

This allow use of mainline and Freescale BSP Linux kernel with same
environment.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx53loco: Change default loadaddr to 0x72000000
Otavio Salvador [Fri, 21 Dec 2012 06:59:05 +0000 (06:59 +0000)]
mx53loco: Change default loadaddr to 0x72000000

This allow use of mainline and Freescale BSP Linux kernel with same
environment.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx53loco: We shouldn't hardcode a rootfs filesystem type
Otavio Salvador [Fri, 21 Dec 2012 06:59:04 +0000 (06:59 +0000)]
mx53loco: We shouldn't hardcode a rootfs filesystem type

For a generic environment, we shouldn't have a fixed rootfs filesystem
so we drop it from env.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11 years agomx35pdk: Allow booting of a device tree kernel
Fabio Estevam [Tue, 25 Dec 2012 10:20:39 +0000 (10:20 +0000)]
mx35pdk: Allow booting of a device tree kernel

Select CONFIG_OF_LIBFDT, so that a dt kernel can be launched.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agoMerge samsung, imx, tegra into u-boot-arm/master
Albert ARIBAUD [Sat, 22 Dec 2012 10:59:14 +0000 (11:59 +0100)]
Merge samsung, imx, tegra into u-boot-arm/master

This commit merges branches from samsung, imx and tegra
meant to fix merge issues between u-boot/master and
u-boot-arm/master, as well as a few manual merge fixes.

11 years agoMerge remote-tracking branch 'u-boot/master' into u-boot-arm-merged
Allen Martin [Wed, 19 Dec 2012 21:02:36 +0000 (13:02 -0800)]
Merge remote-tracking branch 'u-boot/master' into u-boot-arm-merged

Conflicts:
README
arch/arm/cpu/armv7/exynos/clock.c
board/samsung/universal_c210/universal.c
drivers/misc/Makefile
drivers/power/power_fsl.c
include/configs/mx35pdk.h
include/configs/mx53loco.h
include/configs/seaboard.h

11 years agoMerge branch 'master' of git://git.denx.de/u-boot-net
Tom Rini [Tue, 18 Dec 2012 01:39:50 +0000 (18:39 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-net

11 years agoMerge branch 'master' of git://git.denx.de/u-boot-nand-flash
Tom Rini [Tue, 18 Dec 2012 01:39:45 +0000 (18:39 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-nand-flash

11 years agonet: sh_eth: add support for SH7752
Yoshihiro Shimoda [Sun, 4 Nov 2012 15:54:30 +0000 (15:54 +0000)]
net: sh_eth: add support for SH7752

SH7752 has two fast ethernet controllers and two gigabit ethernet
controllers. It is similar to SH7757.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
11 years agonet: Fix endianness bug in link-local
Joe Hershberger [Mon, 5 Nov 2012 06:13:45 +0000 (06:13 +0000)]
net: Fix endianness bug in link-local

The ip is stored in network order, so we can't test it in host order.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
11 years agonet: Add tftp speed indication
Simon Glass [Thu, 11 Oct 2012 13:57:36 +0000 (13:57 +0000)]
net: Add tftp speed indication

This prints a tftp speed indication after the download completes. This
is the 3.6 MiB/s indicator below.

Tegra2 (SeaBoard) # tftp ...
Using asx0 device
TFTP from server 172.22.72.144; our IP address is 172.22.73.81
Filename '/tftpboot/uImage-user-seaboard-1'.
Load address: 0x408000
Loading: #################################################
         3.6 MiB/s
done

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
11 years agopowerpc: remove not used CONFIG_SYS_TFTP_LOADADDR
trem [Sat, 6 Oct 2012 04:25:56 +0000 (04:25 +0000)]
powerpc: remove not used CONFIG_SYS_TFTP_LOADADDR

CONFIG_SYS_TFTP_LOADADDR is defined on severals boards,
but it's never used. So we can safely removed it.

Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
11 years agophy: Add support for Marvell 88E1118R
Michal Simek [Tue, 7 Aug 2012 02:23:07 +0000 (02:23 +0000)]
phy: Add support for Marvell 88E1118R

Marvell 88E1118R has different uid then 88E1118.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Andy Fleming <afleming@freescale.com>
CC: Zang Roy-R61911 <tie-fei.zang@freescale.com>
CC: Kumar Gala <galak@kernel.crashing.org>
11 years agoe1000e : Correct Rx Threshold granularity
Ruchika Gupta [Thu, 19 Apr 2012 02:27:11 +0000 (02:27 +0000)]
e1000e : Correct Rx Threshold granularity

In e1000e driver, Rx descriptor queue is used such that hardware can add only
one descriptor at a time. So the WTHRESH granularity in RXDCTL should be set
to single descriptor. This would ensure that every time controller fills a Rx
descriptor, it is flushed to host memory. Earlier this granularity was in
cache line units i.e 2 descriptors. This leads to controller always waiting
for 2 descriptors before flushing them out. But since not more than one Rx BD
is actually available , the accumulation condition never gets hit.

Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Signed-off-by: Vakul Garg <vakul@freescale.com>
Acked-by: Roy Zang <tie-fei.zang@freescale.com>
11 years agom28evk/mx28evk: fix nand_update_full
Eric Benard [Tue, 11 Dec 2012 11:36:21 +0000 (11:36 +0000)]
m28evk/mx28evk: fix nand_update_full

- since commit 418396e212b59bf907dbccad997ff50f7eb61b16 nand write.raw
can take the number of page to be written as an argument. nand_update_full
is passing the size (in bytes) to nand write.raw. This value was previously
ignored but now breaks the write.
- this patch updates the default environment of these boards to provide a
pagecount instead of a size to nand write.raw.
- tested on a mx28evk with a 4k page NAND and on a custom board with a
2k page NAND.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
11 years agoMerge remote-tracking branch 'origin/master'
Scott Wood [Fri, 14 Dec 2012 22:03:55 +0000 (16:03 -0600)]
Merge remote-tracking branch 'origin/master'

11 years agoPrepare v2013.01-rc2 v2013.01-rc2
Tom Rini [Fri, 14 Dec 2012 21:43:22 +0000 (14:43 -0700)]
Prepare v2013.01-rc2

Signed-off-by: Tom Rini <trini@ti.com>
11 years agoomap3_evm: Let CONFIG_EFI_PARTITION be set for SPL
Tom Rini [Thu, 13 Dec 2012 20:58:27 +0000 (13:58 -0700)]
omap3_evm: Let CONFIG_EFI_PARTITION be set for SPL

The #ifdef here is not enough to stop part_efi.c from being built, only
being unused.  And with recent changes this now leads to warnings.  The
easiest solution here is to just let the garbage collection at link time
do its job.

Signed-off-by: Tom Rini <trini@ti.com>
11 years agoenv: Handle write-once ethaddr and serial# generically
Joe Hershberger [Wed, 12 Dec 2012 04:16:37 +0000 (22:16 -0600)]
env: Handle write-once ethaddr and serial# generically

Use the variable access flags to implement the protection for ethaddr
and serial# instead of hard-coding them.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Implement the env delete command
Joe Hershberger [Wed, 12 Dec 2012 04:16:36 +0000 (22:16 -0600)]
env: Implement the env delete command

Implement a way to delete more than one variable at a time.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add setenv force support
Joe Hershberger [Wed, 12 Dec 2012 04:16:35 +0000 (22:16 -0600)]
env: Add setenv force support

Now that we have support for permissions, add a way to override them.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add support for access control to .flags
Joe Hershberger [Wed, 12 Dec 2012 04:16:34 +0000 (22:16 -0600)]
env: Add support for access control to .flags

Add support for read-only, write-once, and change-default.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a command to display details about env flags
Joe Hershberger [Wed, 12 Dec 2012 04:16:33 +0000 (22:16 -0600)]
env: Add a command to display details about env flags

Similar to the env callback command, this will show details about the
options available, the static list, and the currently active variables.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agotools/env: Add environment variable flags support
Joe Hershberger [Wed, 12 Dec 2012 04:16:32 +0000 (22:16 -0600)]
tools/env: Add environment variable flags support

Currently just validates variable types as decimal, hexidecimal,
boolean, ip address, and mac address.  Call
env_acl_validate_setenv_params() from setenv() in fw_env.c.

If the entry is not found in the env .flags, then look in the static
one. This allows the env to override the static definitions, but prevents
the need to have every definition in the environment distracting you.

Need to build in _ctype for isdigit for Linux.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add environment variable flags
Joe Hershberger [Wed, 12 Dec 2012 04:16:31 +0000 (22:16 -0600)]
env: Add environment variable flags

Currently just validates variable types as decimal, hexidecimal,
boolean, ip address, and mac address.

If the entry is not found in the env ".flags", then look in the static
one. This allows the env to override the static definitions, but prevents
the need to have every definition in the environment distracting you.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a silent env handler
Joe Hershberger [Wed, 12 Dec 2012 04:16:30 +0000 (22:16 -0600)]
env: Add a silent env handler

The silent variable now updates the global data flag anytime it is
changed as well as after the env relocation (in case its value is
different from the default env in such cases as NAND env)

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a console env handler
Joe Hershberger [Wed, 12 Dec 2012 04:16:29 +0000 (22:16 -0600)]
env: Add a console env handler

Remove the hard-coded console handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a loadaddr env handler
Joe Hershberger [Wed, 12 Dec 2012 04:16:28 +0000 (22:16 -0600)]
env: Add a loadaddr env handler

Remove the hard-coded loadaddr handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a baudrate env handler
Joe Hershberger [Wed, 12 Dec 2012 04:16:27 +0000 (22:16 -0600)]
env: Add a baudrate env handler

Remove the hard-coded baudrate handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a bootfile env handler
Joe Hershberger [Wed, 12 Dec 2012 04:16:26 +0000 (22:16 -0600)]
env: Add a bootfile env handler

Remove the hard-coded bootfile handler and use a callback instead

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Add a command to view callbacks
Joe Hershberger [Wed, 12 Dec 2012 04:16:25 +0000 (22:16 -0600)]
env: Add a command to view callbacks

The callbacks can be bound, but are otherwise invisible.  Add a command
to show what callbacks are available.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
!!! fix callback command

11 years agoenv: Add support for callbacks to environment vars
Joe Hershberger [Wed, 12 Dec 2012 04:16:24 +0000 (22:16 -0600)]
env: Add support for callbacks to environment vars

Add support for per-variable callbacks to the "hashtable" functions.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
!!!fix comment in callback

11 years agoenv: Hide '.' variables in env print by default
Joe Hershberger [Wed, 12 Dec 2012 04:16:23 +0000 (22:16 -0600)]
env: Hide '.' variables in env print by default

When printing all variables with env print, don't print variables that
begin with '.'.  If env print is called with a '-a' switch, then
include variables that begin with '.' (just like the ls command).

Variables printed explicitly will be printed even without the -a.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Use getenv_yesno() more generally
Joe Hershberger [Wed, 12 Dec 2012 04:16:22 +0000 (22:16 -0600)]
env: Use getenv_yesno() more generally

Move the getenv_yesno() to env_common.c and change most checks for
'y' or 'n' to use this helper.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Refactor apply into change_ok
Joe Hershberger [Wed, 12 Dec 2012 04:16:21 +0000 (22:16 -0600)]
env: Refactor apply into change_ok

Move the read of the old value to inside the check function.  In some
cases it can be avoided all together and at the least the code is only
called from one place.

Also name the function and the callback to more clearly describe what
it does.

Pass the ENTRY instead of just the name for direct access to the whole
data structure.

Pass an enum to the callback that specifies the operation being approved.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Consolidate common code in hsearch_r()
Joe Hershberger [Wed, 12 Dec 2012 04:16:20 +0000 (22:16 -0600)]
env: Consolidate common code in hsearch_r()

The same chunk of code was replicated in two places and the following
changes will make that chunk grow a bit, so combine into a static func.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoenv: Refactor do_apply to a flag
Joe Hershberger [Wed, 12 Dec 2012 04:16:19 +0000 (22:16 -0600)]
env: Refactor do_apply to a flag

Use a flag in hsearch_r for insert mode passed from import to allow the
behavior be different based on use.

Now that "do_check" is called for all imports, ensure console init is
complete before updating the console on relocation import

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agoMake linux kernel string funcs available to tools
Joe Hershberger [Wed, 12 Dec 2012 04:16:18 +0000 (22:16 -0600)]
Make linux kernel string funcs available to tools

isspace() and strim() are not in the typical user-mode string.h, so
put them in a separate compilation unit so that they can be built into
tools that need them independent of the other common string functions.

This allows code shared by u-boot and the linux user-mode tools to link.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
11 years agogpt: Enable support for GPT partition table restoration at Samsung's Trats
Lukasz Majewski [Tue, 11 Dec 2012 10:09:48 +0000 (11:09 +0100)]
gpt: Enable support for GPT partition table restoration at Samsung's Trats

Enable support for GPT partition table restoration at Samsung's Trats
development board.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
11 years agogpt: Support for new "gpt" command
Piotr Wilczek [Tue, 11 Dec 2012 10:09:47 +0000 (11:09 +0100)]
gpt: Support for new "gpt" command

New command - "gpt" is supported. It restores the GPT partition table.
It looks into the given environment variable for partitions definition.
It can be enabled at target configuration file with CONFIG_CMD_GPT.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
11 years agogpt: Support for GPT (GUID Partition Table) restoration
Lukasz Majewski [Tue, 11 Dec 2012 10:09:46 +0000 (11:09 +0100)]
gpt: Support for GPT (GUID Partition Table) restoration

The restoration of GPT table (both primary and secondary) is now possible.
Function 'gpt_restore' presents example of partition restoration process.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
11 years agogpt: The leXX_to_int() calls replaced with ones defined at <compiler.h>
Chang Hyun Park [Tue, 11 Dec 2012 10:09:45 +0000 (11:09 +0100)]
gpt: The leXX_to_int() calls replaced with ones defined at <compiler.h>

Custom definitions of le_XX_to_int functions have been replaced with
standard ones, defined at <compiler.h>

Replacement of several GPT related structures members with ones
indicating its endianness and proper size.

Signed-off-by: Chang Hyun Park <heartinpiece@outlook.com>
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
11 years agogpt:doc: GPT (GUID Partition Table) documentation
Lukasz Majewski [Tue, 11 Dec 2012 10:09:44 +0000 (11:09 +0100)]
gpt:doc: GPT (GUID Partition Table) documentation

Documentation of the GPT format.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
11 years agopart:efi: Move part_efi.h file to ./include
Lukasz Majewski [Tue, 11 Dec 2012 10:09:43 +0000 (11:09 +0100)]
part:efi: Move part_efi.h file to ./include

This move is necessary to export gpt header and GPT partition entries to be
used with other commands or subsystems.
Additionally the part_efi.h file has been cleaned-up to supress checkpatch's
warnings.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
11 years agovsprintf:fix: Change type returned by ustrtoul
Lukasz Majewski [Tue, 11 Dec 2012 10:09:42 +0000 (11:09 +0100)]
vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
11 years agomx25pdk: Allow booting a device tree kernel
Fabio Estevam [Tue, 11 Dec 2012 11:48:46 +0000 (11:48 +0000)]
mx25pdk: Allow booting a device tree kernel

Select CONFIG_OF_LIBFDT so that a device tree kernel can be launched.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agomx53loco: Fix PMIC name
Fabio Estevam [Tue, 11 Dec 2012 06:36:58 +0000 (06:36 +0000)]
mx53loco: Fix PMIC name

commit c73368150 (pmic: Extend PMIC framework to support multiple instances
of PMIC devices) has incorrectly passed the PMIC name under the FSL PMIC case.

Fix that by passing "FSL_PMIC" as the parameter of pmic_get.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
11 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Wed, 12 Dec 2012 13:51:02 +0000 (06:51 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

11 years agomips: serial: Fix busted manual relocation
Joe Hershberger [Tue, 11 Dec 2012 17:52:50 +0000 (17:52 +0000)]
mips: serial: Fix busted manual relocation

serial_initialize() must be called after relocation to adjust the
pointers to putc(), getc(), etc.  This is busted ever since the
serial driver-model-ification series.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
11 years agoMIPS: constify mips_io_port_base
Daniel Schwierzeck [Wed, 12 Dec 2012 12:13:48 +0000 (13:13 +0100)]
MIPS: constify mips_io_port_base

mips_io_port_base is exported as 'extern const unsigned long mips_io_port_base;'
in arch/mips/include/asm/io.h. Thus make the variable const too.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
11 years agomtd: nand: mxs: reset BCH earlier, too, to avoid NAND startup problems
Wolfram Sang [Wed, 5 Dec 2012 10:48:47 +0000 (10:48 +0000)]
mtd: nand: mxs: reset BCH earlier, too, to avoid NAND startup problems

It could happen (1 out of 100 times) that NAND did not start up correctly after
warm rebooting, so we end up with various failures or DMA timed out due to a
stalled BCH. When resetting BCH together with GPMI, the issue could not be
observed anymore (after 10000+ reboots). We probably need the consistent state
already before sending commands to NAND. This behaviour was observed in barebox
and kernel, so I assume it affects U-Boot as well. I chose to keep the extra
reset for BCH when changing the flash layout to be on the safe side.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Marek Vasut <marex@denx.de>
11 years agocmd:spl:fix: Prevent from a build error on boards, which don't support FDT
Łukasz Majewski [Thu, 6 Dec 2012 05:23:38 +0000 (05:23 +0000)]
cmd:spl:fix: Prevent from a build error on boards, which don't support FDT

Do not compile in FDT related code, when it is not supported.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Stefano Babic <sbabic@denx.de>
11 years agoexynos: Enable hashing functions and EDID for smdk5250
Simon Glass [Wed, 5 Dec 2012 14:46:45 +0000 (14:46 +0000)]
exynos: Enable hashing functions and EDID for smdk5250

Enable SHA1/SHA256 hashing and the hash command. Also enable EDID
support for reading from an LCD.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agotpm: Add TPM stress test
Luigi Semenzato [Wed, 5 Dec 2012 14:46:44 +0000 (14:46 +0000)]
tpm: Add TPM stress test

Add a simple command to stress-test a TPM (Trusted Platform Module).

Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoconsole: Enable function to display console info
Simon Glass [Wed, 5 Dec 2012 14:46:43 +0000 (14:46 +0000)]
console: Enable function to display console info

The CONFIG_SYS_CONSOLE_INFO_QUIET option should suppress the console
information, but allow boards to display it later if required. Adjust
the code to support this.

This is used to avoid printing the information while the LCD display
is not ready, since it only becomes ready when stdio init is complete.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoAdd console command to access io space registers
Vadim Bendebury [Wed, 5 Dec 2012 14:46:42 +0000 (14:46 +0000)]
Add console command to access io space registers

Provide u-boot console functions to access IO space registers. A no
thrills implementation, accessing one register at a time.

For example:
    boot > iod 80
    0080: 00000094
    boot > iod.w 80
    0080: 0094
    boot > iod.b 80
    0080: 94
    boot > iow.b 0x80 12
    boot > iod 0x80
    0080: 00000012

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agofdt: edid: Enable fdt_add_edid() function when CONFIG_LCD defined
Tom Wai-Hong Tam [Wed, 5 Dec 2012 14:46:41 +0000 (14:46 +0000)]
fdt: edid: Enable fdt_add_edid() function when CONFIG_LCD defined

This function can be used for LCDs as well as monitors.

Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoedid: Add I2C command for printing the EDID
Tom Wai-Hong Tam [Wed, 5 Dec 2012 14:46:40 +0000 (14:46 +0000)]
edid: Add I2C command for printing the EDID

Add a single command to read the EDID information over I2C.

For example:

SMDK5250 # i2c dev 7
Setting bus to 7
SMDK5250 # i2c edid 50
EDID version: 1.4
Product ID code: 305c
Manufacturer: AUO
Serial number: 00000000
Manufactured in week: 0 year: 2011
Video input definition: digital signal, voltage level 0, blank to black
Monitor is non-RGB
Maximum visible display size: 26 cm x 14 cm
Power management features: no active off, no suspend, no standby
Estabilished timings:
Standard timings:
        1366x768        60 Hz (detailed)
        1366x768        60 Hz (detailed)
Monitor ID: 2VD2K.B116XW

Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoedid: Library of EDID decode and print
Tom Wai-Hong Tam [Wed, 5 Dec 2012 14:46:39 +0000 (14:46 +0000)]
edid: Library of EDID decode and print

This implements a library for accessing EDID data from an LCD panel.
This is used to obtain information about the panel such as its
resolution and type.

This is a tidied-up version of the original code pulled from
https://github.com/ynezz/u-boot-edid.

The changes we made are:
 - removed bit fields in the struct;
 - removed endianness cases in the struct;
 - fixed some wrong definitions;
 - fixed to fit 80 columns;
 - fixed some code styles.

Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoAdd hash command to perform hashing using various algorithms
Simon Glass [Wed, 5 Dec 2012 14:46:38 +0000 (14:46 +0000)]
Add hash command to perform hashing using various algorithms

This new command supports hashing SHA1 and SHA256. It could be extended
to others such as MD5 and the CRC algorithms. The syntax is modeled on
those:

   hash <algorithm> <address> <length> [*<dest_addr> | <dest_envvar>]

to calculate a hash, and:

   hash -v <algorithm> <address> <length> [*<verify_addr> | <verify_envvar>]

to verify a hash.

Use CONFIG_CMD_HASH to enable the command, CONFIG_SHA1 to enable SHA1 and
CONFIG_SHA256 to enable SHA256.

The existing sha1sum command remains.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agosha1sum: Use generic hash layer
Simon Glass [Wed, 5 Dec 2012 14:46:37 +0000 (14:46 +0000)]
sha1sum: Use generic hash layer

Update the code to use the hash layer instead of local code.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoAdd generic hash API
Simon Glass [Wed, 5 Dec 2012 14:46:36 +0000 (14:46 +0000)]
Add generic hash API

We have a SHA1 command and want to add a SHA256 command also. Instead of
duplicating the code, create a generic hash API which can process
commands for different algorithms.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agoAdd strcasecmp() and strncasecmp()
Simon Glass [Wed, 5 Dec 2012 14:46:35 +0000 (14:46 +0000)]
Add strcasecmp() and strncasecmp()

strncasecmp() is present as strnicmp() but disabled. Make it available
and define strcasecmp() also. There is a only a small performance penalty
to having strcasecmp() call strncasecmp(), so do this instead of a
standalone function, to save code space.

Update the prototype in arch-specific headers as needed to avoid warnings.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agosha256: Use const where possible and add watchdog function
Simon Glass [Wed, 5 Dec 2012 14:46:34 +0000 (14:46 +0000)]
sha256: Use const where possible and add watchdog function

In preparation for making the hash function common, we may as well use
const where we can.

Also add a watchdog version of the hashing function.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agosha1: Use const where possible, and unsigned for input len
Simon Glass [Wed, 5 Dec 2012 14:46:33 +0000 (14:46 +0000)]
sha1: Use const where possible, and unsigned for input len

In preparation for making the hash function common, we may as well use
const where we can. Also the input length cannot be negative, but may
be very large, so use unsigned.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 years agostdio: remove useless strncpy
Vincent Palatin [Wed, 5 Dec 2012 14:46:32 +0000 (14:46 +0000)]
stdio: remove useless strncpy

The name is already copied when we memcpy() the whole structure.

This is because struct stdio_dev has this field:

char name[16]; /* Device name */

So the data is inline, rather than being a pointer.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>