16 Jul, 2020

2 commits

  • This commit eliminate the annoying build warning logs.

    Test: builds with buildman.

    Signed-off-by: Ji Luo
    Change-Id: Ia335dafe3f4c0eab08e011215b9de5d2974b8d0c
    (cherry picked from commit 85e0d429d19b8f9a62369a5f20e088644c488b1e)

    Ji Luo
     
  • Add a weak function after the image load in case we have extra
    steps to complete, like check the rpmb keyblob for trusty enabled
    platform.

    Test: Boots with trusty.

    Signed-off-by: Ji Luo
    Change-Id: Ie8181fcb32d1640e39fdcc3cebb2dbf50cbfdbab
    (cherry picked from commit b16fc52cf9a9ea4d63bced50b949d0bc2328ddea)

    Ji Luo
     

16 Jun, 2020

3 commits

  • Dual bootloader is also enabled on imx8m, return 'part' as
    0 in the default spl_mmc_emmc_boot_partition() implementation.

    Test: boots dual bootloader on imx8mm_evk.

    Signed-off-by: Ji Luo
    Change-Id: Id7753f72b5eedc0a5e8011c8950aaced3fece9a9
    (cherry picked from commit 5648323ae3680cd9990c9243162aa2941a1e8d66)

    Ji Luo
     
  • Move the default eMMC boot partition index used for SPL load to a weak
    function. So we can override it in iMX8 specified codes.
    Because on iMX8 when the emmc regular boot is from boot part0/1, ROM
    will switch to the other boot part for secondary boot. So we can't
    directly use the boot part index in PARTITION_CONFIG register. But have
    to check the secondary boot for using the other part.

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

    Ye Li
     
  • This commit enables dual bootloader feature for imx8m/imx8q, but
    as commit 'a2018ab' already brings in some dual bootloader codes
    when enabling fastboot support, so this commit won't be a complete
    and standalone patch to introduce the dual bootloader feature.

    This commit will do the following:
    1. clean up dual bootloader flow and add missing implementation.
    2. Merge the dual bootloader entry for fit and container to one
    function 'mmc_load_image_raw_sector_dual_uboot'.

    Change-Id: Ic9410a48092cc05de599dd897fc912177e2a1fe1
    Signed-off-by: Ji Luo

    Ji Luo
     

06 May, 2020

9 commits

  • On imx8 platform, the usb2 and usb3 ports are both supported. Which
    means we can use usb2(ci_udc_otg) and usb3(cdns3_generic_peripheral)
    gadget driver to run sdp/fastboot/ums at the same time.

    For sdp and the fastboot that runs automatically when uboot starts,
    board_usb_gadget_port_auto() is added to autodetect usb port, this
    means that we don't have to specify which USB port should be used to
    download in code, now we can just connect either usb port then it
    will download automatically.

    Signed-off-by: Sherry Sun
    (cherry picked from commit 2b6fd3da6fffae0732e8e91ef5c1f870ea393ca9)

    Sherry Sun
     
  • 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)
    (cherry picked from commit 3e50573a7007771586e737b343bdde4d98c21c23)

    Ye Li
     
  • When enable CONFG_SPL_DM_USB_GADGET, sdp should use
    usb_gadget_initialize() and usb_gadget_release() to
    support DM gadget driver.

    Signed-off-by: Sherry Sun
    (cherry picked from commit 22b59b69af0bfc0a2aeff9a995252d58c77c3955)

    Sherry Sun
     
  • The SPL loads the FIT image FDT part to an address related with the device
    block length. This length is 512 for SD/MMC and is 1 for other devices
    like SDP, NOR, NAND, SPI, etc.
    When signing FIT image, we use fixed address caculated by SD/MMC block length
    to sign FDT part. Thus, when booting through uuu, this causes mismatch and
    gets authentication failed.

    Fix the issue by providing a override function for this FIT buffer address.
    When secure boot is enabled, adjust the addresses of other devices to be same
    with SD/MMC.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 710efd3ccb99e144bd30af8e1ee46459b4a54dd6)
    (cherry picked from commit f48835f0b6b801cb267b4c27a50136c93dfd3bcf)

    Ye Li
     
  • Use trusty_os_init to load Trusty OS from CONFIG_TRUSTY_OS_ENTRY
    before u-boot ready.

    Add Trusty OS SOC level codes and u-boot/SPL common codes.

    Signed-off-by: Ye Li
    Signed-off-by: Haoran.Wang
    (cherry picked from commit 1ae9ecc73f5001b8bd743011c06a7d07861be64e)
    (cherry picked from commit 6fa4f4a42fd90631f8dc8303b17f600c085d8595)

    Ye Li
     
  • Because SDP directly jumps to next level boot image, we'd better
    clean up the USB driver before it. Implement a weak callback function,
    that spl sdp can use it to clean up USB driver.

    Signed-off-by: Ye Li
    (cherry picked from commit 1f6b3efc62cb277fd4316d8ed5115f47b09369a0)
    (cherry picked from commit a3ed6467a4efb7acaa15281ec2c37e7f051b00db)

    Ye Li
     
  • Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the
    usb index for spl sdp driver, so that we change use different device.
    The default value is 0.

    Signed-off-by: Ye Li
    (cherry picked from commit dba0d7c7dc3b9b60043726931b1f635b725e9756)
    (cherry picked from commit c2da455b3d690d1d0bafece240360a288dad661a)

    Ye Li
     
  • Need initialize UDC before run sdp download

    Signed-off-by: Frank Li
    (cherry picked from commit ab6696c4f7ff3f13153e27b696fcbf38188b009a)
    (cherry picked from commit 9f0962216f852a7f5ade66bbf66f57a36654a5bd)

    Frank Li
     
  • The RAW image support must be disabled, otherwise a RAW image can be used
    to bypass FIT image.

    Signed-off-by: Ye Li
    (cherry picked from commit ca7ebfcf0737699d5f62f97be4b0015c88108ae7)
    (cherry picked from commit 9e9524c86a08d5b16bb94c1a30eda378536c4860)

    Ye Li
     

