- Jan 25, 2016
-
-
Simon Glass authored
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Heiko Schocher <hs@denx.de> Acked-by:
Stefan Roese <sr@denx.de> Acked-by:
Przemyslaw Marczak <p.marczak@samsung.com>
-
Simon Glass authored
There are a lot of unrelated files in common, including all of the commands. Moving them into their own directory makes them easier to find and is more logical. Some commands include non-command code, such as cmd_scsi.c. This should be sorted out at some point so that the function can be enabled with or without the associated command. Unfortunately, with m68k I get this error: m68k: + M5329AFEE +arch/m68k/cpu/mcf532x/start.o: In function `_start': +arch/m68k/cpu/mcf532x/start.S:159:(.text+0x452): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o I hope someone can shed some light on what this means. I hope it isn't depending on the position of code in the image. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Heiko Schocher <hs@denx.de> Acked-by:
Stefan Roese <sr@denx.de> Acked-by:
Przemyslaw Marczak <p.marczak@samsung.com>
-
- May 28, 2015
-
-
Karl Apsite authored
bootm_find_ramdisk_fdt() renamed to bootm_find_images() for readability. The function bootm_find_ramdisk_fdt() appears to be a simple wrapper for bootm_find_ramdisk(), bootm_find_fdt(), and now bootm_find_loadables(). I didn't see any other callers entering a bootm_find<thing>, so removing the wrapper, and condensing these together hopefully makes the code a little simpler. Signed-off-by:
Karl Apsite <Karl.Apsite@dornerworks.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Apr 18, 2015
-
-
Joe Hershberger authored
In the case where the arch defines a custom map_sysmem(), make sure that including just mapmem.h is sufficient to have these functions as they are when the arch does not override it. Also split the non-arch specific functions out of common.h Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Mar 06, 2015
-
-
Heiko Schocher authored
running "spl export ..." more than once fails with: Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order Trying to execute a command out of order ERROR prep subcommand failed! Subcommand failed reason is commmit: 35fc84fa: Refactor the bootm command to reduce code duplication It used "state != BOOTM_STATE_START" but state is a bitfield, so check if the bit BOOTM_STATE_START is not set. With this fix, "spl export ..." can called more than once ... Signed-off-by:
Heiko Schocher <hs@denx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 29, 2015
-
-
Michal Simek authored
Fake option is enabled only when CONFIG_TRACE is enabled in common/bootm.c:do_boot_states(). Signed-off-by:
Michal Simek <michal.simek@xilinx.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Oct 22, 2014
-
-
Simon Glass authored
Add a new setup@ section to the FIT which can be used to provide a setup binary for booting Linux on x86. This makes it possible to boot x86 from a FIT. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Aug 30, 2014
-
-
Tom Rini authored
The default format for arm64 Linux kernels is the "Image" format, described in Documentation/arm64/booting.txt. This, along with an optional gzip compression on top is all that is generated by default. The Image format has a magic number within the header for verification, a text_offset where the Image must be run from, an image_size that includes the BSS and reserved fields. This does not support automatic detection of a gzip compressed image. Signed-off-by:
Tom Rini <trini@ti.com>
-
- Jun 19, 2014
-
-
Simon Glass authored
This file has code in three different categories: - Command processing - OS-specific boot code - Locating images and setting up to boot Only the first category really belongs in a file called cmd_bootm.c. Leave the command processing code where it is. Split out the OS-specific boot code into bootm_os.c. Split out the other code into bootm.c Header files and extern declarations are tidied but otherwise no code changes are made, to make it easier to review. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jun 11, 2014
-
-
Thomas Betker authored
run_command() returns 0 for success, 1 for failure. Fix places which assume that failure is indicated by a negative return code. Signed-off-by:
Thomas Betker <thomas.betker@rohde-schwarz.com> Acked-by:
Simon Glass <sjg@chromium.org> Tested-by:
Simon Glass <sjg@chromium.org> Tested-by:
Stefan Roese <sr@denx.de>
-
- Jun 05, 2014
-
-
Heiko Schocher authored
make the use of legacy image format configurable through the config define CONFIG_IMAGE_FORMAT_LEGACY. When relying on signed FIT images with required signature check the legacy image format should be disabled. Therefore introduce this new define and enable legacy image format if CONFIG_FIT_SIGNATURE is not set. If CONFIG_FIT_SIGNATURE is set disable per default the legacy image format. Signed-off-by:
Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Lars Steubesand <lars.steubesand@philips.com> Cc: Mike Pearce <mike@kaew.be> Cc: Wolfgang Denk <wd@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Michal Simek <monstr@monstr.eu> Acked-by:
Simon Glass <sjg@chromium.org>
-
- May 29, 2014
-
-
Simon Glass authored
Some files include hush.h but don't actually use it. Remove this where possible. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- May 12, 2014
-
-
Tom Rini authored
We say we have an XIP (in this case, image loaded at desired execution address) when the image header has been offset in the load. It's possible that in some cases executing the header is non-fatal but that's not true in many other cases. Signed-off-by:
Tom Rini <trini@ti.com>
-
- May 08, 2014
-
-
Sebastian Siewior authored
This patch adds support for the Android boot-image format. The header file is from the Android project and got slightly alterted so the struct + its defines are not generic but have something like a namespace. The header file is from bootloader/legacy/include/boot/bootimg.h. The header parsing has been written from scratch and I looked at bootloader/legacy/usbloader/usbloader.c for some details. The image contains the physical address (load address) of the kernel and ramdisk. This address is considered only for the kernel image. The "second image" defined in the image header is currently not supported. I haven't found anything that is creating this. v3 (Rob Herring): This is based on http://patchwork.ozlabs.org/patch/126797/ with the following changes: - Rebased to current mainline - Moved android image handling to separate functions in common/image-android.c - s/u8/char/ in header to fix string function warnings - Use SPDX identifiers for licenses - Cleaned-up file source information: android_image.h is from file include/boot/bootimg.h in repository: https://android.googlesource.com/platform/bootable/bootloader/legacy The git commit hash is 4205b865141ff2e255fe1d3bd16de18e217ef06a usbloader.c would be from the same commit, but it does not appear to have been used for any actual code. v4: - s/andriod/android/ - Use a separate flag ep_found to track if the entry point has been set rather than using a magic value. Cc: Wolfgang Denk <wd@denx.de> Signed-off-by:
Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by:
Rob Herring <robh@kernel.org> Reviewed-by:
Tom Rini <trini@ti.com> Reviewed-by:
Lukasz Majewski <l.majewski@samsung.com>
-
- Apr 18, 2014
-
-
Kees Cook authored
The LZO decompressor wasn't initializing the maximum output size, which meant it would fail to decompress most of the time. Reported-by:
Matthias Weißer <weisserm@arcor.de> Signed-off-by:
Kees Cook <keescook@chromium.org> Tested-by:
Matthias Weißer <weisserm@arcor.de> Acked-by:
Simon Glass <sjg@chromium.org>
-
- Feb 21, 2014
-
-
Christian Eggers authored
do_bootm_standanlone() calls ntohl(images->ep) which is wrong because endianess conversion has already been done: do_bootm() \-do_bootm_states() +-bootm_find_os() | \-images.ep = image_get_ep(); | \-uimage_to_cpu(hdr->ih_ep); \-boot_selected_os() \-do_bootm_standanlone() Without this conversion the code works correctly at least on AT91SAM9G45. On big endian systems there should be no difference after applying this patch because uimage_to_cpu(x) and ntohl(x) both expand to 'x'. Signed-off-by:
Christian Eggers <ceggers@gmx.de>
-
- Jan 14, 2014
-
-
Simon Glass authored
For standalone images, bootm had a special case where the OS boot function was NULL but did actually exist. It was just called manually. This was removed by commit 35fc84fa which checks for the non-existence of this function before the special case is examined. There is no obvious reason why standalone is handled with a special case. Adjust the code so that standalone has a normal OS boot function. We still need a special case for when the function returns, but at least we can avoid the main problem. This is intended to fix the reported: ERROR: booting os 'U-Boot' (17) is not supported but needs testing. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Dec 16, 2013
-
-
Miao Yan authored
The next version VxWorks adopts device tree (for PowerPC and ARM) as its hardware description mechanism. For PowerPC, the boot interface conforms to the ePAPR standard, which is: void (*kernel_entry)(ulong fdt_addr, ulong r4 /* 0 */, ulong r5 /* 0 */, ulong r6 /* EPAPR_MAGIC */, ulong r7 /* IMA size */, ulong r8 /* 0 */, ulong r9 /* 0 */) For ARM, the boot interface is: void (*kernel_entry)(void *fdt_addr) Signed-off-by:
Miao Yan <miao.yan@windriver.com> [trini: Fix build error when !CONFIG_OF_FDT is set, typo on PowerPC, missing extern ft_fixup_num_cores] Signed-off-by:
Tom Rini <trini@ti.com>
-
- Dec 13, 2013
-
-
Miao Yan authored
do_bootm_vxworks now is available under the configuration option CONFIG_BOOTM_VXWORKS, thus aligned with other operating systems that supported by bootm command. The bootvx command still depneds on CONFIG_CMD_ELF. Signed-off-by:
Miao Yan <miao.yan@windriver.com>
-
Kees Jongenburger authored
The documentation suggested the arguments where passed over r3-r6 while the code below simply does that over r0-r3. Cc: Kumar Gala <galak@kernel.crashing.org>
-
- Nov 08, 2013
-
-
Miao Yan authored
In commit "5c427e49: use BOOTM_STATE_OS_CMDLINE flag for plain bootm" and "3d187b39: Only pass BOOTM_STATE_OS_CMDLINE on PowerPC/MIPS", BOOTM_STATE_OS_CMDLINE was added to do_bootm for PowerPC and MIPS. This breaks other OSes (vxworks, netbsd, plan9,...) that don't support subcommand processing, e.g. they all contain the following code in their do_bootm_xxx(): if (flag & BOOTM_STATE_OS_PREP) return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; which will result a "subcommand not supported" error. This patch changes the above logic to: /* if not go command, pretend everything to be OK */ if (flag != BOOTM_STATE_OS_GO) return 0; Signed-off-by:
Miao Yan <miao.yan@windriver.com>
-
- Sep 23, 2013
-
-
Tom Rini authored
In 5c427e49 we pass BOOTM_STATE_OS_CMDLINE as part of the bootm states to run, on all arches. However, this is only valid / useful on PowerPC and MIPS, and causes a problem on ARM where we specifically do not use it. Rather than make this state fake pass like we do for GO on some arches (which need updating to use the GO state), we should just not pass CMDLINE except when it may be used, like before. Tested-by:
Dan Murphy <dmurphy@ti.com> Signed-off-by:
Tom Rini <trini@ti.com>
-
- Sep 20, 2013
-
-
Frederic Leroy authored
Netconsole calls eth_halt() before giving control to another operating system. But the state machine of netconsole don't take it into account. Thus, netconsole calls network functions of an halted network device, making the whole system freeze. Rather than modifying the state machine of netconsole, we just unregister the current network device before booting. It does work because nc_send_packet() verifies that the current network device is not null. Signed-off-by:
Frédéric Leroy <fredo@starox.org>
-
Paul Burton authored
A plain bootm used to call the architecture specific boot function with no flags, but was modified by commit 35fc84fa "Refactor the bootm command to reduce code duplication" to call the architecture specific boot function multiple times with various flags in sequence. The BOOTM_STATE_OS_CMDLINE flag was not used, indeed it seems that at least ARM prepares the command line on BOOTM_STATE_OS_PREP. However on MIPS since commit 59e8cbdb "MIPS: bootm: refactor initialisation of kernel cmdline" the command line is not prepared in response to a BOOTM_STATE_OS_PREP flag, only on BOOTM_STATE_OS_CMDLINE or a call with no flags. The end result is that a combination of those 2 commits leads to MIPS boards booting kernels with no command line arguments. An extra invocation of the architecture specific boot function with BOOTM_STATE_OS_CMDLINE fixes this. Signed-off-by:
Paul Burton <paul.burton@imgtec.com>
-
- Sep 03, 2013
-
-
Kees Cook authored
While nothing presently examines the destination size, it should at least be correct so that future users of sys_mapmem() will not be surprised. Without this, it might be possible to overflow memory. Signed-off-by:
Kees Cook <keescook@chromium.org> Acked-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Correct the following warnings found with sandbox when compression is enabled. cmd_bootm.c: In function 'bootm_load_os': cmd_bootm.c:443:11: warning: passing argument 4 of 'lzop_decompress' from incompatible pointer type [enabled by default] /usr/local/google/c/cosarm/src/third_party/u-boot/files/include/linux/lzo.h:31:5: note: expected 'size_t *' but argument is of type 'uint *' cmd_ximg.c: In function 'do_imgextract': cmd_ximg.c:225:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_ximg.c:225:14: warning: 'hdr' may be used uninitialized in this function [-Wuninitialized] Signed-off-by:
Simon Glass <sjg@chromium.org> Acked-by:
Kees Cook <keescook@chromium.org>
-
- Aug 16, 2013
-
-
Paul B. Henson authored
This function is only defined if CONFIG_SILENT_CONSOLE is set and CONFIG_SILENT_U_BOOT_ONLY is not set, the call to it should be based on the same conditions. Signed-off-by:
Paul B. Henson <henson@acm.org> Acked-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
At present the console for linux is silent if the U-Boot console is silent, unless CONFIG_SILENT_U_BOOT_ONLY is set. I wonder if a better way would be to have an environment variable to control this? Then we can control the verbosity from scripts, and set the variable to 'no' for those boards that want Linux to boot with console output. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jul 24, 2013
-
-
Wolfgang Denk authored
Signed-off-by:
Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by:
Tom Rini <trini@ti.com>
-
- Jul 17, 2013
-
-
Simon Glass authored
Before the bootm refactor, fixup_silent_linux() was done only in the monolithic bootm case, not in the subcommand case. With the refactor, it is done always, which is good. Unfortunately it is done too late, since it is the PREP or CMDLINE stages that set up the command line for Linux. Move fixup_silent_linux() into the LOADOS stage, which is where we find out the OS being used, and can thus decide whether to perform this step. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jul 12, 2013
-
-
Simon Glass authored
A recent bootm fix left the error path incomplete. If CONFIG_TRACE is set it may still not be a supported command, so cover that with the unsupported subcommand print. Once we handle BOOTM_STATE_OS_GO, we can just move into the error handler itself, no need for a goto there. Signed-off-by:
Simon Glass <sjg@chromium.org> [trini: Update slightly based on Simon's changes to also cover CONFIG_TRACE/BOOTM_STATE_FAKE_OS_GO] Signed-off-by:
Tom Rini <trini@ti.com>
-
Simon Glass authored
If a specific configuraion is selected by the bootm command, e.g. with 'bootm 84000000#recoveryconf' we must honour this for not just the kernel, but also the ramdisk and FDT. In the conversion to using a common fit_image_load() function for loading images from FITs (commits a51ec63b and 53f375fa) this feature was lost. Reinstate it by passing the selected configuration back from fit_image_load() to boot_get_kernel(), then use this configuration (which is stored in images->fit_uname_cfg) in both boot_get_ramdisk() and boot_get_fdt(). Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The OS function is now always called with the PREP stage. Adjust the remaining bootm OS functions to deal with this correctly. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This is not needed as we already print 'OK' later in all cases. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Tom Rini authored
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>
-
- Jul 10, 2013
-
-
Tom Rini authored
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>
-
Tom Rini authored
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>
-
Simon Glass authored
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>
-
Simon Glass authored
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>
-
Simon Glass authored
The original bootm code (before commit 35fc84fa) 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>
-