diff mbox series

[U-Boot,3/3] rockchip: sdhci: support 8bit bus-width

Message ID 1522087150-21556-4-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Commit 6837c58666165b7b040bf5a5b9dfebc8354f5883
Delegated to: Philipp Tomsich
Headers show
Series rockchip: Improve SDHCI throughput on the RK3399-Q7 (puma-rk3399) | expand

Commit Message

Philipp Tomsich March 26, 2018, 5:59 p.m. UTC
The Rockchip-specific SDHCI wrapper does not process the 'bus-width'
property in the SDHCI node. Consequently, the bus is always kept in
4bit mode, even if 8bit wide operation is available, supported and
requested in the DTS.

This change adds processing of the 'bus-width' property and sets the
host capability flag for an 8bit wide bus, if set to 8. As the logic
in sdhci.c does not support clearing the 4bit capability, we assume
that 4bit operation is always supported.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

---

 drivers/mmc/rockchip_sdhci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Philipp Tomsich March 28, 2018, 9:47 p.m. UTC | #1
> The Rockchip-specific SDHCI wrapper does not process the 'bus-width'
> property in the SDHCI node. Consequently, the bus is always kept in
> 4bit mode, even if 8bit wide operation is available, supported and
> requested in the DTS.
> 
> This change adds processing of the 'bus-width' property and sets the
> host capability flag for an 8bit wide bus, if set to 8. As the logic
> in sdhci.c does not support clearing the 4bit capability, we assume
> that 4bit operation is always supported.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  drivers/mmc/rockchip_sdhci.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

Applied to u-boot-rockchip, thanks!
diff mbox series

Patch

diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index be6edb2..ab89be4 100644
--- a/drivers/mmc/rockchip_sdhci.c
+++ b/drivers/mmc/rockchip_sdhci.c
@@ -62,6 +62,13 @@  static int arasan_sdhci_probe(struct udevice *dev)
 
 	host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD;
 	host->max_clk = max_frequency;
+	/*
+	 * The sdhci-driver only supports 4bit and 8bit, as sdhci_setup_cfg
+	 * doesn't allow us to clear MMC_MODE_4BIT.  Consequently, we don't
+	 * check for other bus-width values.
+	 */
+	if (host->bus_width == 8)
+		host->host_caps |= MMC_MODE_8BIT;
 
 	ret = sdhci_setup_cfg(&plat->cfg, host, 0, EMMC_MIN_FREQ);
 
@@ -82,6 +89,7 @@  static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 
 	host->name = dev->name;
 	host->ioaddr = dev_read_addr_ptr(dev);
+	host->bus_width = dev_read_u32_default(dev, "bus-width", 4);
 #endif
 
 	return 0;