provide names for emmc hardware partitions
Subsystems (5)
v4 cover provide names for emmc hardware partitions
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data Area
These are referenced by fields in the PARTITION_CONFIG register (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6: BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3: BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0 PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4
Note that setting PARTITION_ACCESS to 0x0 results in selecting the User Data Area partition.
You can see above that the two fields BOOT_PARTITION_ENABLE and PARTITION_ACCESS do not use the same enumerated values.
U-Boot uses a set of macros to access fields of the PARTITION_CONFIG register:
EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)
EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x) (((x) >> 6) & 0x1)EXT_CSD_EXTRACT_BOOT_PART(x) (((x) >> 3) & 0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x) ((x) & 0x7)
There are various places in U-Boot where the BOOT_PARTITION_ENABLE field is accessed via EXT_CSD_EXTRACT_PARTITION_ACCESS and converted to a hardware partition consistent with the definition of the PARTITION_ACCESS field used by the various mmc_switch incarnations.
To add some sanity to the distinction between BOOT_PARTITION_ENABLE (used to specify the active device on power-cycle) and PARTITION_ACCESS (used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc * part_config is used or the above macros are used.
Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to represent PARTITION_CONFIG fields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partition
arch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)
Signature · 1 line
2.25.1
PATCH RESEND v4 1/3 mmc: use an enumerated type to represent PARTITION_CONFIG fields
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data Area
These are referenced by fields in the PARTITION_CONFIG register (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6: BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3: BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0 PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4
Note that setting PARTITION_ACCESS to 0x0 results in selecting the User Data Area partition.
You can see above that the two fields BOOT_PARTITION_ENABLE and PARTITION_ACCESS do not use the same enumerated values.
U-Boot uses a set of macros to access fields of the PARTITION_CONFIG register:
There are various places in U-Boot where the BOOT_PARTITION_ENABLE field is accessed via EXT_CSD_EXTRACT_PARTITION_ACCESS and converted to a hardware partition consistent with the definition of the PARTITION_ACCESS field which is also the value used to specify the hardware partition of the various mmc_switch incarnations.
To add some sanity to the distinction between BOOT_PARTITION_ENABLE (used to specify the active device on power-cycle) and PARTITION_ACCESS (used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc * part_config is used or the above macros are used.
This represents no code changes.
---
v4: new patch (split to series)
--- arch/arm/mach-imx/image-container.c | 10 +++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 4 ++-- board/gateworks/venice/venice.c | 22 +++++++++++----------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- include/mmc.h | 20 ++++++++++++++++++++ 9 files changed, 47 insertions(+), 27 deletions(-)
arch/arm/mach-imx/image-container.c +5 -5
@@ -205,7 +205,7 @@ static unsigned long get_boot_device_offset(void *dev, int dev_type) }else {u8 part =EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config); -if (part ==1 || part ==2 ) { +if (part ==EMMC_BOOT_PART_BOOT1 || part ==EMMC_BOOT_PART_BOOT2 ) {if (is_imx8qxp () &&is_soc_rev (CHIP_REV_B )) offset =CONTAINER_HDR_MMCSD_OFFSET ;else
@@ -294,15 +294,15 @@ int spl_mmc_emmc_boot_partition(struct mmc *mmc)int part; part =EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config); -if (part ==1 || part ==2 ) { +if (part ==EMMC_BOOT_PART_BOOT1 || part ==EMMC_BOOT_PART_BOOT2 ) {unsigned long sec_set_off =0 ;bool sec_boot = false; sec_boot =check_secondary_cnt_set (&sec_set_off);if (sec_boot) - part = (part ==1 ) ?2 :1 ; - }else if (part ==7 ) { - part =0 ; + part = (part ==EMMC_BOOT_PART_BOOT1 ) ?EMMC_HWPART_BOOT2 :EMMC_HWPART_BOOT1 ; + }else if (part ==EMMC_BOOT_PART_USER ) { + part =EMMC_HWPART_DEFAULT ; }return part;
arch/arm/mach-sunxi/board.c +1 -1
@@ -396,7 +396,7 @@ static bool sunxi_valid_emmc_boot(struct mmc *mmc)return false;/* Partition 0 is the user data partition, bootpart must be 1 or 2. */ -if (bootpart !=1 && bootpart !=2 ) +if (bootpart !=EMMC_BOOT_PART_BOOT1 && bootpart !=EMMC_BOOT_PART_BOOT2 )return false;/* Failure to switch to the boot partition is fatal. */
board/gateworks/venice/spl.c +2 -2
@@ -353,8 +353,8 @@ unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long {if (!IS_SD (mmc)) {switch (EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config)) { -case 1 : -case 2 : +case EMMC_BOOT_PART_BOOT1 : +case EMMC_BOOT_PART_BOOT2 :if (IS_ENABLED (CONFIG_IMX8MN ) ||IS_ENABLED (CONFIG_IMX8MP )) raw_sect -=32 *2 ;break ;
board/gateworks/venice/venice.c +11 -11
@@ -173,20 +173,20 @@ int board_late_init(void)int bootpart;switch (EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config)) { -case 1 :/* boot0 */ - bootpart =1 ; +case EMMC_BOOT_PART_BOOT1 : + bootpart =EMMC_HWPART_BOOT1 ;break ; -case 2 :/* boot1 */ - bootpart =2 ; +case EMMC_BOOT_PART_BOOT2 : + bootpart =EMMC_HWPART_BOOT2 ;break ; -case 7 :/* user */ +case EMMC_BOOT_PART_USER :default : - bootpart =0 ; + bootpart =EMMC_HWPART_DEFAULT ;break ; }/* IMX8MP/IMX8MN BOOTROM v2 uses offset=0 for boot parts */ if ((IS_ENABLED (CONFIG_IMX8MN ) ||IS_ENABLED (CONFIG_IMX8MP )) && - (bootpart ==1 || bootpart ==2 )) + (bootpart ==EMMC_BOOT_PART_BOOT1 || bootpart ==EMMC_BOOT_PART_BOOT2 )) bootblk =0 ;env_set_hex ("bootpart" , bootpart);env_set_hex ("bootblk" , bootblk);
@@ -217,10 +217,10 @@ uint mmc_get_env_part(struct mmc *mmc) {if (!IS_SD (mmc)) {switch (EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config)) { -case 1 : -return 1 ; -case 2 : -return 2 ; +case EMMC_BOOT_PART_BOOT1 : +return EMMC_HWPART_BOOT1 ; +case EMMC_BOOT_PART_BOOT2 : +return EMMC_HWPART_BOOT2 ; } }
board/purism/librem5/librem5.c +2 -2
@@ -43,8 +43,8 @@ uint board_mmc_get_env_part(struct mmc *mmc) {uint part =EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config); -if (part ==7 ) - part =0 ; +if (part ==EMMC_BOOT_PART_USER ) + part =EMMC_HWPART_DEFAULT ;return part; }#endif
board/storopack/smegw01/smegw01.c +2 -2
@@ -106,8 +106,8 @@ uint mmc_get_env_part(struct mmc *mmc) {uint part =EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config); -if (part ==7 ) - part =0 ; +if (part ==EMMC_BOOT_PART_USER ) + part =EMMC_HWPART_DEFAULT ;return part; }
cmd/mvebu/bubt.c +2 -2
@@ -224,8 +224,8 @@ static int mmc_burn_image(size_t image_size)#endif part =EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config); -if (part ==7 ) - part =0 ; +if (part ==EMMC_BOOT_PART_USER ) + part =EMMC_HWPART_DEFAULT ;#ifdef CONFIG_BLK err =blk_dselect_hwpart (blk_desc, part);
common/spl/spl_mmc.c +2 -2
@@ -320,8 +320,8 @@ int default_spl_mmc_emmc_boot_partition(struct mmc *mmc)* which is the first physical partition (0). */ part =EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config); -if (part ==7 ) - part =0 ; +if (part ==EMMC_BOOT_PART_USER ) + part =EMMC_HWPART_DEFAULT ;#endif return part; }
include/mmc.h +20 -0
@@ -381,6 +381,26 @@ enum mmc_voltage {#define MMC_TIMING_MMC_HS200 9#define MMC_TIMING_MMC_HS400 10 +/* emmc PARTITION_CONFIG BOOT_PARTITION_ENABLE values */ +enum emmc_boot_part { +EMMC_BOOT_PART_DEFAULT =0 , +EMMC_BOOT_PART_BOOT1 =1 , +EMMC_BOOT_PART_BOOT2 =2 , +EMMC_BOOT_PART_USER =7 , +}; + +/* emmc PARTITION_CONFIG ACCESS_ENABLE values */ +enum emmc_hwpart { +EMMC_HWPART_DEFAULT =0 ,/* user */ +EMMC_HWPART_BOOT1 =1 , +EMMC_HWPART_BOOT2 =2 , +EMMC_HWPART_RPMB =3 , +EMMC_HWPART_GP1 =4 , +EMMC_HWPART_GP2 =5 , +EMMC_HWPART_GP3 =6 , +EMMC_HWPART_GP4 =7 , +}; +/* Driver model support */ /**
Signature · 1 line
2.25.1
PATCH RESEND v4 2/3 mmc: allow use of hardware partition names for mmc partconf
In reply to Tim HarveyeMMC v4+ devices have hardware partitions that are accessed via the PARTITION_CONFIG (Extended CSD Register 179) PARTITION_ACCESS and BOOT_PARTITION_ENABLE fields defined as:
bit 5:3: BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot
0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0 PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4
Add char arrays to provide names for these values.
Use these names which displaying or setting the PARTITION_CONFIG register via the 'mmc partconf' command.
Before:
u-boot=> mmc partconf 2 1 1 0 && mmc partconf 2
EXT_CSD[179], PARTITION_CONFIG:BOOT_ACK: 0x1BOOT_PARTITION_ENABLE: 0x2PARTITION_ACCESS: 0x0
After:
u-boot=> mmc partconf 2 1 1 0 && mmc partconf 2 EXT_CSD[179], PARTITION_CONFIG:BOOT_ACK: 0x1BOOT_PARTITION_ENABLE: 0x1 (boot0)PARTITION_ACCESS: 0x0 (user)
u-boot=> mmc partconf 2 1 boot1 0 && mmc partconf 2 EXT_CSD[179], PARTITION_CONFIG:BOOT_ACK: 0x1BOOT_PARTITION_ENABLE: 0x2 (boot1)PARTITION_ACCESS: 0x0 (user)
---
v4:
- split patch into series
- use static arrays so we can use ARRAY_SIZE when evaluating
- differentiate between PARTITION_CONFIG BOOT_PARTITION_ENABLE and PARTITION_ACCESS field values and meanings
v3:
- define partition names and values in mmc.h/mmc.c for others to use
v2:
- fix typo in subject
- add names for gp1..gp4
--- cmd/mmc.c | 27 +++++++++++++++++++++++---- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++++++++ include/mmc.h | 6 ++++++ 3 files changed, 64 insertions(+), 4 deletions(-)
cmd/mmc.c +23 -4
@@ -14,6 +14,7 @@#include <part.h> #include <sparse_format.h> #include <image-sparse.h> +#include <linux/ctype.h> static int curr_device =-1 ;
@@ -918,8 +919,9 @@ static int mmc_partconf_print(struct mmc *mmc, const char *varname)printf ("EXT_CSD[179], PARTITION_CONFIG:\n" "BOOT_ACK: 0x%x\n" -"BOOT_PARTITION_ENABLE: 0x%x\n" -"PARTITION_ACCESS: 0x%x\n" , ack, part, access); +"BOOT_PARTITION_ENABLE: 0x%x (%s)\n" +"PARTITION_ACCESS: 0x%x (%s)\n" , ack, part, emmc_boot_part_names[part], + access, emmc_hwpart_names[access]);return CMD_RET_SUCCESS ; }
@@ -948,9 +950,26 @@ static int do_mmc_partconf(struct cmd_tbl *cmdtp, int flag,if (argc ==2 || argc ==3 )return mmc_partconf_print (mmc,cmd_arg2 (argc, argv)); +/* BOOT_ACK */ ack =dectoul (argv[2 ],NULL ); - part_num =dectoul (argv[3 ],NULL ); - access =dectoul (argv[4 ],NULL ); +/* BOOT_PARTITION_ENABLE */ +if (!isdigit (*argv[3 ])) { +for (part_num =ARRAY_SIZE (emmc_boot_part_names) -1 ; part_num >0 ; part_num--) { +if (!strcmp (argv[3 ], emmc_boot_part_names[part_num])) +break ; + } + }else { + part_num =dectoul (argv[3 ],NULL ); + } +/* PARTITION_ACCESS */ +if (!isdigit (*argv[4 ])) { +for (access =ARRAY_SIZE (emmc_hwpart_names) -1 ; access >0 ; access--) { +if (!strcmp (argv[4 ], emmc_hwpart_names[access])) +break ; + } + }else { + access =dectoul (argv[4 ],NULL ); + }/* acknowledge to be sent during boot operation */ ret =mmc_set_part_conf (mmc, ack, part_num, access);
drivers/mmc/mmc.c +35 -0
@@ -29,6 +29,41 @@#define DEFAULT_CMD6_TIMEOUT_MS 500 +/** +* names of emmc BOOT_PARTITION_ENABLE values +* +* Boot Area Partitions - name consistent with Linux +*/ +const char *emmc_boot_part_names[] = { +"default" ,/* EMMC_BOOT_PART_DEFAULT */ +"boot0" ,/* EMMC_BOOT_PART_BOOT1 */ +"boot1" ,/* EMMC_BOOT_PART_BOOT2 */ +"" , +"" , +"" , +"" , +"user" ,/* EMMC_BOOT_PART_USER */ +}; + +/** +* names of emmc 'hardware partitions' consistent with: +* - value used in mmc_switch() +* - value used by PARTITION_CONFIG PARTITION_ACCESS field +* +* Boot Area Partitions - name consistent with Linux +* General Perpose Partitions - name consistent with 'mmc hwpartition' usage +*/ +const char *emmc_hwpart_names[] = { +"user" ,/* EMMC_HWPART_DEFAULT */ +"boot0" ,/* EMMC_HWPART_BOOT1 */ +"boot1" ,/* EMMC_HWPART_BOOT2 */ +"rpmb" ,/* EMMC_HWPART_RPMB */ +"gp1" ,/* EMMC_HWPART_GP1 */ +"gp2" ,/* EMMC_HWPART_GP2 */ +"gp3" ,/* EMMC_HWPART_GP3 */ +"gp4" ,/* EMMC_HWPART_GP4 */ +}; +static int mmc_set_signal_voltage (struct mmc *mmc,uint signal_voltage);#if !CONFIG_IS_ENABLED (DM_MMC )
include/mmc.h +6 -0
@@ -389,6 +389,9 @@ enum emmc_boot_part { EMMC_BOOT_PART_USER = 7, }; +/* emmc PARTITION_CONFIG BOOT_PARTITION_ENABLE names */ +extern const char *emmc_boot_part_names[8 ]; +/* emmc PARTITION_CONFIG ACCESS_ENABLE values */ enum emmc_hwpart {EMMC_HWPART_DEFAULT =0 ,/* user */
@@ -401,6 +404,9 @@ enum emmc_hwpart { EMMC_HWPART_GP4 = 7, }; +/* emmc PARTITION_CONFIG ACCESS_ENABLE names */ +extern const char *emmc_hwpart_names[8 ]; +/* Driver model support */ /**
Signature · 1 line
2.25.1
PATCH RESEND v4 3/3 venice: show emmc boot hardware partition
In reply to Tim HarveyTo aid in understanding what emmc hardware partition is being used to boot on power-up, display the hardware partition name in the SPL.
---
v4: new patch for this series
--- board/gateworks/venice/spl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
board/gateworks/venice/spl.c +12 -4
@@ -366,16 +366,24 @@ unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned longconst char *spl_board_loader_name (u32 boot_device) { +static char name[16 ]; +struct mmc *mmc; +switch (boot_device) {/* SDHC2 */ case BOOT_DEVICE_MMC1 : -return "eMMC" ; +mmc_init_device (0 ); + mmc =find_mmc_device (0 ); +mmc_init (mmc); +snprintf (name,sizeof (name),"eMMC %s" , emmc_hwpart_names[EXT_CSD_EXTRACT_BOOT_PART (mmc->part_config)]); +return name;/* SDHC3 */ case BOOT_DEVICE_MMC2 : -return "SD card" ; -default : -return NULL ; +sprintf (name,"SD card" ); +return name; } + +return NULL ; }void spl_board_init (void )
Signature · 1 line
2.25.1
Quoted 100 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS(used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionarch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)
Quoted 3 lines
--
2.25.1
Greetings,
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Best Regards,
Tim
Hello Tim,
Quoted 102 lines · Tim Harvey
Quoted 87 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS(used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionQuoted 13 lines
arch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)
Quoted 2 lines
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Any chances, please, to provide links to each of the patch and series versions on https://lore.kernel.org/u-boot/ , together with a brief changelog and history? I'm having troubles refreshing my memory on what patches were actually pulled into what series.
My guess is that other people would also benefit from such a refresher.
Quoted 116 lines · Dragan Simic
Hello Tim,
Quoted 109 lines · Tim Harvey
Quoted 93 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC
specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User
Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield
is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS
(used to switch between hardware partitions) create two enumerated types
and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded
from.I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionQuoted 13 lines
arch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)Quoted 2 lines
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Quoted 6 lines
Any chances, please, to provide links to each of the patch and series versions on https://lore.kernel.org/u-boot/ , together with a brief changelog and history? I'm having troubles refreshing my memory on what patches were actually pulled into what series.
My guess is that other people would also benefit from such a refresher.
Hi Dragan,
Yes, I should have done that. Here are the references:
- latest v4 series:
https://patchwork.ozlabs.org/project/uboot/list/?series=409052
(combined two patches into series)
- v3: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
- v2: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
- v1: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
- https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
- display emmc hardware partition for venice
Best Regards,
Tim
Quoted 101 lines · Tim Harvey
Quoted 100 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS(used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionarch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)
Quoted 8 lines
Quoted 3 lines
--
2.25.1Greetings,
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Jaehoon, will you have time to review and pick this up, now that the merge window is open? Thanks.
Signature · 1 line
Tom
Quoted 107 lines · Tom Rini
Quoted 105 lines · Tim Harvey
Quoted 103 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS(used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionarch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)--
2.25.1
Quoted 8 lines
Quoted 4 lines
Greetings,
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Jaehoon, will you have time to review and pick this up, now that the merge window is open? Thanks.
Hi Tom,
I have not seen any emails from Jaehoon on mainline lists since early May.
Best Regards,
Tim
Quoted 118 lines · Tim Harvey
Quoted 107 lines · Tom Rini
Quoted 105 lines · Tim Harvey
Quoted 103 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS(used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionarch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)--
2.25.1Quoted 8 lines
Quoted 4 lines
Greetings,
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Jaehoon, will you have time to review and pick this up, now that the merge window is open? Thanks.
Quoted 7 lines
Hi Tom,
I have not seen any emails from Jaehoon on mainline lists since early May.
Best Regards,
Tim
Hi Tom,
gentle ping here... not sure what you want me to do with this series.
Best Regards,
Tim
Quoted 123 lines · Tim Harvey
Quoted 122 lines · Tim Harvey
Quoted 107 lines · Tom Rini
Quoted 105 lines · Tim Harvey
Quoted 103 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data AreaThese are referenced by fields in the
PARTITION_CONFIGregister (Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6:BOOT_ACK
0x0: No boot acknowledge sent (default
0x1: Boot acknowledge sent during boot operation Bit
bit 5:3:BOOT_PARTITION_ENABLE
0x0: Device not boot enabled (default)
0x1: Boot Area partition 1 enabled for boot
0x2: Boot Area partition 2 enabled for boot 0x3-0x6: Reserved
0x7: User area enabled for boot
bit 2:0PARTITION_ACCESS
0x0: No access to boot partition (default)
0x1: Boot Area partition 1
0x2: Boot Area partition 2
0x3: Replay Protected Memory Block (RPMB)
0x4: Access to General Purpose partition 1
0x5: Access to General Purpose partition 2
0x6: Access to General Purpose partition 3
0x7: Access to General Purpose partition 4Note that setting
PARTITION_ACCESSto0x0results in selecting the User Data Area partition.You can see above that the two fields
BOOT_PARTITION_ENABLEandPARTITION_ACCESSdo not use the same enumerated values.U-Boot uses a set of macros to access fields of the
PARTITION_CONFIGregister:EXT_CSD_BOOT_ACK_ENABLE (1 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0)
EXT_CSD_EXTRACT_BOOT_ACK(x)(((x) >> 6) &0x1)EXT_CSD_EXTRACT_BOOT_PART(x)(((x) >> 3) &0x7)EXT_CSD_EXTRACT_PARTITION_ACCESS(x)((x) &0x7)There are various places in U-Boot where the
BOOT_PARTITION_ENABLEfield is accessed viaEXT_CSD_EXTRACT_PARTITION_ACCESSand converted to a hardware partition consistent with the definition of thePARTITION_ACCESSfield used by the variousmmc_switchincarnations.To add some sanity to the distinction between
BOOT_PARTITION_ENABLE(used to specify the active device on power-cycle) andPARTITION_ACCESS(used to switch between hardware partitions) create two enumerated types and use them wherever struct mmc *part_configis used or the above macros are used.Additionally provide arrays of the field names and allow those to be used in the 'mmc partconf' command and in board support files.
The first patch adds enumerated types and makes use of them which represents no compiled code change.
The 2nd patch adds the array of names and uses them in the 'mmc partconf' command.
The 3rd patch uses the array of hardware partition names in a board support file to show what emmc hardware partition U-Boot is being loaded from.
I'm sending this as a series this time around as previously it was repsented as two different patches.
Tim Harvey (3):
mmc: use an enumerated type to representPARTITION_CONFIGfields
mmc: allow use of hardware partition names for mmc partconf
venice: show emmc boot hardware partitionarch/arm/mach-imx/image-container.c | 10 ++++----- arch/arm/mach-sunxi/board.c | 2 +- board/gateworks/venice/spl.c | 20 ++++++++++++----- board/gateworks/venice/venice.c | 22 +++++++++--------- board/purism/librem5/librem5.c | 4 ++-- board/storopack/smegw01/smegw01.c | 4 ++-- cmd/mmc.c | 27 ++++++++++++++++++---- cmd/mvebu/bubt.c | 4 ++-- common/spl/spl_mmc.c | 4 ++-- drivers/mmc/mmc.c | 35 +++++++++++++++++++++++++++++ include/mmc.h | 26 +++++++++++++++++++++ 11 files changed, 123 insertions(+), 35 deletions(-)--
2.25.1Quoted 8 lines
Quoted 4 lines
Greetings,
Is there any feedback on this series? I got feedback from several people on my first attempt (cc'd) but nothing on this version.
Jaehoon, will you have time to review and pick this up, now that the merge window is open? Thanks.
Hi Tom,
I have not seen any emails from Jaehoon on mainline lists since early May.
Quoted 7 lines
Quoted 3 lines
Best Regards,
Tim
Hi Tom,
gentle ping here... not sure what you want me to do with this series.
OK, thanks for pinging, again. I'm taking a look at taking this to -next now. Sorry for the delay and thanks again for your patience and persistence.
Signature · 1 line
Tom
Quoted 11 lines · Tim Harvey
Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC specification described as:
Boot Area Partition 1
Boot Area Partition 2
RPMB Partition
General Purpose Partition 1
General Purpose Partition 2
General Purpose Partition 3
General Purpose Partition 4
User Data Area
Quoted 1 line
[...]
Applied to u-boot/next, thanks!
Signature · 1 line
Tom