summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2017-09-20 17:50:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-09-26 08:53:08 +0200
commitb5289b742a890a31e8b3fc1706774514dcbe1238 (patch)
tree71c27c6681610ca3b9da8be4725cd6e5610b3284 /drivers
parent25e67cbb2fce8690bcde07598ad4998aad475f13 (diff)
downloadbarebox-b5289b742a890a31e8b3fc1706774514dcbe1238.tar.gz
barebox-b5289b742a890a31e8b3fc1706774514dcbe1238.tar.xz
mmc: allow skipping SD card initialization
This patch allows to skip SD card initialization for eMMCs by setting the "no-sd" property in the host controller device tree node. Avoiding two SD command timeouts speeds up detection time by well over 200 ms. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mci/mci-core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 07911d43d7..208b7666d6 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1682,10 +1682,13 @@ static int mci_card_probe(struct mci *mci)
}
/* Check if this card can handle the "SD Card Physical Layer Specification 2.0" */
- rc = sd_send_if_cond(mci);
- rc = sd_send_op_cond(mci);
- if (rc && rc == -ETIMEDOUT) {
- /* If the command timed out, we check for an MMC card */
+ if (!host->no_sd) {
+ rc = sd_send_if_cond(mci);
+ rc = sd_send_op_cond(mci);
+ }
+ if (host->no_sd || rc == -ETIMEDOUT) {
+ /* If SD card initialization was skipped or if it timed out,
+ * we check for an MMC card */
dev_dbg(&mci->dev, "Card seems to be a MultiMediaCard\n");
rc = mmc_send_op_cond(mci);
}
@@ -1904,6 +1907,7 @@ void mci_of_parse_node(struct mci_host *host,
}
host->non_removable = of_property_read_bool(np, "non-removable");
+ host->no_sd = of_property_read_bool(np, "no-sd");
}
void mci_of_parse(struct mci_host *host)