Thread (15 messages) 15 messages, 4 authors, 2016-09-22

Re: [PATCH v3 4/6] mmc: tmio: add eMMC support

From: Wolfram Sang <hidden>
Date: 2016-09-21 06:07:36
Also in: linux-renesas-soc

On Tue, Sep 20, 2016 at 06:35:00PM +0900, Jaehoon Chung wrote:
On 09/20/2016 05:57 AM, Wolfram Sang wrote:
quoted
We need to add R1 without CRC support, refactor the bus width routine a
little and extend a quirk check. To support "non-removable;" we need a
workaround which will be hopefully removed when reworking PM soon.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/tmio_mmc.h     |  3 +++
 drivers/mmc/host/tmio_mmc_pio.c | 38 ++++++++++++++++++++++++++------------
 2 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 4b501f2d529f6e..637581faf756b1 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -79,6 +79,9 @@
 #define	CLK_CTL_DIV_MASK	0xff
 #define	CLK_CTL_SCLKEN		BIT(8)
 
+#define CARD_OPT_WIDTH8		BIT(13)
+#define CARD_OPT_WIDTH		BIT(15)
Just confusing whether CARD_OPT_WIDTH is 4bit or 1bit?
The HW is confusing. Setting the bit sets 1-bit mode. This is why I put
the comment below in the code:
quoted
+	u16 reg = sd_ctrl_read16(host, CTL_SD_MEM_CARD_OPT)
+				& ~(CARD_OPT_WIDTH | CARD_OPT_WIDTH8);
+
+	/* reg now applies to MMC_BUS_WIDTH_4 */
This comment I meant ^^^
quoted
+	if (bus_width == MMC_BUS_WIDTH_1)
+		reg |= CARD_OPT_WIDTH;
...
quoted
 	switch (mmc_resp_type(cmd)) {
 	case MMC_RSP_NONE: c |= RESP_NONE; break;
-	case MMC_RSP_R1:   c |= RESP_R1;   break;
+	case MMC_RSP_R1:
+	case MMC_RSP_R1_NO_CRC:
+			   c |= RESP_R1;   break;
Just wonder..It there case that hit "case MMC_RSP_R1_NO_CRC" ?
Yes, as described in my response to patch 1. It doesn't work without.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help