26 Jan, 2020

2 commits


15 Nov, 2018

3 commits


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 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
     

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
     

20 Sep, 2017

1 commit

  • EFI client programs need the signature information from the partition
    table to determine the disk a partition is on, so we need to fill that
    in here.

    Signed-off-by: Peter Jones
    [separated from efi_loader part, and fixed build-errors for non-
    CONFIG_EFI_PARTITION case]
    Signed-off-by: Rob Clark
    Signed-off-by: Alexander Graf

    Peter Jones
     

12 Sep, 2017

1 commit


11 Sep, 2017

1 commit


17 Aug, 2017

2 commits

  • Most block devices provide a command (e.g. 'sata', 'scsi', 'ide') and
    these commands generally do the same thing. This makes it harder to
    maintain this code and keep it consistent.

    We now have a block device interface which is either implemented by driver
    model (when CONFIG_BLK is enabled) or with a legacy interface. Therefore
    it is possible to handle most of what these commands do with generic code.

    Add a new generic function to process block-device commands using the
    interface type and the current device number for that type.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add a function to find the name of an interface type (e.g. "sata", "scsi")
    from the interface type enum.

    This is useful for generic code (not specific to SATA or SCSI, for
    example) that wants to display the type of interface it is dealing with.

    Signed-off-by: Simon Glass

    Simon Glass
     

14 Aug, 2017

1 commit


01 Aug, 2017

1 commit

  • 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
     

10 Jun, 2017

1 commit

  • When we don't have CONFIG_BLK defined we don't have a forward
    declaration of struct udevice, and thus get a warning about it on
    blk_get_from_parent(), which we only have when CONFIG_BLK is set. Move
    the declaration of blk_get_from_parent() to be with the other CONFIG_BLK
    parts.

    Fixes 9f103b9cb5f8 ("dm: blk: Add a way to obtain a block device from ...")
    Signed-off-by: Tom Rini

    Tom Rini
     

09 Jun, 2017

1 commit


01 Jun, 2017

1 commit


17 May, 2016

6 commits


12 Apr, 2016

1 commit


02 Apr, 2016

1 commit

  • 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 fc0fc50.

    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: Eric Nelson

    Eric Nelson
     

15 Mar, 2016

5 commits

  • Add a uclass for block devices. These provide block-oriented data access,
    supporting reading, writing and erasing of whole blocks.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Tested-by: Stephen Warren

    Simon Glass
     
  • To ease conversion to driver model, add helper functions which deal with
    calling each block device method. With driver model we can reimplement these
    functions with the same arguments.

    Use inline functions to avoid increasing code size on some boards.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Tested-by: Stephen Warren

    Simon Glass
     
  • This is a device number, and we want to use 'dev' to mean a driver model
    device. Rename the member.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Tested-by: Stephen Warren

    Simon Glass
     
  • Since these are sequentially numbered it makes sense to use an enum. It
    avoids having to maintain the maximum value, and provides a type we can use
    if it is useful.

    In fact the maximum value is not used. Rename it to COUNT, since MAX suggests
    it is the maximum valid value, but it is not.

    Signed-off-by: Simon Glass
    Tested-by: Stephen Warren

    Simon Glass
     
  • At present block devices are tied up with partitions. But not all block
    devices have partitions within them. They are in fact separate concepts.

    Create a separate blk.h header file for block devices.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Tested-by: Stephen Warren

    Simon Glass