12 Apr, 2019

1 commit


10 Apr, 2019

2 commits


09 Apr, 2019

1 commit


23 Mar, 2019

2 commits

  • Currently, 'dtimg' allows users to check indexes equal to
    dt_entry_count [1]. Forbid that [2].

    [1] Behavior w/o the patch:

    => ext2load mmc 0:1 0x48000000 dtb.img
    105695 bytes read in 5 ms (20.2 MiB/s)

    => dtimg dump 0x48000000
    dt_table_header:
    magic = d7b7ab1e
    total_size = 105695
    header_size = 32
    dt_entry_size = 32
    dt_entry_count = 2
    dt_entries_offset = 32
    page_size = 4096
    version = 0
    dt_table_entry[0]:
    dt_size = 105599
    dt_offset = 96
    id = 0b779520
    rev = 00000000
    custom[0] = 00000000
    custom[1] = 00000000
    custom[2] = 00000000
    custom[3] = 00000000
    (FDT)size = 105599
    (FDT)compatible = shimafuji,kingfisher
    dt_table_entry[1]:
    dt_size = 105599
    dt_offset = 96
    id = 0b779530
    rev = 00000000
    custom[0] = 00000000
    custom[1] = 00000000
    custom[2] = 00000000
    custom[3] = 00000000
    (FDT)size = 105599
    (FDT)compatible = shimafuji,kingfisher

    => dtimg size 0x48000000 0 z; print z
    z=19c7f
    => dtimg size 0x48000000 1 z; print z
    z=19c7f
    => dtimg size 0x48000000 2 z; print z
    z=d00dfeed
    => dtimg size 0x48000000 3 z
    Error: index > dt_entry_count (3 > 2)

    [2] Behavior with the patch:

    => dtimg size 0x48000000 0 z; print z
    z=19c7f
    => dtimg size 0x48000000 1 z; print z
    z=19c7f
    => dtimg size 0x48000000 2 z
    Error: index >= dt_entry_count (2 >= 2)

    Fixes: c04473345712 ("common: Add support for Android DT image")
    Signed-off-by: Eugeniu Rosca

    Eugeniu Rosca
     
  • If FIT_IMAGE_TINY is enabled, spl_fit_image_get_os returns -ENOTSUPP.
    In this case, we should default to IH_OS_U_BOOT not to IH_OS_INVALID.

    Signed-off-by: Abel Vesa
    Tested-by: Fabio Estevam

    Abel Vesa
     

09 Mar, 2019

1 commit

  • Handle in boot_fdt_reserve_region
    any return value > 0 of lmb_reserve() function;
    it occurs when coalesced region are found:
    adjacent reserved region are merged.

    This patch avoid the error trace:
    ERROR: reserving fdt memory region failed..
    when reserved region are merged (return value = 1).

    Signed-off-by: Patrick Delaunay

    Patrick Delaunay
     

01 Mar, 2019

1 commit


23 Feb, 2019

1 commit


20 Feb, 2019

2 commits


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
     

16 Feb, 2019

1 commit

  • Since there is the SPL_USB_HOST_SUPPORT for enabling USB support in SPL,
    makes more sense to rename the SPL_USB_SUPPORT as SPL_USB_STORAGE.
    Everything that is not part of the usb storage support in SPL is now
    build under SPL_USB_HOST_SUPPORT.

    Signed-off-by: Abel Vesa
    Reviewed-by: Tom Rini
    Reviewed-by: Fabio Estevam
    Reviewed-by: Lukasz Majewski

    Abel Vesa
     

13 Feb, 2019

1 commit


10 Feb, 2019

2 commits


09 Feb, 2019

