Commit Graph

13166 Commits

Author SHA1 Message Date
James Kosin 975afc34dd post: fix indendation/brace confusion
The post.c code is missing braces around the pass case, and as a
result, the diagnostic function will post both fail and pass for
a failed test.  The reason for this bug is probably the incorrect
indentation used, so when reading the code it seems like there
are proper braces.

Indent the code to the correct depth and put proper braces around
the "else" branch of the "if" statement.

Signed-off-by: James Kosin <jkosin@intcomgrp.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:57:49 +02:00
Mike Frysinger 14ce91b115 fix unconfigured out-of-tree building of tools
Now that the tools target requires the generated version header file, we
need to make sure that the directory it writes to exists.  In a configured
tree, this is taken care of for us.  But in an unconfigured one, the dir
does not yet exist causing a build error like so:

/bin/sh: line 5: ..../u-boot_build/include/version_autogenerated.h.tmp: No such file or directory

So create the dir for this file before we attempt to generate it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:55:20 +02:00
Mike Frysinger d2e8b911c0 panic: add noreturn attribute
Since panic() never returns, we should add an appropriate attribute to
let gcc improve optimization around it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:54:22 +02:00
Mike Frysinger afd077bd14 simplify clobber behavior with out-of-tree builds
The targets/prerequisites are the same here; the rules only differ in
the recipes.  So move the if logic protection to the recipe part so we
can keep the rest the same.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:53:23 +02:00
Mike Frysinger f6f7395eb3 post: new nor flash test
This adds a simple flash test to automatically verify erasing,
writing, and reading of sectors.  The code is based on existing
Blackfin tests but generalized for everyone to use.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:49:44 +02:00
Mike Frysinger d2397817f1 post: use ARRAY_SIZE
We've got a handy dandy macro already for calculating the number of
elements in an array, so use it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:48:33 +02:00
Mike Frysinger 9146d13821 post: add gpio hotkey support
Now that we have the generic GPIO layer, we can easily provide a common
implementation for the post_hotkeys_pressed() function based on it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:47:39 +02:00
Mike Frysinger 7b826c2f35 serial: implement common uart post test
The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data.  If we ignore
the loop back part, the rest can be built upon the existing common serial
API.  So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it.  This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over.  So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:39:03 +02:00
Mike Frysinger 1c9a5606d8 serial: drop useless ctlr field
The multi serial support has a "ctlr" field which almost no one uses,
but everyone is forced to set to useless strings.  So punt it.

Funny enough, the only code that actually reads this field (the mpc8xx
driver) has a typo where it meant to look for the SCC driver.  Fix it
while converting the check to use the name field.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>
2011-07-26 16:38:05 +02:00
Mike Frysinger c52b4f7945 serial: drop serial_register return value
The serial_register function never fails (always return 0), so change it
to a void function to avoid wasting overhead on it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:38:01 +02:00
Mike Frysinger 6c768ca746 serial: push default_serial_console to drivers
Rather than sticking arch/board/driver specific logic in the common
serial code, push it all out to the respective drivers.  The serial
drivers declare these funcs weak so that boards can still override
things with their own definition.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>
Tested-by: Minkyu Kang <mk7.kang@samsung.com>
2011-07-26 16:37:57 +02:00
Mike Frysinger 6262e4e74e disable security warning flags when possible
Some toolchains enable security warning flags by default, but these don't
really make sense in the u-boot world.  Such as forcing changes like:
	-printf(foo);
	+printf("%s", foo);

