Skip to contentSkip to conversation

mmc: atmel-mci: enable 8 bits buswidth support

PATCH In review Nicolas Ferre 3 participants 3 messages Jan 29, 2019 – Jan 30, 2019

Subsystems (3)
lore
Share & tools
lore

Nicolas Ferre

author maintainer
#0 lore raw

PATCH 1/1 mmc: atmel-mci: enable 8 bits buswidth support

This patch adds support for 8-bit buswidth.
Relevant SDCR value modified.

---
 drivers/mmc/host/atmel-mci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mmc/host/atmel-mci.c +7 -1
index 47189f9ed4e2..735aa5871358 100644
@@ -1410,6 +1410,9 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	case MMC_BUS_WIDTH_4:
 		slot->sdc_reg |= ATMCI_SDCBUS_4BIT;
 		break;
+	case MMC_BUS_WIDTH_8:
+		slot->sdc_reg |= ATMCI_SDCBUS_8BIT;
+		break;
 	}
 
 	if (ios->clock) {
@@ -2275,8 +2278,11 @@ static int atmci_init_slot(struct atmel_mci *host,
 	 * use only one bit for data to prevent fifo underruns and overruns
 	 * which will corrupt data.
 	 */
-	if ((slot_data->bus_width >= 4) && host->caps.has_rwproof)
+	if ((slot_data->bus_width >= 4) && host->caps.has_rwproof) {
 		mmc->caps |= MMC_CAP_4_BIT_DATA;
+		if (slot_data->bus_width >= 8)
+			mmc->caps |= MMC_CAP_8_BIT_DATA;
+	}
 
 	if (atmci_get_version(host) < 0x200) {
 		mmc->max_segs = 256;
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Nicolas Ferre

This patch adds support for 8-bit buswidth.
Relevant SDCR value modified.

Quoted 34 lines
---
 drivers/mmc/host/atmel-mci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mmc/host/atmel-mci.c +7 -1
index 47189f9ed4e2..735aa5871358 100644
@@ -1410,6 +1410,9 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	case MMC_BUS_WIDTH_4:
 		slot->sdc_reg |= ATMCI_SDCBUS_4BIT;
 		break;
+	case MMC_BUS_WIDTH_8:
+		slot->sdc_reg |= ATMCI_SDCBUS_8BIT;
+		break;
 	}
 
 	if (ios->clock) {
@@ -2275,8 +2278,11 @@ static int atmci_init_slot(struct atmel_mci *host,
 	 * use only one bit for data to prevent fifo underruns and overruns
 	 * which will corrupt data.
 	 */
-	if ((slot_data->bus_width >= 4) && host->caps.has_rwproof)
+	if ((slot_data->bus_width >= 4) && host->caps.has_rwproof) {
 		mmc->caps |= MMC_CAP_4_BIT_DATA;
+		if (slot_data->bus_width >= 8)
+			mmc->caps |= MMC_CAP_8_BIT_DATA;
+	}
 
 	if (atmci_get_version(host) < 0x200) {
 		mmc->max_segs = 256;
Signature · 1 line
2.17.1
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
In reply to Nicolas Ferre
Quoted 5 lines · Nicolas Ferre

This patch adds support for 8-bit buswidth.
Relevant SDCR value modified.

Applied for next, thanks!

Kind regards
Uffe

Quoted 34 lines
---
 drivers/mmc/host/atmel-mci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mmc/host/atmel-mci.c +7 -2
index 47189f9ed4e2..735aa5871358 100644
@@ -1410,6 +1410,9 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        case MMC_BUS_WIDTH_4:
                slot->sdc_reg |= ATMCI_SDCBUS_4BIT;
                break;
+       case MMC_BUS_WIDTH_8:
+               slot->sdc_reg |= ATMCI_SDCBUS_8BIT;
+               break;
        }
 
        if (ios->clock) {
@@ -2275,8 +2278,11 @@ static int atmci_init_slot(struct atmel_mci *host,
         * use only one bit for data to prevent fifo underruns and overruns
         * which will corrupt data.
         */
-       if ((slot_data->bus_width >= 4) && host->caps.has_rwproof)
+       if ((slot_data->bus_width >= 4) && host->caps.has_rwproof) {
                mmc->caps |= MMC_CAP_4_BIT_DATA;
+               if (slot_data->bus_width >= 8)
+                       mmc->caps |= MMC_CAP_8_BIT_DATA;
+       }
 
        if (atmci_get_version(host) < 0x200) {
                mmc->max_segs = 256;
--

2.17.1