From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/7] mmc: check correctness of the voltage mask in ocr
Date: Mon, 4 Apr 2011 15:09:42 +0200 [thread overview]
Message-ID: <1301922585-8144-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1301922585-8144-1-git-send-email-s.hauer@pengutronix.de>
Most cards do not answer if some reserved bits
in the ocr are set. However, some controllers
can set bit 7 (reserved for low voltages), but
how to manage low voltages SD card is not yet
specified.
based on the original U-Boot patch from
Stefano Babic <sbabic@denx.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mci/mci-core.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 0137152..f3d975d 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -215,6 +215,16 @@ static int sd_send_op_cond(struct device_d *mci_dev)
struct mci_cmd cmd;
int timeout = 1000;
int err;
+ unsigned voltages;
+
+ /*
+ * Most cards do not answer if some reserved bits
+ * in the ocr are set. However, Some controller
+ * can set bit 7 (reserved for low voltages), but
+ * how to manage low voltages SD card is not yet
+ * specified.
+ */
+ voltages = host->voltages & 0xff8000;
do {
mci_setup_cmd(&cmd, MMC_CMD_APP_CMD, 0, MMC_RSP_R1);
@@ -225,7 +235,7 @@ static int sd_send_op_cond(struct device_d *mci_dev)
}
mci_setup_cmd(&cmd, SD_CMD_APP_SEND_OP_COND,
- host->voltages | (mci->version == SD_VERSION_2 ? OCR_HCS : 0),
+ voltages | (mci->version == SD_VERSION_2 ? OCR_HCS : 0),
MMC_RSP_R3);
err = mci_send_cmd(mci_dev, &cmd, NULL);
if (err) {
--
1.7.2.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-04-04 13:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 13:09 various fixes and updates Sascha Hauer
2011-04-04 13:09 ` [PATCH 1/7] arm: update mach-types Sascha Hauer
2011-04-04 13:09 ` [PATCH 2/7] driver: Do not forget to remove device from active list Sascha Hauer
2011-04-04 13:09 ` [PATCH 3/7] memcpy command: do not set read/write size Sascha Hauer
2011-04-04 13:09 ` Sascha Hauer [this message]
2011-04-04 13:09 ` [PATCH 5/7] fs: errno should be set correctly before the end of functions Sascha Hauer
2011-04-04 13:09 ` [PATCH 6/7] usbnet: do not initialize ethernet device from usb device Sascha Hauer
2011-04-04 13:09 ` [PATCH 7/7] ARM: Add missing parameter name Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301922585-8144-5-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox