15 Jul, 2019

1 commit

  • this commit is a merge of three patches from imx_v2018.03 as below:

    1.
    commit dbcf1e3cc079d2f1b3df6c4c9ec3a34d0c05eb4c
    Author: Luo Ji
    Date: Fri Jun 8 10:31:11 2018 +0800

    [iot] Support dual bootloader in SPL

    Move the A/B slot check to SPL, the A/B slot switch
    workflow is just like what we have in libavb_ab.

    Test: A/B select works fine on imx8m.

    2.
    commit 71562aae3b8123ccd7503e596e478951568fcd24
    Author: Ji Luo
    Date: Mon Jan 14 18:28:08 2019 +0800

    MA-13938 [Android] imx8q: Support dual bootloader feature

    Support dual bootloader feature for imx8q which uses the
    container format. Move the A/B slot select and verify to
    SPL stage, the bootloader rollback index will be stored
    at the last 8K bytes of eMMC rpmb storage.

    Test: Boot and rbindex verify pass on imx8q.

    Change-Id: Ic9410a48092cc05de599dd897fc912177e2a1fe1
    Signed-off-by: faqiang.zhu

    Ji Luo
     

09 Jul, 2019

1 commit

  • When download image through ROM API for stream mode (USB, eMMC fastboot).
    We uses tricky way to get the total image size:
    The spl_load_simple_fit is called but the data reading is invalid, so the image
    data is not really downloaded.
    We should not call HAB authenticate in this tricky way. Otherwise it
    will alway fail.
    This patch add a new flag SPL_FIT_BYPASS_POST_LOAD to skip the authentication
    only for this tricky using.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 47b0cf6de06ff9b3e2b2755d5c8203210378b26a)

    Ye Li
     

19 Feb, 2019

1 commit

  • SPL currently does not check uImage CRCs when loading U-Boot.

    This patch adds checking the uImage CRC when SPL loads U-Boot. It does
    this by reusing the existing config option SPL_CRC32_SUPPORT to allow
    leaving out the CRC check on boards where the additional code size or
    boot time is a problem (adding the CRC check currently adds ~1.4 kByte
    to flash).

    The SPL_CRC32_SUPPORT config option now gets enabled by default if SPL
    support for legacy images is enabled to check the CRC on all boards
    that don't actively take countermeasures.

    Signed-off-by: Simon Goldschmidt
    Reviewed-by: Simon Glass

    Simon Goldschmidt
     

01 Jan, 2019

2 commits

  • Introduce function prototypes for board_spl_fit_size_align and
    board_spl_fit_post_load

    Signed-off-by: Peng Fan

    Peng Fan
     
  • Introduce two board level callback functions to FIT image loading process, and
    a SPL_FIT_FOUND flag to differentiate FIT image or RAW image.

    Implement functions in imx common SPL codes to call HAB funtion
    to authenticate the FIT image. Generally, we have to sign multiple regions
    in FIT image:
    1. Sign FIT FDT data (configuration)
    2. Sign FIT external data (Sub-images)

    Because the CSF supports to sign multiple memory blocks, so that we can use one
    signature to cover all regions in FIT image and only authenticate once.
    The authentication should be done after the entire FIT image is loaded into
    memory including all sub-images.
    We use "-p" option to generate FIT image to reserve a space for FIT IVT
    and FIT CSF, also this help to fix the offset of the external data (u-boot-nodtb.bin,
    ATF, u-boot DTB).

    The signed FIT image layout is as below:
    --------------------------------------------------
    | | | | | | | |
    | FIT | FIT | FIT | | U-BOOT | ATF | U-BOOT |
    | FDT | IVT | CSF | | nodtb.bin | | DTB |
    | | | | | | | |
    --------------------------------------------------

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    Reviewed-by: Tom Rini
    Signed-off-by: Peng Fan

    Ye Li
     

07 Dec, 2018

1 commit

  • commit d6330064634a ("spl: Add a define for SPL_TPL_PROMPT")

    changes the SPL/TPL banner from upper case into lower
    case. As SPL and TPL are three-letter acronyms and they
    are written in upper case, change it back to upper case.

    Signed-off-by: Heiko Schocher
    Reviewed-by: Simon Glass

    Heiko Schocher
     

26 Nov, 2018

3 commits

  • There is some basic informaton that SPL normally wants to pass through to
    U-Boot, such as the SDRAM size and bank information.

    Mkae use of the new bloblist structure for this. Add a new 'handoff' blob
    which is set up in SPL and passed to U-Boot proper. Also adda test for
    sandbox_spl that checks that this works correctly and a new 'sb' command
    to show the information passed from SPL.

    Reviewed-by: Tom Rini
    Signed-off-by: Simon Glass

    Simon Glass
     
  • We should use a macro rather than hard-coding the SPL prompt to 'spl'
    since the code can be used by TPL too. Add a macro that works for both
    and use it in various places.

    This allows TPL to use the same code without printing confusing messages.

    Note that the string is lower case ('spl', 'tpl') which is a change from
    previously.

    Reviewed-by: Tom Rini
    Signed-off-by: Simon Glass

    Simon Glass
     
  • The bloblist is normally set up in SPL ready for use by U-Boot. Add
    a simple implementation of this to the common SPL code.

    Signed-off-by: Simon Glass

    Simon Glass
     

