06 Feb, 2020

2 commits

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present devres.h is included in all files that include dm.h but few
    make use of it. Also this pulls in linux/compat which adds several more
    headers. Drop the automatic inclusion and require files to include devres
    themselves. This provides a good indication of which files use devres.

    Signed-off-by: Simon Glass
    Reviewed-by: Anatolij Gustschin

    Simon Glass
     

27 Jan, 2020

1 commit


26 Jan, 2020

1 commit

  • On m68k, block_cache list is relocated, but next and prev list
    pointers are not adjusted to the relocated struct list_head address,
    so the first iteration over the block_cache list hangs.

    This patch initializes the block_cache list after relocation.

    Signed-off-by: Angelo Durgehello
    Reviewed-by: Eric Nelson

    Angelo Durgehello
     

03 Dec, 2019

1 commit

  • When we do not have CONFIG_BLK (or SPL/TPL) enabled there are very few
    cases where we need the blk_legacy code linked in. To catch these, build
    when we have CONFIG_HAVE_BLOCK_DEVICE set. In addition, we only need
    cmd/blk_common.o to be linked in when we have CONFIG_HAVE_BLOCK_DEVICE
    set, so make use of that directly.

    Signed-off-by: Tom Rini

    Tom Rini
     

31 Oct, 2019

1 commit

  • The ext4 file system requires log2blksz to be set. So when setting the
    block size on the block descriptor we should fill this field too.

    This fixes a problem with EFI block devices providing ext4 partitions, cf.
    https://lists.denx.de/pipermail/u-boot/2019-October/387702.html.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass

    Heinrich Schuchardt
     

08 Oct, 2019

1 commit


31 Aug, 2019

1 commit

  • This reverts commit 0ebe112d09b48230ba4be833cd3504b06997d9a4.

    Most block devices have only one hwpart. Multiple hwparts only found used
    by eMMC devices in u-boot. The mmc driver do blk_dselect_hwpart() at the
    beginning of mmc_bread() which causes block cache being invalidated too
    frequently and makes block cache useless.

    So it's not a good idea to put blkcache_invalidate() in the common
    functions. It should be called inside mmc_select_hwpart().

    Signed-off-by: Weijie Gao
    Tested-by: Felix Brack

    Weijie Gao
     

18 Jul, 2019

1 commit

  • Some storage devices have multiple hw partitions and both address from
    zero, for example eMMC.
    However currently block cache invalidation only applies to block
    write/erase.
    This can cause a problem that data of current hw partition is cached
    before switching to another hw partition. And the following read
    operation of the latter hw partition will get wrong data when reading
    from the addresses that have been cached previously.

    To solve this problem, invalidate block cache after a successful
    select_hwpart operation.

    Signed-off-by: Weijie Gao

    Weijie Gao
     

11 Jul, 2019

1 commit


16 Jan, 2019

1 commit

  • Cache up to 4 kiB entries. 4 kiB is the default block size on ext4, yet
    the underlying block layer devices usually report support for 512B . In
    most cases, the 512B support is emulated (ie. SD cards, SSDs, USB sticks
    etc.) and the real block size of those devices is much bigger.

    To avoid performance degradation with such devices and FS setup, bump
    the maximum cache entry size to 4 kiB.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Cc: Simon Glass
    Reviewed-by: Tom Rini

    Marek Vasut
     

13 Dec, 2018

1 commit

  • The function part_init() will only be built when we have both
    CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set. Protect the call to
    this function with both of these tests now.

    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Michal Simek
    Cc: York Sun
    Cc: Prabhakar Kushwaha
    Cc: Mingkai Hu
    Cc: Stefan Roese
    Cc: Marek Behún
    Cc: Vanessa Maegima
    Cc: Eugen Hristev
    Cc: Adam Ford
    Cc: Jagan Teki
    Cc: Tom Warren
    Cc: Stephen Warren
    Cc: Vitaly Andrianov
    Signed-off-by: Tom Rini
    Reviewed-by: Simon Glass

    Tom Rini
     

15 Nov, 2018

5 commits


09 Oct, 2018

1 commit


29 Sep, 2018

1 commit


19 Jun, 2018

1 commit

  • When enabling BLOCK_CACHE on devices with limited RAM during SPL,
    some devices may not boot. This creates an option to enable
    block caching in SPL by defaults off. It is dependent on SPL_BLK

    Fixes: 46960ad6d09b ("block: Have BLOCK_CACHE default to y in some cases")

    Signed-off-by: Adam Ford

    Adam Ford
     

07 Jun, 2018

1 commit

  • When dealing with filesystems that come from block devices we can get a
    noticeable performance gain in some use cases from having the block
    cache enabled. The code paths are valid in other cases when we have BLK
    set and may provide wins in raw reads in some use cases, so have this be
    default when BLK is enabled.

    Signed-off-by: Tom Rini

    Tom Rini
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

