1. 04 9月, 2021 3 次提交
  2. 01 9月, 2021 1 次提交
  3. 31 7月, 2021 1 次提交
    • P
      arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header · 2226ca17
      Pali Rohár 提交于
      Now that proper load and execution addresses are set in v1 kwbimage we
      can use it for loading and booting U-Boot proper.
      
      Use the new spl_parse_board_header() function to implement parsing the
      kwbimage v1 header. Use information from this header to locate offset and
      size of the U-Boot proper binary, instead of using the legacy U-Boot
      header which is prepended to the U-Boot proper binary stored at fixed
      offset. This has the advantage that we do not need to relay on legacy
      U-Boot header anymore and therefore U-Boot proper binary can be stored at
      any offset, as is the case when loading & booting U-Boot proper by
      BootROM. The CONFIG_SYS_U_BOOT_OFFS option is therefore not used by SPL
      code anymore.
      
      Also allow to compile U-Boot SPL without CONFIG_SPL_SPI_FLASH_SUPPORT,
      CONFIG_SPL_MMC_SUPPORT or CONFIG_SPL_SATA_SUPPORT set. In this case
      BootROM is used for loading and executing U-Boot proper. This reduces the
      size of U-Boot's SPL image. By default these config options are enabled
      and so BootROM loading is not used. In some cases BootROM reads from SPI
      NOR at lower speed than U-Boot SPL. So people can decide whether they
      want to have smaller SPL binary at the cost of slower boot.
      
      Therefore dependency on CONFIG_SPL_DM_SPI, CONFIG_SPL_SPI_FLASH_SUPPORT,
      CONFIG_SPL_SPI_LOAD, CONFIG_SPL_SPI_SUPPORT, CONFIG_SPL_DM_GPIO,
      CONFIG_SPL_DM_MMC, CONFIG_SPL_GPIO_SUPPORT, CONFIG_SPL_LIBDISK_SUPPORT,
      CONFIG_SPL_MMC_SUPPORT, CONFIG_SPL_SATA_SUPPORT and
      CONFIG_SPL_LIBDISK_SUPPORT is changed from strict to related "imply"
      (which can be selectivelly turned off and causes booting via BootROM).
      
      Options CONFIG_SYS_SPI_U_BOOT_OFFS,
      CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR and
      CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET have to to be set to
      zero as they define the location where kwbimage header starts. It is the
      location where BootROM expects start of the kwbimage from which it reads,
      parses and executes SPL part. The same applies to option
      CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR, which has to be set to one.
      
      Update all config files to set correct values of these options and set
      CONFIG_SYS_U_BOOT_OFFS to the correct value - the offset where U-Boot
      proper starts.
      Signed-off-by: NPali Rohár <pali@kernel.org>
      Reviewed-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NStefan Roese <sr@denx.de>
      2226ca17
  4. 29 7月, 2021 9 次提交
  5. 22 7月, 2021 1 次提交
    • S
      spl: Provide more information on boot failure · 7d84fbb5
      Simon Glass 提交于
      If SPL fails to boot, try to provide an error code to indicate what is
      wrong. For example, if a uclass is missing, this can return -EPFNOSUPPORT
      (-96) which provides useful information.
      
      Add a helper for accessing the image-loader name so we can drop the use
      of #ifdefs in this code.
      
      Put this feature behind a CONFIG_SHOW_ERRORS option to avoid increasing
      the code size.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      7d84fbb5
  6. 17 7月, 2021 3 次提交
  7. 31 5月, 2021 1 次提交
  8. 27 5月, 2021 1 次提交
  9. 19 4月, 2021 1 次提交
    • A
      Revert "spl: Drop bd_info in the data section" · 58b504e5
      Alexandru Gagniuc 提交于
      This reverts commit 38d6b7eb.
      
      struct global_data contains a pointer to the bd_info structure. This
      pointer was populated spl_set_bd() to a pre-allocated bd_info in the
      ".data" section. The referenced commit replaced this mechanism to one
      that uses malloc(). That new mechanism is only used if SPL_ALLOC_BD=y.
      which very few boards do.
      
      The result is that (struct global_data)->bd is NULL in SPL on most
      platforms. This breaks falcon mode, since arch_fixup_fdt() tries to
      access (struct global_data)->bd and set the "/memory" node in the
      devicetree. The result is that the "/memory" node contains garbage
      values, causing linux to panic() as it sets up the page table.
      
      Instead of trying to fix the mess, potentially causing other issues,
      revert to the code that worked, while this change is reworked.
      Signed-off-by: NAlexandru Gagniuc <mr.nuke.me@gmail.com>
      58b504e5
  10. 08 4月, 2021 1 次提交
  11. 27 3月, 2021 1 次提交
  12. 26 3月, 2021 1 次提交
    • S
      dm: core: Add an option to support SPL in read-only memory · 95a5825f
      Simon Glass 提交于
      Some systems (e.g. x86 APL) run SPL from read-only memory. The device
      instances created by dtoc are therefore not writeable. To make things work
      we would need to copy the devices to read/write memory.
      
      To avoid this, add an option to use a separate runtime struct for devices,
      just as is done for drivers. This can be used to hold information that
      changes at runtime, avoiding the need for a copy.
      
      Also add a Kconfig option for read-only SPL, which selects this feature.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      95a5825f
  13. 28 1月, 2021 1 次提交
  14. 26 1月, 2021 2 次提交
  15. 16 1月, 2021 1 次提交
    • O
      spl: Kconfig: Add SPL dependency to CONFIG_HANDOFF · 2a7c9ab4
      Ovidiu Panait 提交于
      CONFIG_HANDOFF is used in u-boot proper to locate handoff info from SPL
      during pre-relocation init (in setup_spl_handoff). Add explicit dependency
      on CONFIG_SPL, to fix the following build error when CONFIG_HANDOFF &&
      !CONFIG_SPL:
      
      common/board_f.c: In function ‘setup_spl_handoff’:
      common/board_f.c:283:4: error: ‘gd_t {aka struct global_data}’
      has no member named ‘spl_handoff’
        gd->spl_handoff = bloblist_find(BLOBLISTT_SPL_HANDOFF,
          ^~
      Signed-off-by: NOvidiu Panait <ovidiu.panait@windriver.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      2a7c9ab4
  16. 06 1月, 2021 1 次提交
    • S
      spl: Drop bd_info in the data section · 38d6b7eb
      Simon Glass 提交于
      This uses up space in the SPL binary but it always starts as zero. Also
      some boards cannot support data in TPL (e.g. Intel Apollo Lake).
      
      Use malloc() to allocate this structure instead, by moving the init a
      little later, after malloc() is inited. Make this function optional since
      it pulls in malloc().
      
      This reduces the TPL binary size on coral by about 64 bytes
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      38d6b7eb
  17. 05 12月, 2020 1 次提交
  18. 22 10月, 2020 2 次提交
    • O
      Kconfig: Use hex values for CONFIG_{SPL,TPL}_SIZE_LIMIT · 2dfdd0c4
      Ovidiu Panait 提交于
      CONFIG_{SPL,TPL}_SIZE_LIMIT are defined as hex (SPL_SIZE_LIMIT was
      converted in b51882d0 ("spl: Convert CONFIG_SPL_SIZE_LIMIT to hex"), but
      there are still places that reference integer values. Change those to hex
      as well. Also, update the Makefile to check for 0x0 instead of 0.
      
      This also fixes the following build error when CONFIG_SPL_SIZE_LIMIT
      is set by menuconfig to 0x0:
      ...
      spl/u-boot-spl.bin exceeds file size limit:
        limit:  0 bytes
        actual: 0x80f0 bytes
        excess: 0x80f0 bytes
      Signed-off-by: NOvidiu Panait <ovidiu.panait@windriver.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      2dfdd0c4
    • S
      spl: fit: Minimally parse OS properties with FIT_IMAGE_TINY · cf70553e
      Samuel Holland 提交于
      Some boards, specifically 64-bit Allwinner boards (sun50i), are
      extremely limited on SPL size. One strategy that was used to make space
      was to remove the FIT "os" property parsing code, because it uses a
      rather large lookup table.
      
      However, this forces the legacy FIT parsing code path, which requires
      the "firmware" entry in the FIT to reference the U-Boot binary, even if
      U-Boot is not the next binary in the boot sequence (for example, on
      sun50i boards, ATF is run first).
      
      This prevents the same FIT image from being used with a SPL with
      CONFIG_SPL_FIT_IMAGE_TINY=n and CONFIG_SPL_ATF=y, because the boot
      method selection code looks at `spl_image.os`, which is only set from
      the "firmware" entry's "os" property.
      
      To be able to use CONFIG_SPL_ATF=y, the "firmware" entry in the FIT
      must be ATF, and U-Boot must be a loadable. For this to work, we need to
      parse the "os" property just enough to tell U-Boot from other images, so
      we can find it in the loadables list to append the FDT, and so we don't
      try to append the FDT to ATF (which could clobber adjacent firmware).
      
      So add the minimal code necessary to distinguish U-Boot/non-U-Boot
      loadables with CONFIG_SPL_FIT_IMAGE_TINY=y. This adds about 300 bytes,
      much less than the 7400 bytes added by CONFIG_SPL_FIT_IMAGE_TINY=n.
      Acked-by: NPatrick Wildt <patrick@blueri.se>
      Signed-off-by: NSamuel Holland <samuel@sholland.org>
      Reviewed-by: NJagan Teki <jagan@amarulasolutions.com>
      cf70553e
  19. 14 10月, 2020 1 次提交
  20. 23 9月, 2020 2 次提交
  21. 08 8月, 2020 1 次提交
  22. 04 8月, 2020 1 次提交
  23. 29 7月, 2020 3 次提交