05 Oct, 2018

1 commit

  • OP-TEE is an open source trusted OS, in armv7, its loading and
    running are like this:
    loading:
    - SPL load both OP-TEE and U-Boot
    running:
    - SPL run into OP-TEE in secure mode;
    - OP-TEE run into U-Boot in non-secure mode;

    To make code simple, it would be fine to use IH_OS_TEE for the
    os tyle in TPL(just like IH_OS_LINUX is using both in SPL and U-Boot).

    Here is the diagram for SPL loading OP-TEE,
    IH_OS_TEE:(make u-boot.itb for SPL)
    Non-Secure Secure

    BootROM
    |
    v
    SPL
    |
    v
    --------- OP-TEE
    |
    v
    U-Boot
    |
    V
    Linux
    For other two king of OP-TEE loading/booting, see commit message:
    45b55712d4 image: Add IH_OS_TEE for TEE chain-load boot

    More detail:
    https://github.com/OP-TEE/optee_os
    and search for 'boot arguments' for detail entry parameter in:
    core/arch/arm/kernel/generic_entry_a32.S

    Signed-off-by: Kever Yang
    Cc: Bryan O'Donoghue
    Reviewed-by: Philipp Tomsich

    Kever Yang
     

26 Sep, 2018

1 commit

  • The SPL loaders assume that the CONFIG_SYS_TEXT_BASE memory location
    is available and can be corrupted by loading ie. uImage or fitImage
    headers there. Sometimes it could be beneficial to load the headers
    elsewhere, ie. if CONFIG_SYS_TEXT_BASE is not yet writable while we
    still want to parse the image headers in some local onchip memory to
    ie. extract firmware from that image.

    Add the possibility to override the location where the headers get
    loaded by introducing new function, spl_get_load_buffer() which takes
    two arguments -- offset from the CONFIG_SYS_TEXT_BASE and size of the
    data that are to be loaded there -- and returns a valid buffer address
    or hangs the system. The default behavior is the same as before, add
    the offset to CONFIG_SYS_TEXT_BASE and return that address. User can
    override the weak spl_get_load_buffer() function though.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Reviewed-by: Simon Goldschmidt

    Marek Vasut
     

02 Aug, 2018

2 commits

  • At present each entry has an offset within its parent section. This is
    useful for figuring out how entries relate to one another. However it
    is sometimes necessary to locate an entry within an image, regardless
    of which sections it is nested inside.

    Add a new 'image-pos' property to provide this information. Also add
    some documentation for the -u option binman provides, which updates the
    device tree with final entry information.

    Since the image position is a better symbol to use for the position of
    U-Boot as obtained by SPL, update the SPL symbols to use this instead of
    offset, which might be incorrect if hierarchical sections are used.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • After some thought, I believe there is an unfortunate naming flaw in
    binman. Entries have a position and size, but now that we support
    hierarchical sections it is unclear whether a position should be an
    absolute position within the image, or a relative position within its
    parent section.

    At present 'position' actually means the relative position. This indicates
    a need for an 'image position' for code that wants to find the location of
    an entry without having to do calculations back through parents to
    discover this image position.

    A better name for the current 'position' or 'pos' is 'offset'. It is not
    always an absolute position, but it is always an offset from its parent
    offset.

    It is unfortunate to rename this concept now, 18 months after binman was
    introduced. However I believe it is the right thing to do. The impact is
    mostly limited to binman itself and a few changes to in-tree users to
    binman:

    tegra
    sunxi
    x86

    The change makes old binman definitions (e.g. downstream or out-of-tree)
    incompatible if they use the 'pos = ' property. Later work will
    adjust binman to generate an error when it is used.

    Signed-off-by: Simon Glass

    Simon Glass
     

21 Jul, 2018

1 commit

  • On some boards, we want to give the board/architecture-specific code a
    chance to look at where the next image has been loaded from and
    perform fixups before starting the next image. This is of particular
    importance, when we probe multiple devices for bootable payloads and
    boot the first one found.

    This change adds the following:
    - we record the boot_device used into the spl_image structure
    - we provide an extension-point for boards/architectures that can
    perform late fixups depending on a fully populated spl_image
    structure (i.e. we'll know the final boot_device and have info
    on the image type and operating system to be booted).

    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

07 Apr, 2018

