diff options
author | Stephen Warren <swarren@nvidia.com> | 2015-12-07 18:38:49 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-14 02:05:19 (GMT) |
commit | 873cc1d7775ed5de07e6722c7ff423080c2e8f71 (patch) | |
tree | 6540fea6fcf0edf8da6904f168e2dbd75259dc56 /include | |
parent | 7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (diff) | |
download | u-boot-fsl-qoriq-873cc1d7775ed5de07e6722c7ff423080c2e8f71.tar.xz |
mmc: store hwpart in the block device
This will allow us to have multiple block device structs each referring
to the same eMMC device, yet different HW partitions.
For now, there is still a single block device per eMMC device. As before,
this block device always accesses whichever HW partition was most recently
selected. Clients wishing to make use of multiple block devices referring
to different HW partitions can simply take a copy of this block device
once it points at the correct HW partition, and use each one as they wish.
This feature will be used by the next patch.
In the future, perhaps get_device() could be enhanced to return a
dynamically allocated block device struct, to avoid the client needing to
copy it in order to maintain multiple block devices. However, this would
require all users to be updated to free those block device structs at some
point, which is rather a large change.
Most callers of mmc_switch_part() wish to permanently switch the default
MMC block device's HW partition. Enhance mmc_switch_part() so that it does
this. This removes the need for callers to do this. However,
common/env_mmc.c needs to save and restore the current HW partition. Make
it do this more explicitly.
Replace use of mmc_switch_part() with mmc_select_hwpart() in order to
remove duplicate code that skips the call if that HW partition is already
selected.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/mmc.h | 1 | ||||
-rw-r--r-- | include/part.h | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/include/mmc.h b/include/mmc.h index 9254b71..465daeb 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -364,7 +364,6 @@ struct mmc { u8 part_attr; u8 wr_rel_set; char part_config; - char part_num; uint tran_speed; uint read_bl_len; uint write_bl_len; diff --git a/include/part.h b/include/part.h index 8396ed1..4d00e22 100644 --- a/include/part.h +++ b/include/part.h @@ -18,6 +18,7 @@ struct block_dev_desc { unsigned char part_type; /* partition type */ unsigned char target; /* target SCSI ID */ unsigned char lun; /* target LUN */ + unsigned char hwpart; /* HW partition, e.g. for eMMC */ unsigned char type; /* device type */ unsigned char removable; /* removable device */ #ifdef CONFIG_LBA48 |