So disable the flags when the compiler supports them.  Linux has already
merged a similar change in their build system.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:35:50 +02:00
Mike Frysinger e84ffddbce cmd_usage: constify
The usage helper doesn't modify the command, so constify its input arg.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:34:41 +02:00
Mike Frysinger 147c7169e8 constify default env
I can't see any obvious needs for the default environment to be writable,
so make it const.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:34:22 +02:00
Mike Frysinger c3eb3fe490 env: allow people to force envcrc building
For people who want to manually extract the embedded environment so that
it can be manually packed into the final u-boot image, add a config opt
to force building of the envcrc tool.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:33:49 +02:00
Mike Frysinger 8875bdb341 sf: sst: support newer standardized flashes
Newer SST flashes have dropped the Auto Address Increment (AAI) word
programming (WP) modes in favor of the standard page programming mode
that most flashes now support.  So add a flags field to the different
flashes to support both modes with new and old styles.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:32:59 +02:00
Mike Frysinger 66ecb7cdb0 sf: unify write disable commands
Every spi flash uses the same write disable command, so unify this in
the common code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Fixed commit message.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-07-26 16:32:15 +02:00
Mike Frysinger fba2c44e46 sf: eon/stmicro: inline useless ID defines
These defines are used in only one place, so just inline them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:31:07 +02:00
Mike Frysinger b06afa75fa sf: kill off now-unused local state
Now that the common spi_flash structure tracks all the info that these
drivers need, kill off their local state indirection and use just what
the common code provides.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:29:59 +02:00
Mike Frysinger d4aa500913 sf: unify write funcs
Once we add a new page_size field for write lengths, we can unify the
write methods for most of the spi flash drivers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:29:27 +02:00
Mike Frysinger 2744a4e688 sf: unify write enable commands
Every spi flash uses the same write enable command, so unify this in
the common code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:28:21 +02:00
Mike Frysinger d8e392d95f MAKEALL: add -h/--help options
Convert all the comments at the top of the file into help text for people
to easily get at with standard -h/--help options.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-26 16:25:32 +02:00
Graeme Russ 17659d7de9 Timer: Remove reset_timer_masked()
In some circumstances, reset_timer_masked() was called be timer_init() in
order to perform architecture specific timer initialisation. In such
cases, the required code in reset_timer_masked() has been moved into
timer_init()
2011-07-26 14:54:15 +02:00
Graeme Russ 53fc43c682 Timer: Fix at91rm9200/spi.c timer usage 2011-07-26 14:53:55 +02:00
Graeme Russ 4769be21cc Timer: Remove reset_timer() for non-Nios2 arches 2011-07-26 14:53:30 +02:00
Graeme Russ e110c4fe44 Timer: Allow reset_timer() only for systems with low resolution timers 2011-07-26 14:52:53 +02:00
Graeme Russ 5c8404aff1 Timer: Remove set_timer completely 2011-07-26 14:52:17 +02:00
Graeme Russ dcac25a05e Remove calls to set_timer outside arch/
There is no need to use set_timer(). Replace with appropriate use of
get_timer()

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Acked-by: Wolfgang Denk <wd@denx.de>
2011-07-26 14:51:13 +02:00
Daniel Schwierzeck 525728b414 spl: add support for omap-common libraries
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-07-26 14:44:42 +02:00
Daniel Schwierzeck efcc6096d6 spl: Add support for common libraries and drivers
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-07-26 14:44:38 +02:00
Aneesh V 401bb30b6d replace CONFIG_PRELOADER with CONFIG_SPL_BUILD
replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD

Signed-off-by: Aneesh V <aneesh@ti.com>
2011-07-26 14:44:34 +02:00
Aneesh V 05bad4aa56 scaled down version of generic libraries for SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
2011-07-26 14:44:25 +02:00
Aneesh V 5253418a77 arm: adjust PLATFORM_LIBS for SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-07-26 14:43:48 +02:00
Daniel Schwierzeck 5df2ee27db Hook SPL build-system into toplevel Makefile
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-07-26 14:43:04 +02:00
Daniel Schwierzeck c8f9c302c2 Extend build-system for SPL framework
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-07-26 14:42:40 +02:00
Daniel Schwierzeck 6a11cf48a5 spl: add initial support for a generic SPL framework
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-07-26 14:42:12 +02:00
Daniel Schwierzeck 4e0fbb98fc Use ALL-y style instead of ifeq blocks for better readability
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-07-26 14:41:43 +02:00
Jens Scharsig a16a84b725 Fix: watchdog timed out, if using md5 command
* Fix: if using md5 command watchdog timed out
* change function call md5(..) to the watchdog-safe variant
  md5_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 14:36:07 +02:00
