25 Jul, 2019

1 commit

  • This patch adds part_get_info_by_dev_and_name_or_num() function which
    allows us to get partition info from its number or name. Partition of
    interest is specified by string like "device_num:partition_number" or
    "device_num#partition_name".

    The patch was extracted from [1].

    [1] https://android-review.googlesource.com/c/platform/external/u-boot/+/729880/2

    Signed-off-by: Ruslan Trofymenko
    Signed-off-by: Igor Opaniuk
    Reviewed-by: Alistair Strachan
    Reviewed-by: Sam Protsenko
    Reviewed-by: Simon Glass

    Ruslan Trofymenko
     

01 Feb, 2019

2 commits


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
     

06 Oct, 2017

1 commit


20 Sep, 2017

1 commit


15 Sep, 2017

1 commit

  • Needed to support efi file protocol. The fallback.efi loader wants
    to be able to read the contents of the /EFI directory to find an OS
    to boot.

    Modelled after POSIX opendir()/readdir()/closedir(). Unlike the other
    fs APIs, this is stateful (ie. state is held in the FS_DIR "directory
    stream"), to avoid re-traversing of the directory structure at each
    step. The directory stream must be released with closedir() when it
    is no longer needed.

    Signed-off-by: Rob Clark
    Reviewed-by: Łukasz Majewski
    Reviewed-by: Simon Glass

    Rob Clark
     

03 Sep, 2017

1 commit


05 Aug, 2017

1 commit


04 Aug, 2017

4 commits


12 May, 2017

1 commit


18 Feb, 2017

1 commit

  • the socfpga bootrom supports mmc booting from either a raw image
    starting at 0x0, or from a partition of type 0xa2. This patch
    adds support for locating the boot image in the first type 0xa2
    partition found.

    Assigned a partition number of -1 will cause a search for a
    partition of type CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE
    and use it to find the u-boot image

    Signed-off-by: Dalon Westergreen

    Dalon Westergreen
     

28 Jan, 2017

3 commits


02 Oct, 2016

3 commits

  • In both DOS and ISO partition tables the same code to create partition name
    like "hda1" was repeated.

    Code moved to into a new function part_set_generic_name() in part.c and optimized.
    Added recognition of MMC and SD types, name is like "mmcsda1".

    Signed-off-by: Petr Kulhavy
    Reviewed-by: Tom Rini
    Acked-by: Steve Rae
    Reviewed-by: Simon Glass

    Petr Kulhavy
     
  • Add special target "mbr" (otherwise configurable via CONFIG_FASTBOOT_MBR_NAME)
    to write MBR partition table.
    Partitions are now searched using the generic function which finds any
    partiiton by name. For MBR the partition names hda1, sda1, etc. are used.

    Signed-off-by: Petr Kulhavy
    Reviewed-by: Tom Rini
    Acked-by: Steve Rae
    Reviewed-by: Simon Glass

    Petr Kulhavy
     
  • So far partition search by name has been supported only on the EFI partition
    table. This patch extends the search to all partition tables.

    Rename part_get_info_efi_by_name() to part_get_info_by_name(), move it from
    part_efi.c into part.c and make it a generic function which traverses all part
    drivers and searches all partitions (in the order given by the linked list).

    For this a new variable struct part_driver.max_entries is added, which limits
    the number of partitions searched. For EFI this was GPT_ENTRY_NUMBERS.
    Similarly the limit is defined for DOS, ISO, MAC and AMIGA partition tables.

    Signed-off-by: Petr Kulhavy
    Reviewed-by: Tom Rini
    Acked-by: Steve Rae

    Petr Kulhavy
     

17 May, 2016

9 commits


12 Apr, 2016

1 commit

  • The patch "dm: part: Convert partition API use to linker lists"
    (sha1: 96e5b03c8ab749b6547f6a3ceb4d4b9f274211aa) is adding new
    dependency for enabling SPL_EXT_SUPPORT to be able to get
    information about DOS partition.
    get_info is also required for FAT support only which is used on Xilinx
    Zynq boards.

    Reported-by: Nathan Rossi
    Signed-off-by: Michal Simek
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass

    Michal Simek
     

16 Mar, 2016

1 commit

  • We have a pretty nice and generic interface to ask for a specific block
    device. However, that one is still based around the magic notion that
    we know the driver name.

    In order to be able to write fully generic disk access code, expose the
    currently internal list to other source files so that they can scan through
    all available block drivers.

    Signed-off-by: Alexander Graf
    Reviewed-by: Simon Glass
    Tested-by: Simon Glass

    Alexander Graf
     

15 Mar, 2016

8 commits

  • Rename three partition functions so that they start with part_. This makes
    it clear what they relate to.

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

    Simon Glass
     
  • We can use linker lists instead of explicitly declaring each function.
    This makes the code shorter by avoiding switch() statements and lots of
    header file declarations.

    While this does clean up the code it introduces a few code issues with SPL.
    SPL never needs to print partition information since this all happens from
    commands. SPL mostly doesn't need to obtain information about a partition
    either, except in a few cases. Add these cases so that the code will be
    dropped from each partition driver when not needed. This avoids code bloat.

    I think this is still a win, since it is not a bad thing to be explicit
    about which features are used in SPL. But others may like to weigh in.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini
    Tested-by: Stephen Warren

    Simon Glass
     
  • Rename this function to blk_get_device_part_str(). This is a better name
    because it makes it clear that the function returns a block device and
    parses a string.

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

    Simon Glass
     
  • The current name is too generic. The function returns a block device based
    on a provided string. Rename it to aid searching and make its purpose
    clearer. Also add a few comments.

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

    Simon Glass
     
  • The current name is too generic. Add a 'blk_' prefix to aid searching and
    make its purpose clearer.

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

    Simon Glass
     
  • The block interface is not well documented in the code. Pick two important
    functions and add comments.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    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
     
  • We should not include in header files. Each C file should include
    it if needed.

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

    Simon Glass