1
0
Fork 0
remarkable-uboot/disk
Stephen Warren ecdd57e274 disk: default to HW partition 0 if not specified
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: Stephen Warren <swarren@nvidia.com>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
2014-06-12 15:21:12 +03:00
..
Makefile kbuild: use Linux Kernel build scripts 2014-02-19 11:07:50 -05:00
part.c disk: default to HW partition 0 if not specified 2014-06-12 15:21:12 +03:00
part_amiga.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
part_amiga.h Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
part_dos.c disk: part_dos.c: Add a PBR check when MBR checking fails 2014-06-11 16:27:05 -04:00
part_dos.h Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
part_efi.c disk: part_efi: add get_partition_info_efi_by_name() 2014-06-05 14:44:56 -04:00
part_iso.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
part_iso.h Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
part_mac.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
part_mac.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00