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

    Karl Apsite
     

19 Apr, 2015

1 commit


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 failed

    reason is commmit:
    35fc84fa1f: 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
    Reviewed-by: Simon Glass

    Heiko Schocher
     

30 Jan, 2015

1 commit


22 Oct, 2014

1 commit


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

    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 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

    Simon Glass
     

12 Jun, 2014

1 commit


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

    Heiko Schocher
     

30 May, 2014

1 commit


23 May, 2014

1 commit


13 May, 2014

1 commit


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

    Sebastian Siewior
     

18 Apr, 2014

1 commit


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

    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

    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

    Miao Yan
     

13 Dec, 2013

2 commits


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

    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

    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

    Frederic 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

    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

    Kees Cook
     
  • 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

    Simon Glass
     

17 Aug, 2013

2 commits


24 Jul, 2013

1 commit


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

    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

    Simon Glass
     

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

    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

    Simon Glass
     
  • This is not needed as we already print 'OK' later in all cases.

    Signed-off-by: Simon Glass

    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

    Tom Rini
     

10 Jul, 2013

6 commits