1. 18 Apr, 2016 3 commits
  2. 14 Apr, 2016 1 commit
  3. 01 Apr, 2016 1 commit
    • 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
  4. 22 Mar, 2016 3 commits
  5. 15 Mar, 2016 1 commit
  6. 14 Mar, 2016 11 commits
  7. 20 Jan, 2016 1 commit
    • Erik Tideman's avatar
      mmc: emmc and hw partitions partition table id bugfix. · 99e7fc8a
      Erik Tideman authored
      On bootup the emmc's hw partition is always set to 0 and the partition
      table is read from it. When switching to another hw partition the
      partition table's id is not updated but instead the old one from
      hw partition 0 is used. If there is no partition table on hw partition 0
      then the code will terminate and return error even if the desired hw
      partition contains a perfectly fine partition table. This fix updates
      the partition table struct to correspond to the specified hw partition
      before testing if the partition table is valid or not.
      Signed-off-by: default avatarErik Tideman <erik.tideman@faltcom.se>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      [trini: Squash the patch that corrected whitespace in the original into
      this one, wrap with HAVE_BLOCK_DEVICE test]
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      99e7fc8a
  8. 15 Jan, 2016 1 commit
  9. 14 Jan, 2016 1 commit
  10. 13 Jan, 2016 1 commit
  11. 23 Nov, 2015 2 commits
    • Patrick Delaunay's avatar
      part:efi: add bootable parameter in gpt command · cfdaf4ca
      Patrick Delaunay authored
      The optional parameter bootable is added in gpt command to set the
      partition attribute flag "Legacy BIOS bootable"
      
      This flag is used in extlinux and so in with distro to select
      the boot partition where is located the configuration file
      (please check out doc/README.distro for details).
      
      With this parameter, U-Boot can be used to create the boot partition
      needed for device using distro.
      
      example of use:
      
      setenv partitions "name=u-boot,size=60MiB;name=boot,size=60Mib,bootable;\
                         name=rootfs,size=0"
      
      > gpt write mmc 0 $partitions
      
      > part list mmc 0
      
      Partition Map for MMC device 0  --   Partition Type: EFI
      
      Part	Start LBA	End LBA		Name
      	Attributes
      	Type GUID
      	Partition GUID
        1	0x00000022	0x0001e021	"u-boot"
      	attrs:	0x0000000000000000
      	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
      	guid:	cceb0b18-39cb-d547-9db7-03b405fa77d4
        2	0x0001e022	0x0003c021	"boot"
      	attrs:	0x0000000000000004
      	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
      	guid:	d4981a2b-0478-544e-9607-7fd3c651068d
        3	0x0003c022	0x003a9fde	"rootfs"
      	attrs:	0x0000000000000000
      	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
      	guid:	6d6c9a36-e919-264d-a9ee-bd00379686c7
      
      > part list mmc 0 -bootable devplist
      
      > printenv devplist
      
      devplist=2
      
      Then the distro scripts will search extlinux in partition 2
      and not in the first partition.
      Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay73@gmail.com>
      cfdaf4ca
    • Lukasz Majewski's avatar
      gpt: part: Definition and declaration of GPT verification functions · cef68bf9
      Lukasz Majewski authored
      This commit provides definition and declaration of GPT verification
      functions - namely gpt_verify_headers() and gpt_verify_partitions().
      The former is used to only check CRC32 of GPT's header and PTEs.
      The latter examines each partition entry and compare attributes such as:
      name, start offset and size with ones provided at '$partitions' env
      variable.
      Signed-off-by: default avatarLukasz Majewski <l.majewski@majess.pl>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
      cef68bf9
  12. 12 Nov, 2015 2 commits
    • Patrick Delaunay's avatar
      uuid: add selection by string for known partition type GUID · bcb41dca
      Patrick Delaunay authored
      short strings can be used in type parameter of gpt command
      to replace the guid string for the types known by u-boot
      
            partitions = name=boot,size=0x6bc00,type=data; \
                         name=root,size=0x7538ba00,type=linux;
            gpt write mmc 0 $partitions
      
      and they are also used to display the type of partition
      in "part list" command
      
        Partition Map for MMC device 0  --   Partition Type: EFI
      
        Part	Start LBA	End LBA		Name
      	Attributes
      	Type GUID
      	Partition GUID
          1	0x00000022	0x0000037f	"boot"
      	attrs:	0x0000000000000000
      	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
      	type:	data
      	guid:	d117f98e-6f2c-d04b-a5b2-331a19f91cb2
          2	0x00000380	0x003a9fdc	"root"
      	attrs:	0x0000000000000000
      	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
      	type:	linux
      	guid:	25718777-d0ad-7443-9e60-02cb591c9737
      Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay73@gmail.com>
      bcb41dca
    • Patrick Delaunay's avatar
      gpt: add optional parameter type in gpt command · 7561b258
      Patrick Delaunay authored
      code under flag CONFIG_PARTITION_TYPE_GUID
      add parameter "type" to select partition type guid
      
      example of use with gpt command :
      
        partitions = uuid_disk=${uuid_gpt_disk}; \
            name=boot,size=0x6bc00,uuid=${uuid_gpt_boot}; \
            name=root,size=0x7538ba00,uuid=${uuid_gpt_root}, \
               type=0fc63daf-8483-4772-8e79-3d69d8477de4;
      
        gpt write mmc 0 $partitions
      Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay73@gmail.com>
      7561b258
  13. 24 Oct, 2015 2 commits
  14. 11 Sep, 2015 1 commit
  15. 08 Jan, 2015 1 commit
    • Maxime Ripard's avatar
      gpt: Fix the protective MBR partition size · b349abbf
      Maxime Ripard authored
      According to the UEFI Spec (Table 16, section 5.2.3 of the version 2.4 Errata
      B), the protective MBR partition record size must be set to the size of the
      disk minus one, in LBAs.
      
      However, the current code was setting the size as the total number of LBAs on
      the disk, resulting in an off-by-one error.
      
      This confused the AM335x ROM code, and will probably confuse other tools as
      well.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      b349abbf
  16. 18 Dec, 2014 2 commits
  17. 27 Nov, 2014 1 commit
  18. 25 Oct, 2014 1 commit
  19. 24 Sep, 2014 1 commit
  20. 22 Jul, 2014 1 commit
  21. 23 Jun, 2014 1 commit
    • Stephen Warren's avatar
      sandbox: restore ability to access host fs through standard commands · 4d907025
      Stephen Warren authored
      Commit 95fac6ab "sandbox: Use os functions to read host device tree"
      removed the ability for get_device_and_partition() to handle the "host"
      device type, and redirect accesses to it to the host filesystem. This
      broke some unit tests that use this feature. So, revert that change. The
      code added back by this patch is slightly different to pacify checkpatch.
      
      However, we're then left with "host" being both:
      - A pseudo device that accesses the hosts real filesystem.
      - An emulated block device, which accesses "sectors" inside a file stored
        on the host.
      
      In order to resolve this discrepancy, rename the pseudo device from host
      to hostfs, and adjust the unit-tests for this change.
      
      The "help sb" output is modified to reflect this rename, and state where
      the host and hostfs devices should be used.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Tested-by: default avatarJosh Wu <josh.wu@atmel.com>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      Tested-by: default avatarSimon Glass <sjg@chromium.org>
      4d907025
  22. 12 Jun, 2014 1 commit
    • Stephen Warren's avatar
      disk: default to HW partition 0 if not specified · ecdd57e2
      Stephen Warren authored
      Currently, get_device()/get_dev_hwpart() for MMC devices does not select
      an explicit HW partition unless the user explicitly requests one, i.e. by
      requesting device "mmc 0.0" rather than just "mmc 0". I think it makes
      more sense if the default is to select HW partition 0 (main data area)
      if the user didn't request a specific partition. Otherwise, the following
      happens, which feels wrong:
      
      Select HW partition 1 (boot0):
      mmc dev 0 1
      
      Attempts to access SW partition 1 on HW partition 1 (boot0), rather than
      SW partition 1 on HW partition 0 (main data area):
      ls mmc 0:1 /
      
      With this patch, the second command above re-selects the main data area.
      
      Many device types don't support HW partitions at all, so if HW partition
      0 is selected (either explicitly or as the default) and there's no
      select_hwpart function, we simply skip attempting to select a HW
      partition.
      
      Some MMC devices (i.e. SD cards) don't support HW partitions. However,
      this patch still works, since mmc_start_init() sets the current
      partition number to 0, and mmc_select_hwpart() succeeds if the requested
      partition is already selected.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarPantelis Antoniou <panto@antoniou-consulting.com>
      ecdd57e2