On 26/02/25 07:37PM, Peng Fan (OSS) wrote:
> Hi Han,
>
> > Subject: [PATCH] mmc: Add support for eMMC 5.1B specification
> >
> > Add support for eMMC specification version 5.1B by defining
> > MMC_VERSION_5_1B and including it in the version array.
> >
> > eMMC 5.1B (JESD84-B51B) is a minor revision of the 5.1 specification
> > that primarily addresses MDT (Manufacturing Date) adjustment for
> > dates beyond 2025. This aligns with the Linux kernel commit
> > 9996707822f82
> > ("mmc: core: Adjust MDT beyond 2025").
> >
> > Since the manufacturing date field is not currently used in U-Boot, this
> > change has no functional impact beyond proper device recognition.
> > It allows the driver to correctly identify and initialize eMMC devices
> > that report version 5.1B in their Extended CSD register.
> >
> > Signed-off-by: Han Xu <[email protected]>
> > ---
> > drivers/mmc/mmc.c | 3 ++-
> > include/mmc.h | 1 +
> > 2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> > c5705f4f215..f0e38efb262 100644
> > --- a/drivers/mmc/mmc.c
> > +++ b/drivers/mmc/mmc.c
> > @@ -2343,7 +2343,8 @@ static int mmc_startup_v4(struct mmc
> > *mmc)
> > MMC_VERSION_4_41,
> > MMC_VERSION_4_5,
> > MMC_VERSION_5_0,
> > - MMC_VERSION_5_1
> > + MMC_VERSION_5_1,
> > + MMC_VERSION_5_1B
> > };
> >
> > #if CONFIG_IS_ENABLED(MMC_TINY)
> > diff --git a/include/mmc.h b/include/mmc.h index
> > 51d3f2f8dd5..9509c9e9543 100644
> > --- a/include/mmc.h
> > +++ b/include/mmc.h
> > @@ -54,6 +54,7 @@ struct bd_info;
> > #define MMC_VERSION_4_5 MAKE_MMC_VERSION(4, 5,
> > 0)
> > #define MMC_VERSION_5_0 MAKE_MMC_VERSION(5, 0,
> > 0)
> > #define MMC_VERSION_5_1 MAKE_MMC_VERSION(5, 1,
> > 0)
> > +#define MMC_VERSION_5_1B MAKE_MMC_VERSION(5, 1, 0xB)
>
> https://lore.kernel.org/u-boot/[email protected]/
>
> I have same question here.
>
> Thanks,
> Peng
Yes, I met the issue when testing Samsung KLMBG1REWF-B04Q eMMC, the mmc info
command showed nothing and return error, because the mmc initialization failed
at mmc_startup_v4() function when checking the version array.
With the code change, the mmc device can be recognized and worked properly.
u-boot=> mmc info
Device: FSL_SDHC
Manufacturer ID: 15
OEM: 0
Name: BRWF4R
Bus Speed: 200000000
Mode: HS400ES (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.8 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 16 MiB
User Capacity: 29.8 GiB WRREL
Boot Capacity: 31.9 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
>
> >
> > #define MMC_CAP(mode) (1 << mode)
> > #define MMC_MODE_HS (MMC_CAP(MMC_HS) |
> > MMC_CAP(SD_HS))
> > --
> > 2.34.1
>