1 commit

  • The spl_boot_partition function has been added in order to have
    the possibility to boot on a same binary from different mmc devices
    with different partitions.

    By default keep the current behavior, SPL use the partition defined
    by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.

    Signed-off-by: Patrick Delaunay
    Signed-off-by: Christophe KERELLO
    Reviewed-by: Tom Rini
    Reviewed-by: Lukasz Majewski

    Patrick Delaunay
     

13 Dec, 2017

1 commit


26 Nov, 2017

2 commits


09 Oct, 2017

1 commit

  • Commit 15eb1d43bf47 ("spl: reorder the assignment of board info to
    global data") intended to move assignment of board info earlier,
    into board_init_r(). However, function preload_console_init() is
    called either from spl_board_init() or from board_init_f(). For the
    latter case, the board info assignment is much earlier than proposed
    board_init_r(). Create a new function to fill gd->bd and call this
    function when needed.

    Signed-off-by: York Sun
    CC: Lokesh Vutla
    CC: Ravi Babu
    CC: Lukasz Majewski
    CC: Tom Rini
    Reviewed-by: Simon Glass

    York Sun
     

13 Aug, 2017

1 commit

  • Some devices (e.g. the RK3368) have only limited SRAM, but provide
    support for loading the next boot stage after our SPL performs basic
    setup (e.g. DRAM).

    For target systems like these, we add a boot device BOOTROM that will
    invoke a board-specific hook to return to the bootrom (if supported).

    Signed-off-by: Philipp Tomsich

    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass

    Philipp Tomsich
     

15 May, 2017

1 commit

  • ATF(ARM Trusted Firmware) is used by ARM arch64 SoCs, find more infomation
    about ATF at: https://github.com/ARM-software/arm-trusted-firmware

    SPL is considered as BL2 in ATF terminology, it needs to load other parts
    of ATF binary like BL31, BL32, SCP-BL30, and BL33(U-Boot). And needs to
    prepare the parameter for BL31 which including entry and image information
    for all other images. Then the SPL handle PC to BL31 with the parameter,
    the BL31 will do the rest of work and at last get into U-Boot(BL33).

    This patch needs work with patches from Andre for SPL support multi
    binary in FIT.

    The entry point of bl31 and bl33 are still using hard code because we
    still can not get them from the FIT image information.

    Signed-off-by: Kever Yang
    Tested-by: Heiko Stuebner
    Acked-by: Simon Glass
    Reviewed-by: Tom Rini

    Kever Yang
     

08 May, 2017

1 commit

  • At present fdt blob or argument address being passed to kernel is fixed at
    compile time using macro CONFIG_SYS_SPL_ARGS_ADDR. FDT blob from
    different media like nand, nor flash are copied to the address pointed
    by the macro.
    The problem is, it makes args/fdt blob compulsory to copy which is not required
    in cases like for NOR Flash. This patch removes this limitation.

    Signed-off-by: Vikas Manocha

    Vikas Manocha
     

19 Mar, 2017

1 commit

  • CONFIG_SPL_ABORT_ON_RAW_IMAGE causes SPL to abort and move on when it
    encounters RAW images, express this same functionality as a positive
    option enabling support for RAW images: CONFIG_SPL_RAW_IMAGE_SUPPORT

    Also move uses of this to defconfigs.

    Signed-off-by: Andrew F. Davis
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass
    [trini: Rework Kconfig logic a little, move to common/spl/Kconfig]
    Signed-off-by: Tom Rini

    Andrew F. Davis
     

17 Mar, 2017

1 commit

  • At present malloc_base/_limit/_ptr are not initialised in spl_init() when
    we call spl_init() in board_init_f(). This is due to a recent change aimed
    at avoiding overwriting the malloc area set up on some boards by
    spl_relocate_stack_gd().

    However if CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN is not defined, we now
    skip setting up the memory area in spl_init() which is obviously wrong.

    To fix this, add a new function spl_early_init() which can be called in
    board_init_f().

    Fixes: b3d2861e (spl: Remove overwrite of relocated malloc limit)
    Signed-off-by: Eddie Cai
    Rewrote spl_{,early_}init() to avoid duplicate code:
    Rewrite/expand commit message:
    Signed-off-by: Simon Glass
    Reviewed-by: Eddie Cai

    Eddie Cai
     

04 Jan, 2017

1 commit

  • Since entry_point and load_addr are addresses, they should be
    represented as longs to cover the whole address space and to avoid
    warning when compiling the SPL in 64-bit.
    Also adjust debug prints to add the 'l' specifier, where needed.

    Signed-off-by: Andre Przywara
    Reviewed-by: Alexander Graf
    Reviewed-by: Simon Glass
    Reviewed-by: Tom Rini
    Acked-by: Maxime Ripard
    Reviewed-by: Jagan Teki

    Andre Przywara
     

09 Dec, 2016

2 commits


01 Dec, 2016

1 commit


07 Oct, 2016

11 commits