summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
...
* bootm: Remove extra OK messageSimon Glass2013-07-12-1/+0
| | | | | | This is not needed as we already print 'OK' later in all cases. Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd_bootm.c: Re-order bootm_load_os return check for ELDK4.2Tom Rini2013-07-12-3/+2
| | | | | | | | | | | With ELDK4.2 we were getting a warning that load_end may be used uninitialized in calling lmb_reserve. This could not be the case, however. If we re-order the checks (and make them slightly clearer as well) the warning goes away. bootm_load_os may only return 0 on success, BOOTM_ERR_OVERLAP in a non-fatal overlap (already covered in comments) or a fatal BOOTM_ERR that is covered in the error handler. Signed-off-by: Tom Rini <trini@ti.com>
* cmd_bootm.c: Make bootz handle BOOTM_STATE_FINDOTHER itselfTom Rini2013-07-10-16/+40
| | | | | | | | | As a zImage does not have a U-Boot header, we cannot really do what BOOTM_STATE_FINDOTHER does, exactly. Break the ramdisk/fdt portions of bootm_find_other into bootm_find_ramdisk/fdt which can be called in both cases. Signed-off-by: Tom Rini <trini@ti.com>
* cmd_bootm.c: Make bootz consume 'bootz' from argv, decrement argcTom Rini2013-07-10-5/+13
| | | | | | | Like 'bootm', 'bootz' needs to consume 'bootz' so that the rest of the state functions will work. Signed-off-by: Tom Rini <trini@ti.com>
* bootm: Add the missing PREP stage to bootz and correct image handlingSimon Glass2013-07-10-2/+3
| | | | | | | | | | | | | In the recent bootm refactor, the PREP stage was missing in the bootz command. This causes unpredictable behaviour. The use of a local variable means that the reset of cmd_bootm.c does not in fact use the same image structure, so remove this. Also manually set the OS type to Linux, since this is the only possibility at present, and we need to select the right boot function. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootm: Clean up bootz_setup() functionSimon Glass2013-07-10-5/+3
| | | | | | | | | This function has no prototype in the headers and passes void * around, thus requiring several casts. Tidy this up. - Add new patch to clean up bootz_setup() function Signed-off-by: Simon Glass <sjg@chromium.org>
* bootm: Require boot function only if it is about to be usedSimon Glass2013-07-10-2/+5
| | | | | | | | | | | The original bootm code (before commit 35fc84f) did not check for a valid boot function in the subcommand case, which was incorrect. This check was introduced in all cases, but in fact we should only check for the function when we need it. Otherwise in some cases the check fires before the OS type is known. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootm: Disable interrupts only when loadingSimon Glass2013-07-10-24/+43
| | | | | | | | | | | With the move of the interrupt code to earlier in the sequence, we exposed a problem where the interrupts are disabled at each bootm stage. This is not correct - it should be done only once. Let's disable interrupts in the LOAD stage. Put the code in a function for clarity. Also, bootz lost its interrupt code altogether, so reinstate it. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2013-07-10-47/+96
|\
| * video: consolidate splash screen alignment codeAnatolij Gustschin2013-07-08-17/+30
| | | | | | | | | | | | | | | | | | | | Code for checking "splashpos" environment variable is duplicated in drivers, move it to the common function. Call this function also in the bmp display command to consider "splashpos" settings. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Otavio Salvador <otavio@ossystems.com.br>
| * video: lcd: Make splash_screen_prepare weak, remove config macroRobert Winkler2013-07-01-9/+4
| | | | | | | | | | | | | | | | Remove CONFIG_SPLASH_SCREEN_PREPARE from README Add doc/README.splashprepare to document functionality Signed-off-by: Robert Winkler <robert.winkler@boundarydevices.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
| * video: lcd: Add CONFIG_SPLASH_SCREEN_PREPARE support to CONFIG_VIDEORobert Winkler2013-07-01-13/+40
| | | | | | | | | | | | | | | | Create splash.c/h to put the function and any future common splash screen code in. Signed-off-by: Robert Winkler <robert.winkler@boundarydevices.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
| * lcd: align bmp header when uncopmressing imagePiotr Wilczek2013-07-01-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | When compressed image is loaded, it must be decompressed to an aligned address + 2 to avoid unaligned access exception on some ARM platforms. Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Anatolij Gustschin <agust@denx.de> CC: Wolfgang Denk <wd@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de>
| * lcd: remove unaligned access in lcd_dt_simplefb_configure_node()Stephen Warren2013-07-01-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Some ARM compilers may emit code that makes unaligned accesses when faced with constructs such as: const char format[] = "r5g6b5"; Make this data static since it doesn't chagne; the compiler will simply place it into the .rodata section directly, and avoid any unaligned run- time initialization. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | cmd_bootm.c: Correct check/return for unsupported sub-commandTom Rini2013-07-04-2/+7
| | | | | | | | | | | | | | | | | | | | | | With the do_bootm_states re-organization, we have the call to any potential sub-commands in a single spot. If one fails, we can then stop right there and return to the caller. Prior to these calls we have already ensured that ret is zero so we will not be returning this error for some other case. Signed-off-by: Tom Rini <trini@ti.com> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-nand-flashTom Rini2013-07-01-8/+1
|\ \ | |/ |/|
| * nand: Don't call adjust_size_for_badblocks for eraseScott Wood2013-06-21-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adjust_size_for_badblocks reduces the operation size to account for the block skipping done by the read/write functions when an interval (partition name or whole chip) is specified rather than a data amount. Erase does not do block skipping, except for erase.spread which takes a data amount rather than an interval (and thus already does not call adjust_size_for_badblocks). Calling adjust_size_for_badblocks when block skipping is not done means that if bad blocks are present, the "nand erase.part" and "nand erase.chip" commands will fail to erase blocks at the end of the interval. Signed-off-by: Scott Wood <scottwood@freescale.com> Cc: Harvey Chapman <hchapman@3gfp.com> Acked-by: Heiko Schocher <hs@denx.de>
* | bootm: Disable interrupts before loading OSSimon Glass2013-06-28-26/+27
| | | | | | | | | | | | | | | | | | | | This restores the ordering of interrupt disable to what it what before commit 35fc84fa. It seems that on some archiectures (e.g. PowerPC) the OS is loaded into an interrupt region, which can cause problems if interrupts are still running. Tested-by: Stefan Roese <sr@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* | cmd_bootm.c: Correct BOOTM_ERR_OVERLAP handlingTom Rini2013-06-28-27/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With 35fc84fa1 [Refactor the bootm command to reduce code duplication] we stopped checking the return value of bootm_load_os (unintentionally!) and simply returned if we had a non-zero return value from the function. This broke the valid case of a legacy image file of a single kernel loaded into an overlapping memory area (the default way of booting nearly all TI platforms). The best way to fix this problem in the new code is to make bootm_load_os be the one to see if we have a problem with this, and if it's fatal return BOOTM_ERR_RESET and if it's not BOOTM_ERR_OVERLAP, so that we can avoid calling lmb_reserve() but continue with booting. We however still need to handle the other BOOTM_ERR values so re-work do_bootm_states so that we have an error handler at the bottom we can goto for problems from bootm_load_os, or problems from the other callers (as the code was before). Add a comment to do_bootm_states noting the existing restriction on negative return values. Signed-off-by: Tom Rini <trini@ti.com> --- Changes in v2: - Rework so that only bootm_load_os and boot_selected_os head down into the err case code, and other errors simply return back to the caller. Fixes 'spl export'.
* | Fix block device accesses beyond 2TiBSascha Silbe2013-06-26-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type, which is required to represent block numbers for storage devices that exceed 2TiB (the block size usually is 512B), e.g. recent hard drives. For some obscure reason, the current U-Boot code uses lbaint_t for the number of blocks to read (a rather optimistic estimation of how RAM sizes will evolve), but not for the starting address. Trying to access blocks beyond the 2TiB boundary will simply wrap around and read a block within the 0..2TiB range. We now use lbaint_t for block start addresses, too. This required changes to all block drivers as the signature of block_read(), block_write() and block_erase() in block_dev_desc_t changed. Signed-off-by: Sascha Silbe <t-uboot@infra-silbe.de>
* | cmd_bootm: Add command line arguments to Plan 9Steven Stallion2013-06-26-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces support for command line arguments to Plan 9. Plan 9 generally dedicates a small region of kernel memory (known as CONFADDR) for runtime configuration. A new environment variable named confaddr was introduced to indicate this location when copying arguments. Signed-off-by: Steven Stallion <sstallion@gmail.com> [trini: Adapt for Simon's changes about correcting argc, no need to bump by 2 now] Signed-off-by: Tom Rini <trini@ti.com>
* | image: Add support for signing of FIT configurationsSimon Glass2013-06-26-1/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While signing images is useful, it does not provide complete protection against several types of attack. For example, it it possible to create a FIT with the same signed images, but with the configuration changed such that a different one is selected (mix and match attack). It is also possible to substitute a signed image from an older FIT version into a newer FIT (roll-back attack). Add support for signing of FIT configurations using the libfdt's region support. Please see doc/uImage.FIT/signature.txt for more information. Signed-off-by: Simon Glass <sjg@chromium.org>
* | image: Add RSA support for image signingSimon Glass2013-06-26-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RSA provides a public key encryption facility which is ideal for image signing and verification. Images are signed using a private key by mkimage. Then at run-time, the images are verified using a private key. This implementation uses openssl for the host part (mkimage). To avoid bringing large libraries into the U-Boot binary, the RSA public key is encoded using a simple numeric representation in the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* | image: Support signing of imagesSimon Glass2013-06-26-23/+204
| | | | | | | | | | | | | | | | Add support for signing images using a new signature node. The process is handled by fdt_add_verification_data() which now takes parameters to provide the keys and related information. Signed-off-by: Simon Glass <sjg@chromium.org>
* | image: Add signing infrastructureSimon Glass2013-06-26-0/+43
| | | | | | | | | | | | | | Add a structure to describe an algorithm which can sign and (later) verify images. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Add a 'fake' go command to the bootm commandSimon Glass2013-06-26-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For tracing it is useful to run as much of U-Boot as possible so as to get a complete picture. Quite a bit of work happens in bootm, and we don't want to have to stop tracing before bootm starts. Add a way of doing a 'fake' boot of the OS - which does everything up to the point where U-Boot is about to jump to the OS image. This allows tracing to record right until the end. This requires arch support to work. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Refactor the bootm command to reduce code duplicationSimon Glass2013-06-26-241/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the bootm code is mostly duplicated for the plain 'bootm' command and its sub-command variant. This makes the code harder to maintain and means that changes must be made to several places. Introduce do_bootm_states() which performs selected portions of the bootm work, so that both plain 'bootm' and 'bootm <sub_command>' can use the same code. Additional duplication exists in bootz, so tidy that up as well. This is not intended to change behaviour, apart from minor fixes where the previously-duplicated code missed some chunks of code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Clarify bootm OS argumentsSimon Glass2013-06-26-31/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the arguments to bootm are processed in a somewhat confusing way. Sub-functions must know how many arguments their calling functions have processed, and the OS boot function must also have this information. Also it isn't obvious that 'bootm' and 'bootm start' provide arguments in the same way. Adjust the code so that arguments are removed from the list before calling a sub-function. This means that all functions can know that argv[0] is the first argument of which they need to take notice. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Add trace support to generic boardSimon Glass2013-06-26-1/+27
| | | | | | | | | | | | | | | | | | | | | | Add hooks for tracing to generic board, including: - allow early tracing to start early as possible in U-Boot - reserve memory for trace buffer - copy early trace buffer to main trace buffer after relocation - setup full tracing support after relocation Signed-off-by: Simon Glass <sjg@chromium.org>
* | Add a trace commandSimon Glass2013-06-26-0/+134
| | | | | | | | | | | | | | Add a trace command with sub-commands to start/stop tracing, print out statistics and dump trace information to memory for later upload to a host. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Add function to print a number with grouped digitsSimon Glass2013-06-26-18/+4
| | | | | | | | | | | | | | Move bootstage's numbering printing code into a generic place so that it can be used by tracing also. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Correct printf typesSimon Glass2013-06-26-2/+2
| | | | | | | | | | | | | | The unstash code is a bit loose with its printf() types, which gives warnings on sandbox. Correct this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Fix missing return in do_mem_loop()Simon Glass2013-06-26-0/+2
| | | | | | | | | | | | | | For some reason this does not normally cause a compiler warning, but the code seems to be incorrect. Add the missing return. Signed-off-by: Simon Glass <sjg@chromium.org>
* | pxe: add ipappend supportRob Herring2013-06-24-3/+44
| | | | | | | | | | | | Add ipappend support to pass network device information to the kernel. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | net: Fix build regression in cmd_pxe.cJoe Hershberger2013-06-24-0/+2
| | | | | | | | | | | | | | | | Not all boards define an SOC. As a result, we can't depend on that. This was introduced in 39f985536d3f0df5dba32c15b64ba2b5d32dd296 Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | pxe: add support for per arch and SoC default pathsRob Herring2013-06-24-6/+20
| | | | | | | | | | | | | | | | | | A pxelinux server setup for "default" menu is typically an x86 binary. This does not work well with a mixed architecture setup. Extend the default search to look for default-<arch>-<soc> and then default-<arch> before falling back to just "default". Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: add support for ontimeout tokenRob Herring2013-06-24-5/+6
| | | | | | | | | | | | | | | | | | ontimeout is similar to default, but is the selection on menu timeout. This is how cobbler sets a default. The label default is supposed to be the default selection when <enter> is pressed. If both default and ontimeout are set, last one parsed wins. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: simplify menu display and selectionRob Herring2013-06-24-18/+16
| | | | | | | | | | | | | | | | Menus with lots of entries and long append lines are hard to read. Just show a numbered list using the label or name and make the choice by entering the number. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: always display a menu when presentRob Herring2013-06-24-1/+2
| | | | | | | | | | | | | | | | | | The prompt flag is for displaying a "boot:" prompt in pxelinux. This doesn't make sense for u-boot as we don't support the pxelinux command interface. So we should just ignore prompt statements and always show the menu if a menu is present. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: try bootz if bootm fails to find a valid imageRob Herring2013-06-24-1/+10
| | | | | | | | | | | | | | Standard pxelinux servers will typically use a zImage rather than u-boot image format, so fallback to bootz if bootm fails. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | bootz: un-staticize do_bootzRob Herring2013-06-24-1/+1
| | | | | | | | | | | | Make do_bootz available for other functions like do_bootm is. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: fix handling of different localboot valuesRob Herring2013-06-24-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for value of -1 For localboot. A value of -1 means return to u-boot prompt. The localboot value is often 0, so we need to distinguish the value from localboot being selected. A value of greater than or equal to 0 means attempt local boot command. If localboot is selected, we don't want to try other entries. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: make string parameters constRob Herring2013-06-24-12/+12
| | | | | | | | | | | | Convert a bunch of string parameters to be const. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | pxe: Use ethact setting for pxeRob Herring2013-06-24-25/+9
| | | | | | | | | | | | | | | | Get the MAC address using eth_getenv_enetaddr_by_index so that the MAC address of ethact is used. This enables using the a NIC other than the first one for PXE boot. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-06-22-2/+107
|\ \
| * \ Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'Albert ARIBAUD2013-06-19-2/+107
| |\ \ | | | | | | | | | | | | | | | | Conflicts: spl/Makefile
| | * | COMMON: MMC: Command to support EMMC booting and to resize EMMC boot partitionAmar2013-06-13-2/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds commands to access(open/close) and resize boot partitions on EMMC. Signed-off-by: Amar <amarendra.xt@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | | | Makefile: move the common makefile line to public areaYing Zhang2013-06-20-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the common makefile line shared by the SPL and non-SPL to the public area, so that we can avoid excessive SPL symbols. Some of them will be used by the SPL later. This patch is on top of the patch "common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL". Signed-off-by: Ying Zhang <b40530@freescale.com> Acked-by: Tom Rini <trini@ti.com> Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
* | | | common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPLYing Zhang2013-06-20-10/+17
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There will need the environment in SPL for reasons other than network support (in particular, hwconfig contains info for how to set up DDR). Add a new symbol CONFIG_SPL_ENV_SUPPORT to replace CONFIG_SPL_NET_SUPPORT for environment in common/Makefile. Signed-off-by: Ying Zhang <b40530@freescale.com> Reviewed-by: Tom Rini <trini@ti.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
* | | image: Use ENOENT instead of ENOMEDIUM for better compatibilitySimon Glass2013-06-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This error may not be defined on some platforms such as MacOS so host compilation will fail. Use one of the more common errors instead. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com> Tested-by: Lubomir Popov <lpopov@mm-sol.com>