24 Oct, 2019

3 commits


19 Oct, 2019

1 commit

  • Loading U-Boot on i.MX8QXP MEK board is broken since recent changes
    in spl_mmc:

    U-Boot SPL 2019.10-00162-gff5bd397e4 (Oct 18 2019 - 15:50:45 +0200)
    Normal Boot
    WDT: Not found!
    Trying to boot from MMC2_2
    Load image from MMC/SD 0x46400
    spl: mmc partition switch failed
    SPL: failed to boot from all boot devices
    ### ERROR ### Please RESET the board ###

    The newly added CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION option
    is selected automatically and overrides the EXT_CSC_PART_CONFIG
    configurations with default value, always selecting the eMMC boot
    partition 1. Boards which place U-Boot image in other partitions
    became not bootable.

    Fix this by making the eMMC HW boot partition selection optional.

    Fixes: 17241ea0543a (spl: mmc: Add option to set eMMC HW boot partition)
    Reviewed-by: Lukasz Majewski
    Signed-off-by: Anatolij Gustschin

    Anatolij Gustschin
     

15 Oct, 2019

1 commit

  • In new versions of Android Boot Image next fields are added to the
    header (and corresponding payloads are added to the image itself):
    - v1: Recovery DTBO
    - v2: DTB

    Account for these new fields in next functions:
    1. android_image_get_end(): as v1 and v2 have new payloads in the
    image, the calculation of image end address should be extended
    correspondingly; this is used e.g. by "bootm" command when booting
    the kernel from Android Boot Image
    2. android_print_contents(): new fields values in v1 and v2 should be
    printed; the result of this function can be seen e.g. in "iminfo"
    command

    This commit doesn't add the means for working with new payloads in v1
    and v2 images (it will be done in further commits), it only updates
    existing functions w.r.t. changes in boot image v1/v2.

    Signed-off-by: Sam Protsenko

    Sam Protsenko
     

14 Oct, 2019

1 commit


12 Oct, 2019

5 commits


11 Oct, 2019

4 commits

  • This commit add a generic function board_init_f that
    only initialize some device (for example serial). It
    avoid to define a board function only to launch the
    serial configuration.

    Signed-off-by: Philippe Reynes

    Philippe Reynes
     
  • Expose SPL's Y-Modem core loader function via the common SPL header
    file so it can be re-used for purposes other than loading U-Boot itself.

    Signed-off-by: Andreas Dannenberg

    Andreas Dannenberg
     
  • During FIT reading through ymodem_read_fit() the function
    xyzModem_stream_read() is being used which returns zero once the end
    of a stream has been reached. This could lead to an premature exit from
    ymodem_read_fit() with certain-sized FIT images reporting that zero
    bytes overall were read. Such a premature exit would then result in an
    -EIO failure being triggered within the spl_load_simple_fit() caller
    function and ultimately lead to a boot failure.

    Fix this logic by simply aborting the stream read loops and continuing
    with the regular code flow which ultimately would lead to returning
    the number of bytes to be read ('size') as expected by the callers of
    ymodem_read_fit().

    Fixes: fa715193c083 ("spl: Add an option to load a FIT containing U-Boot from UART")
    Signed-off-by: Andreas Dannenberg

    Andreas Dannenberg
     
  • The write functions do actually change the contents of memory so it is not
    correct to use 'const'. Remove it.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     

10 Oct, 2019

2 commits

  • In SPL, all the available mmc devices gets initialized during boot.
    This might not work in cases where clocks are not available for
    certain mmc devices(other than boot device) and the support for
    enabling device might not be ready.

    Texas Instruments' K3 J721E device having a central system controller
    (dmsc) is one such example falling in this category. Below is the
    sequence for the failing scenario:
    - ROM comes up in SD mode and loads SPL by just initialing SD card.
    - SPL loads dmsc firmware from SD Card.
    Since ROM has enabled SD, SPL need not enable the SD, just need
    to re initialize the card. But SPL is trying to initialize other MMC
    instances which are in disabled state. Since dmsc firmware is not yet
    available, devices cannot be enabled. So in SPL, initialize only the
    mmc device that is needed.

    Signed-off-by: Lokesh Vutla
    Reviewed-by: Peng Fan

    Lokesh Vutla
     
  • Xilinx/FPGA changes for v2020.01

    FPGA:
    - Enable fpga loading on Versal
    - Minor fix

    Microblaze:
    - Fix LMB configurations to support initrds
    - Some other cleanups

    Zynq:
    - Minor config/dt changes
    - Add distro boot support for usb1 and mmc1
    - Remove Xilinx private boot commands and use only distro boot

    ZynqMP:
    - Kconfig cleanups, defconfig updates
    - Update some dt files
    - Add firmware driver for talking to PMUFW
    - Extend distro boot support for jtag
    - Add new IDs
    - Add system controller configurations
    - Convert code to talk firmware via mailbox or SMCs

    Versal:
    - Add board_late_init()
    - Add run time DT memory setup
    - Add DFU support
    - Extend distro boot support for jtag and dfu
    - Add clock driver
    - Tune mini configurations

    Xilinx:
    - Improve documentation (boot scripts, dt binding)
    - Enable run time initrd_high calculation
    - Define default SYS_PROMPT
    - Add zynq/zynqmp virtual defconfig

    Drivers:
    - Add Xilinx mailbox driver for talking to firmware
    - Clean zynq_gem for Versal
    - Move ZYNQ_HISPD_BROKEN to Kconfig
    - Wire genphy_init() in phy.c
    - Add Xilinx gii2rgmii bridge
    - Cleanup zynq_sdhci
    - dwc3 fix
    - zynq_gpio fix
    - axi_emac fix

    Others:
    - apalis-tk1 - clean config file

    Tom Rini
     

