- Feb 17, 2017
-
-
Dalon Westergreen authored
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 <dwesterg@gmail.com>
-
- Feb 08, 2017
-
-
Vincent Tinelli authored
On some cases the first 440 bytes of MBR are used to keep an additional information for ROM boot loader. 'gpt write' command doesn't preserve that area and makes boot code gone. Preserve boot code area when run 'gpt write' command. Signed-off-by:
Vincent Tinelli <vincent.tinelli@intel.com> Signed-off-by:
Brennan Ashton <brn@deako.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 28, 2017
-
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
Patrick Delaunay authored
We convert CONFIG_PARTITION_UUIDS to Kconfig first. But in order to cleanly update all of the config files we must also update CMD_PART and CMD_GPT to also be in Kconfig in order to avoid complex logic elsewhere to update all of the config files. Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
Patrick Delaunay authored
Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
- Dec 27, 2016
-
-
Jean-Jacques Hiblot authored
With capacities getting bigger, we can see see messages with negative numbers like "Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)". Here the printed LBA is -387938128 when it should have been 3907029168. To fix this, use the right format when displaying the unsigned integers. Signed-off-by:
Jean-Jacques Hiblot <jjhiblot@ti.com> Reported-by:
Yan Liu <yan-liu@ti.com>
-
- Oct 02, 2016
-
-
Petr Kulhavy authored
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 <brain@jikos.cz> Reviewed-by:
Tom Rini <trini@konsulko.com> Acked-by:
Steve Rae <steve.rae@raedomain.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Petr Kulhavy authored
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 <brain@jikos.cz> Reviewed-by:
Tom Rini <trini@konsulko.com> Acked-by:
Steve Rae <steve.rae@raedomain.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Petr Kulhavy authored
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 <brain@jikos.cz> Reviewed-by:
Tom Rini <trini@konsulko.com> Acked-by:
Steve Rae <steve.rae@raedomain.com>
-
- Aug 06, 2016
-
-
Kever Yang authored
The calculation of "dev_desc->lba - 34 - 1 - offset" is not correct for size '-', because both fist_usable_lba and last_usable_lba will remain 34 sectors. We can simply use 0 for size '-' because the part_efi module will decode the size and auto extend the size to maximum available size. Signed-off-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Jul 25, 2016
-
-
Simon Glass authored
This fixes a mismatch between the %zu format and the type used on sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Jul 22, 2016
-
-
Alexander Graf authored
Partitions on the iso el torito partition table interpreter only start from partition 1. So when printing out the tables, let's also start counting at 1. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- May 27, 2016
-
-
Patrick Delaunay authored
the last value acceptable value for offset is last_usable_lba + 1 and not last_usable_lba - 1 issue found with SDCARD partition commands on u-boot 2015.10 but this part of code don't change 1- create GPT partion on all the card > gpt write mmc 0 name=test,start=0,size=0 > 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 0x003a9fde "test" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 type: data guid: b710eb04-45b9-e94a-8d0b-21458d596f54 => Start = 0x22*512 = 0x4400 => Size = (0x003a9fde-0x22+1) * 512 = 0x753F7A00 2- try to recreate the same partition with the next command (block size:512 bytes = 0x200) > gpt write mmc 0 name=test,start=0x4400,size=0x753F7A00 Writing GPT: Partitions layout exceds disk size > gpt write mmc 0 name=test,start=0x4400,size=0x753F7800 Writing GPT: Partitions layout exceds disk size > gpt write mmc 0 name=test,start=0x4400,size=0x753F7600 Writing GPT: success! Partition Map for MMC device 0 -- Partition Type: EFI Part Start LBA End LBA Name Attributes Type GUID Partition GUID 1 0x00000022 0x003a9fdc "test" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 type: data guid: 36ec30ef-7ca4-cd48-97cd-ea9fb95185d0 the max LBA when the size is indicated (0x003a9fdc) is lower than when u-boot compute the max allowed value with size=0 (0x003a9fde) in the code : /* partition ending lba */ if ((i == parts - 1) && (partitions[i].size == 0)) /* extend the last partition to maximuim */ gpt_e[i].ending_lba = gpt_h->last_usable_lba; else gpt_e[i].ending_lba = cpu_to_le64(offset - 1); so offset = gpt_h->last_usable_lba + 1 is acceptable ! but the test (offset >= last_usable_lba) cause the error END Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>disk: part_efi: fix check of the max partition size the last value acceptable value for offset is (last_usable_lba + 1) and not (last_usable_lba - 1) issue found with SDCARD partition commands on u-boot 2015.10 but this part of code don't change 1- I create GPT partion on all the card (start and size undefined) > gpt write mmc 0 name=test,start=0,size=0 > 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 0x003a9fde "test" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 type: data guid: b710eb04-45b9-e94a-8d0b-21458d596f54 => Start = 0x22*512 = 0x4400 => Size = (0x003a9fde-0x22+1) * 512 = 0x753F7A00 2- I try to recreate the same partition with the command gpt write and with start and size values (block size:512 bytes = 0x200) > gpt write mmc 0 name=test,start=0x4400,size=0x753F7A00 Writing GPT: Partitions layout exceds disk size > gpt write mmc 0 name=test,start=0x4400,size=0x753F7800 Writing GPT: Partitions layout exceds disk size > gpt write mmc 0 name=test,start=0x4400,size=0x753F7600 Writing GPT: success! I check the partition created : > 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 0x003a9fdc "test" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 type: data guid: 36ec30ef-7ca4-cd48-97cd-ea9fb95185d0 => but the max LBA when the size is indicated (0x003a9fdc) is lower than when u-boot compute the max allowed value with size=0 (0x003a9fde) 3- in the code, just after my patch, line 446 /* partition ending lba */ if ((i == parts - 1) && (partitions[i].size == 0)) /* extend the last partition to maximuim */ gpt_e[i].ending_lba = gpt_h->last_usable_lba; else gpt_e[i].ending_lba = cpu_to_le64(offset - 1); so offset = gpt_h->last_usable_lba + 1 is acceptable ! (it the value used when size is 0) but today the test (offset >= last_usable_lba) cause the error my patch only solve this issue END Signed-off-by:
Patrick Delaunay <patrick.delaunay73@gmail.com>
-
- May 17, 2016
-
-
Simon Glass authored
Return -EINVAL instead of -1 in this function, to provide a more meaningful error. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This is not needed since we can use the functions provided by the legacy block device support. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Drop use of the table in part.c for this feature. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. We cannot yet make sata_dev_desc[] private to common/sata.c as it is used by the SATA drivers. This will require the SATA interface to be reworked. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is implemented by the legacy block functions now. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Instead of calling xx_get_dev() functions for each interface type, use the new legacy block driver which can provide the device through its interface. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This option currently enables both the command and the SCSI functionality. Rename the existing option to CONFIG_SCSI since most of the code relates to the feature. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Apr 18, 2016
-
-
Alexander Graf authored
Real CD-ROMs are pretty obsolete these days. Usually people still keep iso files around, but just put them on USB sticks or SD cards and expect them to "just work". To support this use case with El Torito images, add support for 512 byte sector size to the iso parsing code. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
The generic partition code treats partition 0 as "whole disk". So we should start with partition 1 as the first partition in the iso partition table. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
The iso partition table implementation has a few endian and 64bit problems. Clean it up a bit to become endian and bitness safe. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
- Apr 14, 2016
-
-
Nishanth Menon authored
Fixes the following warning with PART_DEBUG enabled: disk/part.c: In function ‘get_partition_info’: disk/part.c:372:3: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat] Signed-off-by:
Nishanth Menon <nm@ti.com>
-
- Apr 01, 2016
-
-
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:
Eric Nelson <eric@nelint.com>
-
- Mar 22, 2016
-
-
Simon Glass authored
This cannot be NULL since part_get_info() calls this function and requires it to be non-NULL. Reported-by: Coverity (CID: 138497) Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Simon Glass authored
This cannot be NULL since part_print() calls this function and requires it to be non-NULL. Reported-by: Coverity (CID: 138498) Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
Simon Glass authored
One of these is causing a coverity warning. Drop these functions and use the standard U-Boot ones instead. Reported-by: Coverity (CID: 138499) Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Mar 15, 2016
-
-
Alexander Graf authored
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 <agraf@suse.de> Reviewed-by:
Simon Glass <sjg@chromium.org> Tested-by:
Simon Glass <sjg@chromium.org>
-
- Mar 14, 2016
-
-
Simon Glass authored
Rename these functions so that part_ is at the start. This more clearly identifies these functions as partition functions. Signed-off-by:
Simon Glass <sjg@chromium.org>
-