Skip to contentSkip to conversation

mmc: sdhci: Enable 8-bit bus width only for 3.0 spec onwards

U-Boot Jagannadha Sutradharudu Teki 3 participants 3 messages May 27, 2013 – Jun 7, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Request for an update on this.

Thanks,
Jagan.

Quoted 53 lines

-----Original Message-----
From: Jagannadha Sutradharudu Teki [mailto:jagannadha.sutradharudu- teki at xilinx.com]
Sent: 21 May 2013 15:02
To: u-boot at lists.denx.de
Cc: monstr at monstr.eu; Andy Fleming; Jagannadha Sutradharudu Teki
Subject: [U-BOOT] mmc: sdhci: Enable 8-bit bus width only for 3.0 spec onwards

CAP register don't have any information for 8-bit buswidth support on 2.0 sdhci spec, only from 3.0 onwards bit[18] got this information.

Due to this misassignment in sdhci, mmc is setting 8-bit buswidth using mmc_set_bus_width even if controller doesn't support.
Below change has code information.
"mmc: Properly determine maximum supported bus width"
(sha1: 7798f6dbd5e1a3030ed81a81da5dfb57c3307cac)

Bug log: <mmc plus and emmc cards)
-------
zynq-uboot> mmcinfo
Error detected in status(0x208100)!
Device: zynq_sdhci
Manufacturer ID: fe
.....

So enable 8-bit support only for 3.0 spec using CAP and for below 3.0 assign mmc->host_caps = MMC_MODE_8BIT on respective platform driver if host have a support.

---
 drivers/mmc/sdhci.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/sdhci.c index 1eaea04..c5631bf renamed from drivers/mmc/sdhci.c +0 -0

100644

drivers/mmc/sdhci.c +4 -2
@@ -486,8 +486,10 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk,
 u32 min_clk)
              mmc->voltages |= host->voltages;
 
      mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
 MMC_MODE_4BIT;
-     if (caps & SDHCI_CAN_DO_8BIT)
-             mmc->host_caps |= MMC_MODE_8BIT;
+     if ((host->version & SDHCI_SPEC_VER_MASK) >= SDHCI_SPEC_300) {
+             if (caps & SDHCI_CAN_DO_8BIT)
+                     mmc->host_caps |= MMC_MODE_8BIT;
+     }
      if (host->host_caps)
              mmc->host_caps |= host->host_caps;
Quoted 3 lines

--
1.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

#2 lore raw

Any help on this, was this a useful fix.

Thanks,
Jagan.

Quoted 71 lines · Jagannadha Sutradharudu Teki

Request for an update on this.

Thanks,
Jagan.

Quoted 53 lines

-----Original Message-----
From: Jagannadha Sutradharudu Teki [mailto:jagannadha.sutradharudu- teki at xilinx.com]
Sent: 21 May 2013 15:02
To: u-boot at lists.denx.de
Cc: monstr at monstr.eu; Andy Fleming; Jagannadha Sutradharudu Teki
Subject: [U-BOOT] mmc: sdhci: Enable 8-bit bus width only for 3.0 spec onwards

CAP register don't have any information for 8-bit buswidth support on 2.0 sdhci spec, only from 3.0 onwards bit[18] got this information.

Due to this misassignment in sdhci, mmc is setting 8-bit buswidth using mmc_set_bus_width even if controller doesn't support.
Below change has code information.
"mmc: Properly determine maximum supported bus width"
(sha1: 7798f6dbd5e1a3030ed81a81da5dfb57c3307cac)

Bug log: <mmc plus and emmc cards)
-------
zynq-uboot> mmcinfo
Error detected in status(0x208100)!
Device: zynq_sdhci
Manufacturer ID: fe
.....

So enable 8-bit support only for 3.0 spec using CAP and for below 3.0 assign mmc->host_caps = MMC_MODE_8BIT on respective platform driver if host have a support.

