[PATCH 2/9] mci: core: add cbx extraction function

Stefan Kerkmann s.kerkmann at pengutronix.de
Tue May 28 08:39:21 PDT 2024


The CBX field is only present for eMMC and designates the type:

00 - Device (Removable)
01 - BGA (Discrete embedded)
10 - POP
11 - Reserved

Signed-off-by: Stefan Kerkmann <s.kerkmann at pengutronix.de>
---
 drivers/mci/mci-core.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 07ac7dd512..2a71fdd39a 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1917,6 +1917,17 @@ static unsigned extract_mid(struct mci *mci)
 		return UNSTUFF_BITS(mci->cid, 120, 8);
 }
 
+/**
+ * Extract the CBX from the CID
+ * @param mci Instance data
+ *
+ * The 'CBX' is encoded in bit 113:112 in the CID and only present in MMC cards
+ */
+static unsigned extract_cbx(struct mci *mci)
+{
+	return UNSTUFF_BITS(mci->cid, 112, 2);
+}
+
 /**
  * Extract the OEM/Application ID from the CID
  * @param mci Instance data

-- 
2.39.2




More information about the barebox mailing list