1. 20 Apr, 2016 2 commits
  2. 18 Apr, 2016 8 commits
    • Alexander Graf's avatar
      efi_loader: Pass fdt address directly to bootefi cmd · 1c39809b
      Alexander Graf authored
      The bootefi cmd today fetches its device tree pointer from either the
      location appointed by "fdt addr" with a fallback to the U-Boot control
      fdt.
      
      This integration is unusual for U-Boot and diverges from the way we
      usually handle parameters to boot commands. So let's pass the fdt
      directly into the bootefi command instead and move the control fdt
      logic into the distro boot script.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Acked-by: default avatarStephen Warren <swarren@wwwdotorg.org>
      Reviewed-by: default avatarAndreas Färber <afaerber@suse.de>
      1c39809b
    • Alexander Graf's avatar
      efi_loader: Put fdt into convenient location · ad0c1a3d
      Alexander Graf authored
      The uEFI spec doesn't dictate where the device tree should live at, but
      legacy 32bit ARM grub2 has some assumptions that it may stay at its place
      when it's already loaded by the firmware.
      
      So let's put it somewhere where Linux that comes after would happily find
      it - around the recommended 128MB line.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Tested-by: default avatarAndreas Färber <afaerber@suse.de>
      ad0c1a3d
    • Alexander Graf's avatar
      efi_loader: Use system fdt as fallback · 0d9d501f
      Alexander Graf authored
      When the user did not pass any device tree or the boot script
      didn't find any, let's use the system device tree as last resort
      to get something the payload (Linux) may understand.
      
      This means that on systems that use the same device tree for U-Boot
      and Linux we can just share it and there's no need to manually provide
      a device tree in the target image.
      
      While at it, also copy and pad the device tree by 64kb to give us
      space for modifications.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Tested-by: default avatarAndreas Färber <afaerber@suse.de>
      0d9d501f
    • Alexander Graf's avatar
      efi_loader: Increase path string to 32 characters · ecbe1a07
      Alexander Graf authored
      Whenever we want to tell our payload about a path, we limit ourselves
      to a reasonable amount of characters. So far we only passed in device
      names - exceeding 16 chars was unlikely there.
      
      However by now we also pass real file path information, so let's increase
      the limit to 32 characters. That way common paths like "boot/efi/bootaa64.efi"
      fit just fine.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      ecbe1a07
    • Alexander Graf's avatar
      efi_loader: Pass file path to payload · c07ad7c0
      Alexander Graf authored
      The payload gets information on where it got loaded from. This includes
      the device as well as file path.
      
      So far we've treated both as the same thing and always gave it the device
      name. However, in some situations grub2 actually wants to find its loading
      path to find its configuration file.
      
      So let's split the two semantically separte bits into separate structs and
      pass the loaded file name into our payload when we load it using "load".
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      c07ad7c0
    • Alexander Graf's avatar
      efi_loader: Add el torito support · 8c3df0bf
      Alexander Graf authored
      When loading an el torito image, uEFI exposes said image as a raw
      block device to the payload.
      
      Let's do the same by creating new block devices with added offsets for
      the respective el torito partitions.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      8c3df0bf
    • Michal Simek's avatar
      cmd: fdt: Use separate CMD_FDT Kconfig entry instead of OF_LIBFDT · 23922e26
      Michal Simek authored
      Create CMD_FDT Kconfig entry to have an option to disable fdt command
      which is not required for small configuration which requires libfdt
      only.
      Enable it by default for all targets which enables OF_LIBFDT.
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
      [trini: Fixup flea3/sandbox/id8313/siemens-am33xx/smartweb]
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      23922e26
    • Peng Fan's avatar
      common: env: support sata device · 125d193c
      Peng Fan authored
      Introduce env support for sata device.
      1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev
      2. If want to enable this feature, define CONFIG_ENV_IS_IN_SATA, and
         define CONFIG_SYS_SATA_ENV_DEV or implement your own sata_get_ev_dev.
      Signed-off-by: default avatarPeng Fan <van.freenix@gmail.com>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Joe Hershberger <joe.hershberger@ni.com>
      Cc: Bin Meng <bmeng.cn@gmail.com>
      Cc: Stefan Roese <sr@denx.de>
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Stuart Longland <stuartl@vrt.com.au>
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Cc: Tom Rini <trini@konsulko.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      125d193c
  3. 11 Apr, 2016 2 commits
  4. 10 Apr, 2016 2 commits
  5. 01 Apr, 2016 5 commits
    • Eric Nelson's avatar
      sata: use block layer for sata command · 96baf368
      Eric Nelson authored
      Call blk_dread, blk_dwrite, blk_derase to ensure that the block cache is
      used if enabled and to remove build breakage when CONFIG_BLK is enabled.
      Signed-off-by: default avatarEric Nelson <eric@nelint.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      96baf368
    • Eric Nelson's avatar
      mmc: use block layer in mmc command · bcfde7ff
      Eric Nelson authored
      Call blk_dread, blk_dwrite, blk_derase to ensure that the block cache is
      used if enabled and to remove build breakage when CONFIG_BLK is enabled.
      Signed-off-by: default avatarEric Nelson <eric@nelint.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      bcfde7ff
    • Eric Nelson's avatar
      drivers: block: add block device cache · e40cf34a
      Eric Nelson authored
      Add a block device cache to speed up repeated reads of block devices by
      various filesystems.
      
      This small amount of cache can dramatically speed up filesystem
      operations by skipping repeated reads of common areas of a block
      device (typically directory structures).
      
      This has shown to have some benefit on FAT filesystem operations of
      loading a kernel and RAM disk, but more dramatic benefits on ext4
      filesystems when the kernel and/or RAM disk are spread across
      multiple extent header structures as described in commit fc0fc50f.
      
      The cache is implemented through a minimal list (block_cache) maintained
      in most-recently-used order and count of the current number of entries
      (cache_count). It uses a maximum block count setting to prevent copies
      of large block reads and an upper bound on the number of cached areas.
      
      The maximum number of entries in the cache defaults to 32 and the maximum
      number of blocks per cache entry has a default of 2, which has shown to
      produce the best results on testing of ext4 and FAT filesystems.
      
      The 'blkcache' command (enabled through CONFIG_CMD_BLOCK_CACHE) allows
      changing these values and can be used to tune for a particular filesystem
      layout.
      Signed-off-by: default avatarEric Nelson <eric@nelint.com>
      e40cf34a
    • Masahiro Yamada's avatar
      arm64: booti: add missing unmap_sysmem() · 62022d52
      Masahiro Yamada authored
      Make sure to call unmap_sysmem() for address allocated by map_sysmem()
      before leaving the function; however this patch gives no impact on
      the behavior because map_sysmem()/unmap_sysmem() does nothing except
      on Sandbox.  Sandbox never runs this code because "booti" is a command
      for booting ARM64 kernel image.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
      62022d52
    • Simon Glass's avatar
      Drop command-processing code when CONFIG_CMDLINE is disabled · f8bb6964
      Simon Glass authored
      Command parsing and processing code is not needed when the command line is
      disabled. Remove this code in that case.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      f8bb6964
  6. 27 Mar, 2016 2 commits
    • Peng Fan's avatar
      cmd: spi: check return value of strdup · 9caeb26c
      Peng Fan authored
      Check return value of strdup.
      Signed-off-by: default avatarPeng Fan <van.freenix@gmail.com>
      Cc: Przemyslaw Marczak <p.marczak@samsung.com>
      Cc: Bin Meng <bmeng.cn@gmail.com>
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Stefan Roese <sr@denx.de>
      Cc: Tom Rini <trini@konsulko.com>
      9caeb26c
    • Alexander Graf's avatar
      efi_loader: Add GOP support · be8d3241
      Alexander Graf authored
      The EFI standard defines a simple boot protocol that an EFI payload can use
      to access video output.
      
      This patch adds support to expose exactly that one (and the mode already in
      use) as possible graphical configuration to an EFI payload.
      
      With this, I can successfully run grub2 with graphical output.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      be8d3241
  7. 22 Mar, 2016 4 commits
  8. 18 Mar, 2016 1 commit
  9. 17 Mar, 2016 1 commit
  10. 16 Mar, 2016 4 commits
    • Tom Rini's avatar
      cmd: scsi: Group the command portion together, guard with !CONFIG_SPL_BUILD · ba524269
      Tom Rini authored
      When we switch to including all linker lists in SPL it is important
      to not include commands as that may lead to link errors due to other
      things we have already discarded.  In this case, the SCSI code needs a lot
      of attention so for now just guard the command portions.
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      ba524269
    • Alexander Graf's avatar
      efi_loader: Pass proper device path in on boot · 0f4060eb
      Alexander Graf authored
      EFI payloads can query for the device they were booted from. Because
      we have a disconnect between loading binaries and running binaries,
      we passed in a dummy device path so far.
      
      Unfortunately that breaks grub2's logic to find its configuration
      file from the same device it was booted from.
      
      This patch adds logic to have the "load" command call into our efi
      code to set the device path to the one we last loaded a binary from.
      
      With this grub2 properly detects where we got booted from and can
      find its configuration file, even when searching by-partition.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      0f4060eb
    • Alexander Graf's avatar
      efi_loader: Call fdt preparation functions · dea2174d
      Alexander Graf authored
      We have a nice framework around image fils to prepare a device tree
      for OS execution. That one patches in missing device tree nodes and
      fixes up the memory range bits.
      
      We need to call that one from the EFI boot path too to get all those
      nice fixups. This patch adds the call.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      dea2174d
    • Alexander Graf's avatar
      efi_loader: Add "bootefi" command · b9939336
      Alexander Graf authored
      In order to execute an EFI application, we need to bridge the gap between
      U-Boot's notion of executing images and EFI's notion of doing the same.
      
      The best path forward IMHO here is to stick completely to the way U-Boot
      deals with payloads. You manually load them using whatever method to RAM
      and then have a simple boot command to execute them. So in our case, you
      would do
      
        # load mmc 0:1 $loadaddr grub.efi
        # bootefi $loadaddr
      
      which then gets you into a grub shell. Fdt information known to U-boot
      via the fdt addr command is also passed to the EFI payload.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      Tested-by: default avatarSimon Glass <sjg@chromium.org>
      [trini: Guard help text with CONFIG_SYS_LONGHELP]
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      b9939336
  11. 14 Mar, 2016 9 commits