---
 drivers/mmc/sdhci.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/sdhci.c index 1eaea04..c5631bf renamed from drivers/mmc/sdhci.c +0 -0

100644

drivers/mmc/sdhci.c +4 -2
@@ -486,8 +486,10 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk,
 u32 min_clk)
              mmc->voltages |= host->voltages;
 
      mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
 MMC_MODE_4BIT;
-     if (caps & SDHCI_CAN_DO_8BIT)
-             mmc->host_caps |= MMC_MODE_8BIT;
+     if ((host->version & SDHCI_SPEC_VER_MASK) >= SDHCI_SPEC_300) {
+             if (caps & SDHCI_CAN_DO_8BIT)
+                     mmc->host_caps |= MMC_MODE_8BIT;
+     }
      if (host->host_caps)
              mmc->host_caps |= host->host_caps;
Quoted 3 lines

--
1.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 3 lines
--
Thanks,
Jagan.
Reviewed-by
#3 lore raw

Hi,

Quoted 19 lines · Jagan Teki

Any help on this, was this a useful fix.

Thanks,
Jagan.

Quoted 12 lines · Jagannadha Sutradharudu Teki

Request for an update on this.

Thanks,
Jagan.

Quoted 7 lines

-----Original Message-----
From: Jagannadha Sutradharudu Teki [mailto:jagannadha.sutradharudu- teki at xilinx.com]
Sent: 21 May 2013 15:02
To: u-boot at lists.denx.de
Cc: monstr at monstr.eu; Andy Fleming; Jagannadha Sutradharudu Teki
Subject: [U-BOOT] mmc: sdhci: Enable 8-bit bus width only for 3.0 spec

Quoted 19 lines

onwards

Quoted 2 lines
Quoted 2 lines

CAP register don't have any information for 8-bit buswidth support on

2.0 sdhci

Quoted 14 lines
Quoted 14 lines

spec, only from 3.0 onwards bit[18] got this information.

Due to this misassignment in sdhci, mmc is setting 8-bit buswidth using mmc_set_bus_width even if controller doesn't support.
Below change has code information.
"mmc: Properly determine maximum supported bus width"
(sha1: 7798f6dbd5e1a3030ed81a81da5dfb57c3307cac)

Bug log: <mmc plus and emmc cards)
-------
zynq-uboot> mmcinfo
Error detected in status(0x208100)!
Device: zynq_sdhci
Manufacturer ID: fe

This seems like a reasonable patch to me. I don't have hardware to test it though, and have not looked up the spec.

Quoted 62 lines
Quoted 3 lines
Quoted 3 lines

.....

So enable 8-bit support only for 3.0 spec using CAP and for below 3.0

assign

Quoted 1 line
Quoted 1 line

mmc->host_caps = MMC_MODE_8BIT on respective platform driver if host

have

Quoted 8 lines

drivers/mmc/sdhci.c index

Quoted 8 lines

a support.

---
 drivers/mmc/sdhci.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

1eaea04..c5631bf

Quoted 18 lines
Quoted 18 lines

100644

drivers/mmc/sdhci.c +4 -2
@@ -486,8 +486,10 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk,
 u32 min_clk)
              mmc->voltages |= host->voltages;
 
      mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
 MMC_MODE_4BIT;
-     if (caps & SDHCI_CAN_DO_8BIT)
-             mmc->host_caps |= MMC_MODE_8BIT;
+     if ((host->version & SDHCI_SPEC_VER_MASK) >= SDHCI_SPEC_300) {
+             if (caps & SDHCI_CAN_DO_8BIT)
+                     mmc->host_caps |= MMC_MODE_8BIT;
+     }
      if (host->host_caps)
              mmc->host_caps |= host->host_caps;
Quoted 7 lines
Quoted 3 lines

--
1.7.4

This email and any attachments are intended for the sole use of the

named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

Quoted 6 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

--
--
Thanks,
Jagan.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot