Add SDHCI driver for Broadcom BRCMSTB/BMIPS Soc's
Subsystems (5)
Al Cooper
maintainerv3 cover Add SDHCI driver for Broadcom BRCMSTB/BMIPS Soc's
V3 - Don't add new QUIRKS to workaround Host Controller issues.
It turns out that all the issues could be solved by using SDHCI_QUIRK_MISSING_CAPS to supply modified "caps" and "caps1" Host Controller registers.
Al Cooper (2):
mmc: sdhci: Allow CAPS check for SDHCI_CAN_64BIT to use overridden
caps
mmc: sdhci-brcmstb: Add driver for Broadcom BRCMSTB SoCs
.../devicetree/bindings/mmc/sdhci-brcmstb.txt | 40 ++++++ MAINTAINERS | 7 + drivers/mmc/host/Kconfig | 11 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-brcmstb.c | 154 +++++++++++++++++++++ drivers/mmc/host/sdhci.c | 2 +- 6 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-brcmstb.txt create mode 100644 drivers/mmc/host/sdhci-brcmstb.c
Signature · 1 line
1.9.0.138.g2de3478
Al Cooper
maintainerPATCH v3 1/2 mmc: sdhci: Allow CAPS check for SDHCI_CAN_64BIT to use overridden caps
sdhci_add_host() allows the Host Controller Capability registers to be supplied by the calling driver by using SDHCI_QUIRK_MISSING_CAPS, but the check for the Capabilities bit SDHCI_CAN_64BIT doesn't use the applied value and instead reads the Host register directly. This change uses the supplied "caps" register instead of reading the host register.
This change will allow a calling driver to simply clear the SDHCI_CAN_64BIT bit in "caps" to handle some cases of SDHCI_QUIRK2_BROKEN_64_BIT_DMA.
--- drivers/mmc/host/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +1 -1
@@ -2926,7 +2926,7 @@ int sdhci_add_host(struct sdhci_host *host)* SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to * implement. */ -if (sdhci_readl (host,SDHCI_CAPABILITIES ) &SDHCI_CAN_64BIT ) +if (caps[0 ] &SDHCI_CAN_64BIT ) host->flags |=SDHCI_USE_64_BIT_DMA ;if (host->flags & (SDHCI_USE_SDMA |SDHCI_USE_ADMA )) {
Signature · 1 line
1.9.0.138.g2de3478
Re: [PATCH V3 1/2] mmc: sdhci: Allow CAPS check for SDHCI_CAN_64BIT to use overridden caps
Quoted 22 lines · Al Cooper
sdhci_add_host()allows the Host Controller Capability registers to be supplied by the calling driver by usingSDHCI_QUIRK_MISSING_CAPS, but the check for the Capabilities bitSDHCI_CAN_64BITdoesn't use the applied value and instead reads the Host register directly. This change uses the supplied "caps" register instead of reading the host register.This change will allow a calling driver to simply clear the
SDHCI_CAN_64BITbit in "caps" to handle some cases ofSDHCI_QUIRK2_BROKEN_64_BIT_DMA.Signed-off-by Al Cooper <[email protected]>--- drivers/mmc/host/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/host/sdhci.c +0
-0
drivers/mmc/host/sdhci.c int sdhci_add_host(struct sdhci_host *host) · line 2932
Quoted 8 lines
drivers/mmc/host/sdhci.c +1
-1@@ -2926,7 +2926,7 @@ int sdhci_add_host(struct sdhci_host *host)* SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to * implement. */ -if (sdhci_readl (host,SDHCI_CAPABILITIES ) &SDHCI_CAN_64BIT ) +if (caps[0 ] &SDHCI_CAN_64BIT ) host->flags |=SDHCI_USE_64_BIT_DMA ;if (host->flags & (SDHCI_USE_SDMA |SDHCI_USE_ADMA )) {
Ulf Hansson
AppliedRe: [PATCH V3 1/2] mmc: sdhci: Allow CAPS check for SDHCI_CAN_64BIT to use overridden caps
In reply to Al CooperQuoted 7 lines · Al Cooper
sdhci_add_host()allows the Host Controller Capability registers to be supplied by the calling driver by usingSDHCI_QUIRK_MISSING_CAPS, but the check for the Capabilities bitSDHCI_CAN_64BITdoesn't use the applied value and instead reads the Host register directly. This change uses the supplied "caps" register instead of reading the host register.
Quoted 5 lines
This change will allow a calling driver to simply clear the
SDHCI_CAN_64BITbit in "caps" to handle some cases ofSDHCI_QUIRK2_BROKEN_64_BIT_DMA.Signed-off-by Al Cooper <[email protected]>
Thanks, applied for next!
Kind regards
Uffe
Quoted 20 lines
--- drivers/mmc/host/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/host/sdhci.c +1
-2@@ -2926,7 +2926,7 @@ int sdhci_add_host(struct sdhci_host *host)* SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to * implement. */ -if (sdhci_readl (host,SDHCI_CAPABILITIES ) &SDHCI_CAN_64BIT ) +if (caps[0 ] &SDHCI_CAN_64BIT ) host->flags |=SDHCI_USE_64_BIT_DMA ;if (host->flags & (SDHCI_USE_SDMA |SDHCI_USE_ADMA )) { --1.9.0.138.g2de3478
Al Cooper
maintainerPATCH v3 2/2 mmc: sdhci-brcmstb: Add driver for Broadcom BRCMSTB SoCs
In reply to Al Cooper--- .../devicetree/bindings/mmc/sdhci-brcmstb.txt | 40 ++++++ MAINTAINERS | 7 + drivers/mmc/host/Kconfig | 11 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-brcmstb.c | 154 +++++++++++++++++++++ 5 files changed, 213 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-brcmstb.txt create mode 100644 drivers/mmc/host/sdhci-brcmstb.c
Documentation/devicetree/bindings/mmc/sdhci-brcmstb.txt new file +40 -0
@@ -0,0 +1,40 @@ +* BROADCOM BRCMSTB/BMIPS SDHCI Controller + +This file documents differences between the core properties in mmc.txt +and the properties used by the sdhci-brcmstb driver. + +Required properties: +- compatible: "brcm,sdhci-brcmstb" + +Optional properties: +- broken-sdr50: The Host Controller's SDR50 mode is broken. +- broken-ddr50: The Host Controller's DDR50 mode is broken. +- broken-64-bit-dma: 64 BIT DMA mode is broken, use 32 BIT DMA. +- broken-timeout-value: The Host Controller CAPABILITY timeout value is incorrrect, use the maximum timeout. + + +Example: + + sdhci@f03e0100 { + compatible = "brcm,sdhci-brcmstb"; + reg = <0xf03e0000 0x100>; + interrupts = <0x0 0x26 0x0>; + interrupt-names = "sdio0_0"; + sdhci,auto-cmd12; + clocks = <0x13>; + clock-names = "sw_sdio"; + broken-sdr50; + }; + + sdhci@f03e0300 { + no-1-8-v; + non-removable; + bus-width = <0x8>; + compatible = "brcm,sdhci-brcmstb"; + reg = <0xf03e0200 0x100>; + interrupts = <0x0 0x27 0x0>; + interrupt-names = "sdio1_0"; + sdhci,auto-cmd12; + clocks = <0x13>; + clock-names = "sw_sdio"; + };
MAINTAINERS +7 -0
@@ -9724,6 +9724,13 @@ F: tools/testing/selftests/seccomp/* K: \bsecure_computing K: \bTIF_SECCOMP\b +SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) Broadcom BRCMSTB DRIVER +M: Al Cooper <[email protected]> +L: [email protected] +L: [email protected] +S: Maintained +F: drivers/mmc/host/sdhci-brcmstb* + SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER M: Ben Dooks <[email protected]> M: Jaehoon Chung <[email protected]>
drivers/mmc/host/Kconfig +11 -0
@@ -797,3 +797,14 @@ config MMC_SDHCI_MICROCHIP_PIC32 If you have a controller with this interface, say Y or M here. If unsure, say N. +config MMC_SDHCI_BRCMSTB + tristate "Broadcom SDIO/SD/MMC support" + depends on ARCH_BRCMSTB || BMIPS_GENERIC + depends on MMC_SDHCI_PLTFM + default y + select MMC_SDHCI_IO_ACCESSORS + help + This selects support for the SDIO/SD/MMC Host Controller on + Broadcom STB SoCs. + + If unsure, say Y.
drivers/mmc/host/Makefile +1 -0
@@ -76,6 +76,7 @@ obj-$(CONFIG_MMC_SDHCI_IPROC) += sdhci-iproc.o obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o +obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o ifeq ($(CONFIG_CB710_DEBUG),y) CFLAGS-cb710-mmc += -DDEBUG
drivers/mmc/host/sdhci-brcmstb.c new file +154 -0
154 lines not on this page · raw message
Signature · 1 line
1.9.0.138.g2de3478