Jens Scharsig 3e499b6ab0 Fix: watchdog timed out, if using sha1 command
* Fix: if using sha1 command watchdog timed out
* change function call sha1_csum(..) to the watchdog-safe variant
  sha1_csum_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 14:33:10 +02:00
Matthew McClintock d0c4c33850 command/cmd_cache.c: Add optional flush arguments
It might be desirable to have the ability to flush icache/dcache
within u-boot, this patch gives each arch the ability to provide
a flush_dcache/flush_icache function to let u-boot flush caches
from the prompt

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:30:08 +02:00
Matthew McClintock 0e0996ef4f common/cmd_ximg.c: add ifdef protection for gzip uncompression
Print a message if we do not have the ability to uncompress a gzip
image. Before, u-boot would just assume the routines were available

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:11:21 +02:00
Matthew McClintock df3fc52608 disk/part.c: Make features optional
If we don't want to build support for any partition types we can now
add #undef CONFIG_PARTITIONS in a board config file to keep this from
being compiled in. Otherwise boards assume this is compiled in by
default

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:10:14 +02:00
Laurence Withers 07c07635b4 miiphy: use strncpy() not sprintf()
In miiphy_register() the new device's name was initialised by passing a
string parameter as the format string to sprintf(). As this would cause
problems if it ever contained a '%' symbol, switch to using strncpy()
instead.

Signed-off-by: Laurence Withers <lwithers@guralp.com>
Cc: Andy Fleming <afleming@freescale.com>
2011-07-26 14:00:24 +02:00
Kumar Gala 9e9579bbf9 powerpc: Fix device tree padding associated with ramdisk
When booting with a ramdisk we bump the amount of memory reserved for
the device tree by FDT_RAMDISK_OVERHEAD.  However we did not increase
the actual size in the device tree blob to match.

Its possible on boundary cases that we dont have enough memory according
to the device tree blob and get errors like:

WARNING: could not set linux,initrd-end FDT_ERR_NOSPACE

We can easily fix this by setting the device tree size at the same time
we bump the amount of memory reserved for the device tree.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2011-07-26 13:55:10 +02:00
Wolfgang Denk 3cfe695489 Revert "post, memory test: add memory_post_test() to include file"
This reverts commit f18714dd61
which cuases compile errors on a number of boards.

Signed-off-by:  Wolfgang Denk <wd@denx.de>
2011-07-26 13:53:35 +02:00
Jens Scharsig 39c6e039a0 Fix: if using crc32 command watchdog timed out
* Fix: if using crc32 command watchdog timed out
* change function call crc32(..) to the watchdog-safe variant
  crc_32_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 00:40:50 +02:00
Matthias Weisser b038db852b memcpy/memmove: Do not copy to same address
In some cases (e.g. bootm with a elf payload which is already at the right
position) there is a in place copy of data to the same address. Catching this
saves some ms while booting.

Signed-off-by: Matthias Weisser <weisserm@arcor.de>
2011-07-26 00:28:44 +02:00
Rob Herring 942e31437d scsi/ahci: add support for non-PCI controllers
Add support for AHCI controllers that are not PCI based.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Wolfgang Denk <wd@denx.de>
2011-07-26 00:06:58 +02:00
Rob Herring e5a6c79d42 scsi/ahci: ata id little endian fix
The ata id string always needs swapping, not just on BE machines.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2011-07-26 00:06:08 +02:00
Heiko Schocher f18714dd61 post, memory test: add memory_post_test() to include file
This include is needed, if this memory test is used "outside"
from post code, for example booting with nand_spl, and using
this memory test before copying u-boot code to RAM and jumping
to it.

Signed-off-by: Heiko Schocher <hs@denx.de>
2011-07-25 23:43:35 +02:00