2 commits

  • The board_r init function was complaining that we are looping through
    an array, calling all our tiny init stubs sequentially via indirect
    function calls (which can't be speculated, so they are slow).

    The solution to that is pretty easy though. All we need to do is inline
    the function that loops through the functions and the compiler will
    automatically convert almost all indirect calls into direct inlined code.

    With this patch, the overall code size drops (by 40 bytes on riscv64)
    and boot time should become measurably faster for every target.

    Signed-off-by: Alexander Graf

    Alexander Graf
     
  • Some platforms choose to store device tree blob in Android image second
    area. Let's try to look for dtb from there when booting an Android
    image, and use it for booting if found.

    Signed-off-by: Shawn Guo

    Shawn Guo
     

07 Feb, 2019

3 commits

  • SPL only needs to be able to read from SPI Flash to load next stage and
    does not really need write/erase etc. Therefore in order to reduce SPI
    Flash code size in SPL, enable SPI_FLASH_TINY, that only supports
    reading from SPI flash, as default.

    Note: Since, SPI_FLASH_TINY does not support SPI_FLASH_BAR,
    SPI_FLASH_TINY is not enabled for boards with SPI controllers that
    cannot support 4 byte addressing.

    Signed-off-by: Vignesh R
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki #zynq-microzed

    Vignesh R
     
  • Add a tiny SPI flash stack that just supports reading data/images from
    SPI flash. This is useful for boards that have SPL size constraints and
    would need to use SPI flash framework just to read images/data from
    flash. There is approximately 1.5 to 2KB savings with this.

    Based on prior work of reducing spi flash id table by
    Simon Goldschmidt

    Signed-off-by: Vignesh R
    Tested-by: Simon Goldschmidt
    Tested-by: Stefan Roese
    Tested-by: Horatiu Vultur
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki #zynq-microzed

    Vignesh R
     
  • Sync Serial Flash Discoverable Parameters (SFDP) parsing support from
    Linux. This allows auto detection and configuration of Flash parameters.

    Signed-off-by: Vignesh R
    Tested-by: Simon Goldschmidt
    Tested-by: Stefan Roese
    Tested-by: Horatiu Vultur
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki #zynq-microzed

    Vignesh R
     

02 Feb, 2019

1 commit

  • This fixes the automatic lmb initialization and reservation for boards
    with more than one DRAM bank.

    This fixes the CVE-2018-18439 and -18440 fixes that only allowed to load
    files into the firs DRAM bank from fs and via tftp.

    Found-by: Heinrich Schuchardt
    Signed-off-by: Simon Goldschmidt
    Tested-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass

    Simon Goldschmidt
     

01 Feb, 2019

3 commits


27 Jan, 2019

1 commit

  • Make use of "IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather than
    CONFIG_SPL_MAX_SIZE and CONFIG_SPL_TEXT_BASE. This lets us re-use the
    same script for both SPL and TPL. Add logic to scripts/Makefile.spl to
    pass in the right value when preprocessing the script.

    Cc: Stefano Babic
    Cc: Fabio Estevam
    Cc: Jagan Teki
    Cc: Maxime Ripard
    Cc: Andreas Bießmann
    Cc: Philipp Tomsich
    Cc: Michal Simek
    Cc: Daniel Schwierzeck
    Cc: York Sun
    Cc: Bin Meng
    Cc: Heiko Schocher
    Cc: Adam Ford
    Signed-off-by: Tom Rini
    Reviewed-by: Daniel Schwierzeck
    Tested-by: Daniel Schwierzeck
    Tested-by: Adam Ford #da850evm & omap3_logic_somlv
    Reviewed-by: Simon Goldschmidt

    Tom Rini
     

26 Jan, 2019

2 commits

  • CLI support with the HUSH parser is not currently SPL safe due to it's
    use of realloc. That function is not defined for SPLs that use
    SYS_MALLOC_SIMPLE. CLI support can be built in to SPL and some functions
    do work, but use of some like run_command() will cause build to fail.
    When no SPL code calls this function build works as the compiler removes
    this unreachable code so the unresolved symbols are ignored.

    If DFU support is enabled in SPL then MMU DFU support may get brought in
    also, this code does make a call to run_command() causing build to fail
    if the HUSH parser is not built-in. To break this odd and unneeded
    dependency chain we use CONFIG_IS_ENABLED where appropriate to prevent
    calls into HUSH code from SPL. This also removes our need to pull in the
    rather unrelated source file when SPL_DFU is defined.

    Signed-off-by: Andrew F. Davis
    Reviewed-by: Tom Rini

    Andrew F. Davis
     
  • The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same
    meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT
    to allow for cleaner use in code.

    Signed-off-by: Andrew F. Davis
    Reviewed-by: Tom Rini
    Acked-by: Lukasz Majewski

    Andrew F. Davis
     

19 Jan, 2019

1 commit

  • The bounce buffer is used by a few drivers (most of the MMC drivers)
    to overcome limitations in their respective DMA implementation.

    This moves the configuration to Kconfig and makes it user-selectable
    (even though it will be a required feature to make those drivers
    work): the expected usage is for drivers depending on this to 'select'
    it unconditionally from their respective Kconfig (see follow-up
    patches).

    This commit includes a full migration using moveconfig.py to ensure
    that each commit compiles. To ensure bisectability we update
    dependencies of various drivers to now select BOUNCE_BUFFER when needed.

    [trini: Squash all patches to ensure bisectability]
    Signed-off-by: Tom Rini
    Signed-off-by: Philipp Tomsich
    Reviewed-by: Otavio Salvador [dw_mmc portion]
    Reviewed-by: Fabio Estevam [mxsmmc portion]
    Reviewed-by: Simon Glass [tegra portion]

    Philipp Tomsich
     

18 Jan, 2019

1 commit


17 Jan, 2019

2 commits


16 Jan, 2019

8 commits

  • Fix recent changes to serial API for driver model
    Buildman clang support and a few fixes
    Small fixes to 'dm tree' and regmap test
    Improve sandbox build compatibility
    A few other minor fixes

    Tom Rini
     
  • Add the dollar_complete() function to auto-complete arguments starting
    with a '$' and use it in the cmd_auto_complete() path such that all
    args starting with a $ can be auto-completed based on the available env
    vars.

    Signed-off-by: Boris Brezillon
    [trini: Fix some linking problems]
    Signed-off-by: Tom Rini

    Boris Brezillon
     
  • The repeatable property is currently attached to the main command and
    sub-commands have no way to change the repeatable value (the
    ->repeatable field in sub-command entries is ignored).

    Replace the ->repeatable field by an extended ->cmd() hook (called
    ->cmd_rep()) which takes a new int pointer to store the repeatable cap
    of the command being executed.

    With this trick, we can let sub-commands decide whether they are
    repeatable or not.

    We also patch mmc and dtimg who are testing the ->repeatable field
    directly (they now use cmd_is_repeatable() instead), and fix the help
    entry manually since it doesn't use the U_BOOT_CMD() macro.

    Signed-off-by: Boris Brezillon
    Reviewed-by: Tom Rini

    Boris Brezillon
     
  • Some commands have a table of sub-commands. With minor adjustments,
    complete_cmdv() is able to provide auto-completion for sub-commands
    (it's just about passing the table of commands instead of taking the
    global one).
    We rename this function into complete_subcmd() and implement
    complete_cmdv() as a wrapper around complete_subcmdv().

    Signed-off-by: Boris Brezillon
    Reviewed-by: Tom Rini

    Boris Brezillon
     
  • When auto-completing command arguments, the last argument is not
    necessarily the one we need to auto-complete. When the last character is
    a space, a tab or '\0' what we want instead is list all possible values,
    or if there's only one possible value, place this value on the command
    line instead of trying to suffix the last valid argument with missing
    chars.

    Signed-off-by: Boris Brezillon
    Reviewed-by: Tom Rini

    Boris Brezillon
     
  • Signed-off-by: Chris Packham
    Reviewed-by: Simon Glass

    Chris Packham
     
  • Commit 2c77c0d6524eb ("xyz-modem: Change getc timeout loop waiting")
    fixes the loop delay when using a hw watchdog, assuming that watchdog
    kicking is taken care of by getc(). But the xyzmodem driver tries to
    do a getc only after confirming that a character is available like below:
    while (!tstc()) {
    till timeout;
    }
    if (tstc())
    *c = getc();

    and getc() does a watchdog reset only if it fails to see a character.
    In this case, getc() always sees a character and never does a
    watchdog reset. So to make sure that watchdog doesn't get reset
    while loading the file, do a watchdog reset just before starting the
    image loading.

    Signed-off-by: Lokesh Vutla
    Signed-off-by: Vignesh R
    Reviewed-by: Simon Glass

    Lokesh Vutla
     
  • Add support for gunzip-ing gzip-compressed uImages in the SPL Ymodem code.
    Loading data over Ymodem can be gruelingly slow, gzip-ing the data can
    reduce that aggravating slowness at least slightly (depends on the data,
    u-boot.bin compresses to ~1/3 of it's original size on ARM64), hence add
    optional support for decompressing gzip-compressed uImages.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini

    Marek Vasut