28 May, 2015
1 commit
-
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, so removing
the wrapper, and condensing these together hopefully makes the code a
little simpler.Signed-off-by: Karl Apsite
Reviewed-by: Simon Glass
19 Apr, 2015
1 commit
-
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
Reviewed-by: Simon Glass
06 Mar, 2015
1 commit
-
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 failedreason is commmit:
35fc84fa1f: Refactor the bootm command to reduce code duplicationIt 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
Reviewed-by: Simon Glass
30 Jan, 2015
1 commit
-
Fake option is enabled only when CONFIG_TRACE is
enabled in common/bootm.c:do_boot_states().Signed-off-by: Michal Simek
Reviewed-by: Simon Glass
22 Oct, 2014
1 commit
-
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
30 Aug, 2014
1 commit
-
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
19 Jun, 2014
1 commit
-
This file has code in three different categories:
- Command processing
- OS-specific boot code
- Locating images and setting up to bootOnly 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.cHeader files and extern declarations are tidied but otherwise no code
changes are made, to make it easier to review.Signed-off-by: Simon Glass
12 Jun, 2014
1 commit
-
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
Acked-by: Simon Glass
Tested-by: Simon Glass
Tested-by: Stefan Roese
06 Jun, 2014
1 commit
-
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
Cc: Simon Glass
Cc: Lars Steubesand
Cc: Mike Pearce
Cc: Wolfgang Denk
Cc: Tom Rini
Cc: Michal Simek
Acked-by: Simon Glass
30 May, 2014
1 commit
-
Some files include hush.h but don't actually use it. Remove this where
possible.Signed-off-by: Simon Glass
23 May, 2014
1 commit
13 May, 2014
1 commit
-
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
08 May, 2014
1 commit
-
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
Signed-off-by: Sebastian Andrzej Siewior
Signed-off-by: Rob Herring
Reviewed-by: Tom Rini
Reviewed-by: Lukasz Majewski
18 Apr, 2014
1 commit
-
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
Signed-off-by: Kees Cook
Tested-by: Matthias Weißer
Acked-by: Simon Glass
22 Feb, 2014
1 commit
-
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
14 Jan, 2014
1 commit
-
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
16 Dec, 2013
1 commit
-
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
[trini: Fix build error when !CONFIG_OF_FDT is set, typo on PowerPC,
missing extern ft_fixup_num_cores]
Signed-off-by: Tom Rini
13 Dec, 2013
2 commits
-
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
-
The documentation suggested the arguments where passed over r3-r6
while the code below simply does that over r0-r3.Cc: Kumar Gala
08 Nov, 2013
1 commit
-
In commit "5c427e4: use BOOTM_STATE_OS_CMDLINE flag for plain bootm"
and "3d187b3: 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
24 Sep, 2013
1 commit
-
In 5c427e4 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
Signed-off-by: Tom Rini
20 Sep, 2013
2 commits
-
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
-
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
04 Sep, 2013
2 commits
-
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
Acked-by: Simon Glass -
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
Acked-by: Kees Cook
17 Aug, 2013
2 commits
-
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
Acked-by: Simon Glass -
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
24 Jul, 2013
1 commit
-
Signed-off-by: Wolfgang Denk
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini
17 Jul, 2013
1 commit
-
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
13 Jul, 2013
1 commit
-
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
[trini: Update slightly based on Simon's changes to also cover
CONFIG_TRACE/BOOTM_STATE_FAKE_OS_GO]
Signed-off-by: Tom Rini
12 Jul, 2013
4 commits
-
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 a51ec63 and 53f375f) 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
-
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
-
This is not needed as we already print 'OK' later in all cases.
Signed-off-by: Simon Glass
-
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
10 Jul, 2013
6 commits
-
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
-
Like 'bootm', 'bootz' needs to consume 'bootz' so that the rest of the
state functions will work.Signed-off-by: Tom Rini
-
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
-
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
-
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
-
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