]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: Read sd card detect properties from DT
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Tue, 25 Jun 2019 11:39:02 +0000 (13:39 +0200)
committerPeng Fan <peng.fan@nxp.com>
Mon, 15 Jul 2019 02:16:49 +0000 (10:16 +0800)
This patch reads card detect properties from device tree &
added mmc capability macros in mmc.h.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mmc/mmc-uclass.c
include/mmc.h

index a9c8f335c142de56df370660986347652a51c66c..fa4d1af55d61cb0698c3478ec737f449cb67976b 100644 (file)
@@ -171,6 +171,15 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
        if (dev_read_bool(dev, "mmc-hs400-1_2v"))
                cfg->host_caps |= MMC_CAP(MMC_HS_400);
 
+       if (dev_read_bool(dev, "non-removable")) {
+               cfg->host_caps |= MMC_CAP_NONREMOVABLE;
+       } else {
+               if (dev_read_bool(dev, "cd-inverted"))
+                       cfg->host_caps |= MMC_CAP_CD_ACTIVE_HIGH;
+               if (dev_read_bool(dev, "broken-cd"))
+                       cfg->host_caps |= MMC_CAP_NEEDS_POLL;
+       }
+
        return 0;
 }
 
index 1f30f71d25f8cda5ac77f6a6a9ca07fe9ed38d51..2be3e91fcb58e8bcb9117ac8c1923053689857c4 100644 (file)
 #define MMC_MODE_HS200         MMC_CAP(MMC_HS_200)
 #define MMC_MODE_HS400         MMC_CAP(MMC_HS_400)
 
+#define MMC_CAP_NONREMOVABLE   BIT(14)
+#define MMC_CAP_NEEDS_POLL     BIT(15)
+#define MMC_CAP_CD_ACTIVE_HIGH  BIT(16)
+
 #define MMC_MODE_8BIT          BIT(30)
 #define MMC_MODE_4BIT          BIT(29)
 #define MMC_MODE_1BIT          BIT(28)