Page 1 of 1

U-Boot Doesn't Appear to Set eMMC mmc.hc_wp_grp_size

Posted: Wed Jul 26, 2017 8:03 pm
by PeterT
I'm attempting to set the user partition of an eMMC chip on a custom board to enhanced mode, but am unable to because the hc_wp_grp_size field of the mmc struct appears to never get set but is checked in drivers/mmc/mmc.c:675 in order to change the HW partitions.

Re: U-Boot Doesn't Appear to Set eMMC mmc.hc_wp_grp_size

Posted: Thu Jul 27, 2017 9:04 pm
by blue_z
PeterT wrote:I'm attempting to set the user partition of an eMMC chip on a custom board to enhanced mode, but am unable to because the hc_wp_grp_size field of the mmc struct appears to never get set but is checked in drivers/mmc/mmc.c:675 in order to change the HW partitions.
Your run-on sentence omits salient information such as the U-Boot version, specifics of the eMMC in use, and the proven functionality of this "custom board".

Your title is an assertion that is not supported by anything that you have written.
Apparently you're seeing a message, and located the code that generates it.
Have you investigated any further than that?

Just because the hc_wp_grp_size member (it's not a "field") is zero is not a basis for assuming that "it never get(s) set".
In fact there is an assignment in mmc_startup():

Code: Select all

			        mmc->hc_wp_grp_size = 1024
			                * ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]
			                * ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
In the event that either multiplier for high-capacity group sizes is zero, then the product would be zero.
But have you verified these eMMC attributes?

However this assignment has a conditional:

Code: Select all

			if (!IS_SD(mmc) && (mmc->version >= MMC_VERSION_4)) {
If your eMMC did not respond as a version 4 or later device (preferably >= 4.41), then U-Boot may be performing as expected.

Regards