03 Apr, 2020

1 commit


09 Mar, 2020

1 commit


27 Jan, 2020

1 commit


25 Jan, 2020

3 commits

  • For Allwinner SoCs the CONFIG_SYS_SPI_U_BOOT_OFFS value is not really a
    board choice: The boot ROM only loads the SPL from offset 0 of the SPI
    NOR flash, and loads at most 32KB. This is a similar situation as on MMC,
    so consequently we create our "joint" image (SPL + U-Boot proper) with
    that 32KB offset during the build.

    So define the value of this symbol to be 32KB by default for every
    Allwinner SoC. This removes the definition of this symbol from the
    _defconfig files, and avoids every board to define this over and over
    again.

    Signed-off-by: Andre Przywara
    Reviewed-by: Jagan Teki

    Andre Przywara
     
  • At present panic() is in the vsprintf.h header file. That does not seem
    like an obvious choice for hang(), even though it relates to panic(). So
    let's put hang() in its own header.

    Signed-off-by: Simon Glass
    [trini: Migrate a few more files]
    Signed-off-by: Tom Rini

    Simon Glass
     
  • These global variables are quite short and generic. In fact the same name
    is more often used locally for struct members and function arguments.

    Add a image_ prefix to make them easier to distinguish.

    Signed-off-by: Simon Glass

    Simon Glass
     

23 Jan, 2020

1 commit

  • Allow reading compressed content from fit image, even if
    CONFIG_SPL_OS_BOOT is not set.

    This allow booting compressed 2nd stage u-boot from fit image.

    Additionally, do not print warning message if compression node is not
    found, since it simply implies the content is uncompressed.

    Signed-off-by: Klaus H. Sorensen
    Signed-off-by: Rasmus Villemoes

    Klaus H. Sorensen
     

18 Jan, 2020

2 commits


17 Jan, 2020

1 commit


16 Jan, 2020

3 commits

  • Xilinx/FPGA changes for v2020.04

    ARM64:
    - Add INIT_SPL_RELATIVE dependency

    SPL:
    - FIT image fix
    - Enable customization of bl2_plat_get_bl31_params()

    Pytest:
    - Add test for octal/hex conversions

    Microblaze:
    - Fix manual relocation for one SPI instance

    Nand:
    - Convert zynq/zynqmp drivers to DM

    Xilinx:
    - Enable boot script location via Kconfig
    - Support OF_SEPARATE in board FDT selection
    - Remove low level uart setup it is done later by code
    - Add support for DEVICE_TREE variable passing for SPL

    Zynq:
    - Enable jtag boot mode via distro boot
    - Removing unused baseaddresses from hardware.h
    - DT fixups

    ZynqMP:
    - Fix emmc boot sequence
    - Simplify spl logic around bss and board_init_r()
    - Support psu_post_config_data() calling
    - Tune mini-nand DTS
    - Fix psu wiring for a2197 boards
    - Add runtime MMC device boot order filling in spl
    - Clear ATF handoff handling with custom bl2_plat_get_bl31_params()
    - Add support u-boot.its generation
    - Use single image configuration for all platforms
    - Enable PANIC_HANG via Kconfig
    - DT fixups
    - Firmware fixes
    - Add support for zcu208 and zcu1285

    Versal:
    - Fix emmc boot sequence
    - Enable board_late_init() by default

    Tom Rini
     
  • On Armada 38x platforms the ROM code loads SPL from offset 0 of eMMC
    hardware boot partitions. When there are no boot partitions (i.e. SD
    card) the ROM skips the first sector that usually contains the (logical)
    partition table. Since the generated .kwb image contains the main U-Boot
    image in a fixed location (0x140 sectors by default), we end up with the
    main U-Boot image in offset of 1 sector. The current workaround is to
    manually set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x141 to
    compensate for that.

    This patch uses the run-time detected boot partition to determine the
    right offset of the main U-Boot partition. The generated .kwb image is
    now compatible with both eMMC boot partition, and SD card main data
    partition.

    Signed-off-by: Baruch Siach
    Reviewed-by: Stefan Roese
    Signed-off-by: Stefan Roese

    Baruch Siach
     
  • Rename CONFIG_SPL_DMA_SUPPORT to CONFIG_SPL_DMA. This allows to use
    macros such as CONFIG_IS_ENABLED() that allow conditional compilation of
    code for SPL and U-Boot.

    Signed-off-by: Vignesh Raghavendra
    Reviewed-by: Simon Glass

    Vignesh Raghavendra
     