09 Oct, 2019

1 commit


08 Oct, 2019

22 commits

  • CONFIG_SECURE_BOOT is too generic and forbids to use it for cross
    architecture purposes. If Secure Boot is required for imx, this means to
    enable and use the HAB processor in the soc.

    Signed-off-by: Stefano Babic

    Stefano Babic
     
  • i.MX8 only support AHAB secure boot with Container format image,
    we could not use FIT to support secure boot, so introduce container
    support to let SPL could load container images.

    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: York Sun
    Cc: Marek Vasut
    Cc: Alex Kiernan
    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Kever Yang
    Cc: Heiko Schocher
    Signed-off-by: Peng Fan

    Peng Fan
     
  • i.MX8 only support AHAB secure boot with Container format image,
    we could not use FIT to support secure boot, so introduce container
    support to let SPL could load container images.

    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: York Sun
    Cc: Marek Vasut
    Cc: Alex Kiernan
    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Kever Yang
    Cc: Heiko Schocher
    Signed-off-by: Peng Fan

    Peng Fan
     
  • i.MX8 only support AHAB secure boot with Container format image,
    we could not use FIT to support secure boot, so introduce container
    support to let SPL could load container images.

    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: York Sun
    Cc: Marek Vasut
    Cc: Alex Kiernan
    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Kever Yang
    Cc: Heiko Schocher
    Signed-off-by: Peng Fan

    Peng Fan
     
  • Introduce weak spl_nand_get_uboot_raw_page, then platform could
    have their own implementation.

    Signed-off-by: Peng Fan
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: Marek Vasut
    Cc: Andreas Dannenberg
    Cc: Alex Kiernan
    Cc: Stefan Roese
    Cc: Patrick Delaunay
    Cc: Miquel Raynal
    Cc: Michal Simek

    Peng Fan
     
  • Introduce weak spl_nor_get_uboot_base, then platform have their own
    implementation.

    Signed-off-by: Peng Fan
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: Marek Vasut
    Cc: Andreas Dannenberg
    Cc: Alex Kiernan
    Cc: Stefan Roese
    Cc: Patrick Delaunay
    Cc: Miquel Raynal
    Cc: Michal Simek

    Peng Fan
     
  • Introduce a weak function spl_spi_get_uboot_offs, then
    platform could have their own implementation.

    Signed-off-by: Peng Fan
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: Marek Vasut
    Cc: Andreas Dannenberg
    Cc: Alex Kiernan
    Cc: Stefan Roese
    Cc: Patrick Delaunay
    Cc: Miquel Raynal
    Cc: Michal Simek

    Peng Fan
     
  • Introduce a weak function spl_mmc_get_uboot_raw_sector, then platform
    could have their own implementation.

    Signed-off-by: Peng Fan
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: Marek Vasut
    Cc: Andreas Dannenberg
    Cc: Alex Kiernan
    Cc: Stefan Roese
    Cc: Patrick Delaunay
    Cc: Miquel Raynal
    Cc: Michal Simek

    Peng Fan
     
  • The default CSF_SIZE defined in Kconfig is too high and SPL cannot
    fit into the OCRAM in certain cases.

    The CSF cannot achieve 0x2000 length when using RSA 4K key which is
    the largest key size supported by HABv4.

    According to AN12056 "Encrypted Boot on HABv4 and CAAM Enabled Devices"
    it's recommended to pad CSF binary to 0x2000 and append DEK blob to
    deploy encrypted boot images.

    As the maximum DEK blob size is 0x58 we can reduce CSF_SIZE to 0x2060
    which should cover both CSF and DEK blob length.

    Update default_image.c and image.c to align with this change and avoid
    a U-Boot proper authentication failure in HAB closed devices:

    Authenticate image from DDR location 0x877fffc0...
    bad magic magic=0x32 length=0x6131 version=0x38
    bad length magic=0x32 length=0x6131 version=0x38
    bad version magic=0x32 length=0x6131 version=0x38
    spl: ERROR: image authentication fail

    Fixes: 96d27fb218 (Revert "habv4: tools: Avoid hardcoded CSF size for SPL targets")

    Reported-by: Jagan Teki
    Signed-off-by: Breno Lima

    Breno Matheus Lima
     
  • This change tries to fix the following problem:

    - The board boots (to be more precise - ROM loads SPL) from a slow SPI-NOR
    memory.
    As a result the spl_boot_device() will return SPI-NOR as a boot device
    (which is correct).

    - The problem is that in 'falcon boot' the eMMC is used as a boot medium to
    load kernel from its partition.
    Calling spl_boot_device() will break things as it returns SPI-NOR device.

    To fix this issue the new CONFIG_SPL_FORCE_MMC_BOOT Kconfig flag is
    introduced to handle this special use case. By default it is not defined,
    so there is no change in the legacy code flow.

    Signed-off-by: Lukasz Majewski

    Lukasz Majewski
     
  • This reverts commit 62a52f3f85bf33e286632e99f0d39b2c166af0c4.

    Stefano Babic
     
  • Currently it's not possible to authenticate the U-Boot proper of
    mx6ul_14x14_evk_defconfig target:

    Authenticate image from DDR location 0x877fffc0...
    bad magic magic=0x0 length=0x00 version=0x3
    bad length magic=0x0 length=0x00 version=0x3
    bad version magic=0x0 length=0x00 version=0x3
    spl: ERROR: image authentication fail

    Commit 0633e134784a ("imx: hab: Increase CSF_SIZE for i.MX6 and
    i.MX7 devices") has increased CSF_SIZE to avoid a possible issue
    when booting encrypted boot images.

    Commit d21bd69b6e95 ("tools: mkimage: add firmware-ivt image type
    for HAB verification") is hardcoding the CSF and IVT sizes, the
    new CSF size is not being considered and u-boot-ivt.img fails to
    boot.

    Avoid hardcoded CSF and IVT size to fix this issue.

    Signed-off-by: Breno Lima
    Reviewed-by: Fabio Estevam

    Breno Matheus Lima
     
  • i.MX8 only support AHAB secure boot with Container format image,
    we could not use FIT to support secure boot, so introduce container
    support to let SPL could load container images.

    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Cc: York Sun
    Cc: Marek Vasut
    Cc: Alex Kiernan
    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Kever Yang
    Cc: Heiko Schocher
    Signed-off-by: Peng Fan

    Peng Fan
     
  • Previously the SPL size on all iMX6 platforms was restricted to 68KB
    because the OCRAM size on iMX6SL/DL parts is only 128KB. However, the
    other iMX6 variants have 256KB of OCRAM. Add an option
    CONFIG_MX6_OCRAM_256KB which allows using the full size on boards which
    don't need to support the SL/DL variants. This allows for an SPL size of
    196KB, which makes it much easier to use configurations such as SPL with
    driver model and FDT control.

    Signed-off-by: Robert Hancock
    Tested-by: Adam Ford #imx6q_logic

    Robert Hancock
     
  • Pass spl_image and bootdev to board_return_bootrom.
    i.MX8MN needs the args to let ROM to load images

    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Kever Yang
    Signed-off-by: Peng Fan
    Reviewed-by: Kever Yang

    Peng Fan
     
  • Microblaze as Arm is using multiple memory banks which are read from DT
    that's why there is a need to initialized LMB based on bd->bi_dram[].
    Without this fix memory base/size is all the time 0 and image relocation is
    not possible.

    Signed-off-by: Michal Simek

    Michal Simek
     
  • Define default address via Kconfig. There is no need to change this address
    for most of the boards but it is also possible. This one line save a lot of
    lines in defconfigs that's why make sense to do it.

    The similar change has been done by commit 9340d8fe8beb
    ("sunxi: move CONFIG_SPL_TEXT_BASE from *_defconfig to Kconfig")

    Signed-off-by: Michal Simek
    Reviewed-by: Luca Ceresoli

    Michal Simek
     
  • This is currently a decimal value which is not as convenient or
    meaningful. Also U-Boot tends to use hex everywhere.

    Convert this option to hex and add a comment for the size_check macro.

    Signed-off-by: Simon Glass
    Reviewed-by: Simon Goldschmidt
    Acked-by: Bin Meng
    [bmeng: correct the typo in the commit title]
    Signed-off-by: Bin Meng

    Simon Glass
     
  • At present there is only one control for this and it is used for both SPL
    and TPL. But SPL might have a lot more space than TPL so the extra cost of
    a full printf() might be acceptable.

    Split the option into two, providing separate SPL and TPL controls. The
    TPL setting defaults to the same as SPL.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • At present the bloblist is set up in spl_common_init() which can be called
    from spl_early_init(), i.e. before SDRAM is ready. This prevents the
    bloblist from being located in SDRAM, which is useful on some platforms
    where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region).

    It doesn't serve much purpose to have the bloblist available early, since
    very little is known about the platform then, and the handoff info is
    written when SPL is about to jump to U-Boot.

    Move the code to board_init_r() to avoid any restrictions.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • At present there is an arch-specific area in the SPL handoff area intended
    for use by arch-specific code, but there is no explicit call to fill in
    this data. Add a hook for this.

    Also use the hook to remove the sandbox-specific test code from
    write_spl_handoff().

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • At present these options can be enabled when bloblist is not enabled for
    SPL or TPL. This is incorrect as SPL handoff requires bloblist. Fix it.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass