[PATCH 3/3] mci: detect SD card v3
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Mar 2 08:37:42 PST 2026
We define the constant and the erase group determination code queries
the version, but we didn't actually set it anywhere.
The code determining the SD version was taken from U-Boot, so sync it to
add v3.0 support[1].
[1]: https://github.com/u-boot/u-boot/blob/v2026.04-rc3/drivers/mmc/mmc.c#L1430
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/mci/mci-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 517e4de1c6b0..ef5c4c5d6a5d 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -977,6 +977,8 @@ static int sd_change_freq(struct mci *mci)
break;
case 2:
mci->version = SD_VERSION_2;
+ if ((mci->scr[0] >> 15) & 0x1)
+ mci->version = SD_VERSION_3;
break;
default:
mci->version = SD_VERSION_1_0;
--
2.47.3
More information about the barebox
mailing list