15 Jan, 2020

1 commit

  • At the moment entry_point is set to image_get_load(header) that sets it
    to "load address" instead of "entry point", assuming entry_point is
    equal to load_addr, but it's not true. Then load_addr is set to
    "entry_point - header_size", but this is wrong too since load_addr is
    not an entry point.

    So use image_get_ep() for entry_point assignment and image_get_load()
    for load_addr assignment.

    Signed-off-by: Giulio Benetti

    Giulio Benetti
     

14 Jan, 2020

2 commits


09 Jan, 2020

1 commit


08 Jan, 2020

8 commits

  • spl_fit_get_image_name() is used to get the names of the images that the
    SPL must load from the FIT. It relies on the content of a property present
    in the FIT. The list of images is thus statically defined in the FIT.
    With this scheme, it quickly becomes hard to manage combinations of more
    than a handful of images.
    To address this problem, give the board driver code the opportunity to
    add to the list of images. The images from the FIT property are loaded
    first, and then the board_get_fit_loadable() is called to get more image
    names.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     
  • There is no need for it to be non-constant. Making it constant, allows to
    return constant string without warning.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     
  • There are many ways the overlay application can fail.
    2 of them are probably the most common:
    - the application itself failed. Usually this is comes from an unresolved
    reference
    - DTBO not available in FIT (could be because of a typo)

    In both case it is good to be more explicit about the error and at least
    show which overlay is failing.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     
  • If one overlay that must be applied cannot be found in the FIT, the current
    implementation stops applying the overlays. Let's make it skip only the
    failing overlay instead.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     
  • If the node describing an overlay does not specify a load address, it will
    be loaded at the address previously used.
    Fixing it by allocating a temporary buffer that will be used as a
    default load address. By default, the size of the buffer is 64kB which
    should be plenty for most use cases.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     
  • Make room in the FDT before applying the overlay, otherwise it may fail if
    the overlay is big. As the exact added size is not known in advance, just
    add the size of the overlay.
    Move after the end of the application of the overlays, the resize of the
    FDT for the injection of the details on the loadables.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     
  • doc/uImage.FIT/overlay-fdt-boot.txt is describing how to create FIT
    image with DT overlays in it.
    Add support for this feature to SPL.

    Here is the ZynqMP fragment where dtb points to full DT and dtbo is
    overlay which should be applied on the top of dtb.
    config {
    description = "ATF with full u-boot overlay";
    firmware = "atf";
    loadables = "uboot";
    fdt = "dtb", "dtbo";
    };

    The whole feature depends on OF_LIBFDT_OVERLAY which is adding +4kB code
    and 0 for platforms which are not enabling this feature.

    Signed-off-by: Michal Simek
    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Michal Simek
     
  • When u-boot.img is a FIT image generated automatically by mkimage, the
    configuration node has the following structure:
    conf-1 {
    description = "k3-am654-base-board";
    firmware = "firmware-1";
    loadables = "firmware-1";
    fdt = "fdt-1";
    };

    The firmware is referenced twice. Once by the 'firmware' property and
    once by the 'loadables' property. Currently this result in the firmware
    being loaded twice. This is not a big problem but has an impact on the
    boot time.
    Fixing it by not loading a loadable image if it is also the firmware image.

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass
    Tested-by: Andreas Dannenberg

    Jean-Jacques Hiblot
     

07 Jan, 2020

1 commit