14 Feb, 2018

1 commit

  • This driver is no longer used on any supported platform in U-Boot and
    there is no interest in maintaining it further from people that have
    used it historically.

    Cc: Simon Glass
    Cc: Michal Simek
    c: Alexey Brodkin
    Signed-off-by: Tom Rini
    Acked-by: Michal Simek

    Tom Rini
     

09 Feb, 2018

2 commits

  • config_fallbacks.h has some logic that sets HAVE_BLOCK_DEVICE
    based on a list of enabled options. Moving HAVE_BLOCK_DEVICE to
    Kconfig allows us to drastically shrink the logic in
    config_fallbacks.h

    Signed-off-by: Adam Ford
    [trini: Rename HAVE_BLOCK_DEVICE to CONFIG_BLOCK_DEVICE]
    Signed-off-by: Tom Rini

    Adam Ford
     
  • Migrate the base and sub-options to Kconfig. Note that we only enable
    this in the base sandbox config now.

    Cc: Alexey Brodkin
    Cc: Michal Simek
    Signed-off-by: Tom Rini
    ---
    Is this driver still used anywhere? It's fishy that it's only enabled
    in sandbox anymore.

    Tom Rini
     

23 Jan, 2018

1 commit

  • This patch provides
    * a uclass for EFI drivers
    * a EFI driver for block devices

    For each EFI driver the uclass
    * creates a handle
    * adds the driver binding protocol

    The uclass provides the bind, start, and stop entry points for the driver
    binding protocol.

    In bind() and stop() it checks if the controller implements the protocol
    supported by the EFI driver. In the start() function it calls the bind()
    function of the EFI driver. In the stop() function it destroys the child
    controllers.

    The EFI block driver binds to controllers implementing the block io
    protocol.

    When the bind function of the EFI block driver is called it creates a
    new U-Boot block device. It installs child handles for all partitions and
    installs the simple file protocol on these.

    The read and write functions of the EFI block driver delegate calls to the
    controller that it is bound to.

    A usage example is as following:

    U-Boot loads the iPXE snp.efi executable. iPXE connects an iSCSI drive and
    exposes a handle with the block IO protocol. It calls ConnectController.

    Now the EFI block driver installs the partitions with the simple file
    protocol.

    iPXE uses the simple file protocol to load Grub or the Linux Kernel.

    Signed-off-by: Heinrich Schuchardt
    [agraf: add comment on calloc len]
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

13 Dec, 2017

1 commit

  • This patch changes the calls to uclass_first/next_device() in blk_first/
    next_device() to use uclass_find_first/next_device() instead. These functions
    don't prepare the devices, which is correct in this case.

    With this patch applied, the "usb storage" command now works again as
    expected:

    => usb storage
    Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
    Type: Removable Hard Disk
    Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)

    Without this patch, it used to generate this buggy output:

    => usb storage
    Card did not respond to voltage select!
    mmc_init: -95, time 26
    No storage devices, perhaps not 'usb start'ed..?

    Signed-off-by: Stefan Roese
    Suggested-by: Simon Glass
    Cc: Simon Glass
    Cc: Bin Meng
    Reviewed-by: Bin Meng
    Reviewed-by: Simon Glass

    Stefan Roese
     

15 Sep, 2017

1 commit

  • All these places seem to inherit the codes from the MMC driver where
    a FIXME was put in the comment. However the correct operation after
    read should be cache invalidate, not flush.

    The underlying drivers should be responsible for the cache operation.
    Remove these codes completely.

    Signed-off-by: Bin Meng
    Reviewed-by: Stefan Roese
    Reviewed-by: York Sun
    Reviewed-by: Joe Hershberger
    Reviewed-by: Simon Glass
    Tested-by: York Sun

    Bin Meng
     

12 Sep, 2017

1 commit


11 Sep, 2017

2 commits


04 Sep, 2017

3 commits


17 Aug, 2017

2 commits


14 Aug, 2017

1 commit


02 Aug, 2017

1 commit


01 Aug, 2017

2 commits

  • Add missing #ifndef CONFIG_BLK to wrap dev_desc->block_read.

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

    Bin Meng
     
  • At present if U-Boot proper uses driver model for MMC, then SPL has to
    also. While this is desirable, it places a significant barrier to moving
    to driver model in some cases. For example, with a space-constrained SPL
    it may be necessary to enable CONFIG_SPL_OF_PLATDATA which involves
    adjusting some drivers.

    Add new SPL versions of the options for DM_MMC, DM_MMC_OPS and BLK. By
    default these follow their non-SPL versions, but this can be changed by
    boards which need it.

    Signed-off-by: Simon Glass

    Simon Glass