Add SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller.
Subsystems (4)
cover Add SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller.
Due to the fact that the existing of-arasan driver works with 32-bit platforms. This patch tweaks existing of-arasan driver to work with 64-bit X-Gene platform using IOMMU translation.
---
Suman Tripathi (2):
mmc: host: arasan: Add addition of-arasan quirks and add IOMMU
support.
arm64: dts: Add APM X-Gene SDHCI DTS node.
arch/arm64/boot/dts/apm-storm.dtsi | 43 ++++++++++++++++++++++++++++++ drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-of-arasan.c | 54 ++++++++++++++++++++++++++++++++++++++ drivers/mmc/host/sdhci-pltfm.c | 12 +++++++++ 4 files changed, 110 insertions(+)
--
1.8.2.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1418662867-9210-1-git-send-email-stripathi-qTEPVZfXA3Y@public.gmane.org
PATCH 1/2 mmc: host: arasan: Add addition of-arasan quirks and add IOMMU support.
Due to the fact that the existing of-arasan driver works with 32-bit platforms. This patch tweaks existing of-arasan driver to work with 64-bit platform using IOMMU translation.
In addition it adds support for more quirks and quirks2 obtained from device tree inside the generic sdhci-platform(sdhci-pltfm.c) driver.
--- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-of-arasan.c | 54 ++++++++++++++++++++++++++++++++++++++ drivers/mmc/host/sdhci-pltfm.c | 12 +++++++++ 3 files changed, 67 insertions(+)
drivers/mmc/host/Kconfig +1 -0
@@ -108,6 +108,7 @@ config MMC_SDHCI_OF_ARASAN tristate "SDHCI OF support for the Arasan SDHCI controllers" depends on MMC_SDHCI_PLTFM depends on OF + select MMC_SDHCI_IO_ACCESSORS help This selects the Arasan Secure Digital Host Controller Interface (SDHCI). This hardware is found e.g. in Xilinx' Zynq SoC.
drivers/mmc/host/sdhci-of-arasan.c +54 -0
80 lines not on this page · raw message
drivers/mmc/host/sdhci-pltfm.c +12 -0
@@ -90,6 +90,18 @@ void sdhci_get_of_property(struct platform_device *pdev)if (of_get_property (np,"broken-cd" ,NULL )) host->quirks |=SDHCI_QUIRK_BROKEN_CARD_DETECTION ; +if (of_get_property (np,"delay-after-power" ,NULL )) + host->quirks |=SDHCI_QUIRK_DELAY_AFTER_POWER ; + +if (of_get_property (np,"no-hispd" ,NULL )) + host->quirks |=SDHCI_QUIRK_NO_HISPD_BIT ; + +if (of_get_property (np,"broken-adma" ,NULL )) + host->quirks |=SDHCI_QUIRK_BROKEN_ADMA ; + +if (of_get_property (np,"no-cmd23" ,NULL )) + host->quirks2 |=SDHCI_QUIRK2_HOST_NO_CMD23 ; +if (of_get_property (np,"no-1-8-v" ,NULL )) host->quirks2 |=SDHCI_QUIRK2_NO_1_8_V ;
--
1.8.2.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/2 mmc: host: arasan: Add addition of-arasan quirks and add IOMMU support.
Quoted 5 lines · On Monday 15 December 2014 22:31:06 Suman Tripathi wrote:
drivers/mmc/host/sdhci-of-arasan.c +1
-0@@ -162,6 +206,16 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } +#if defined(CONFIG_IOMMU_SUPPORT )
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 219
Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +9
-0+ sdhci_arasan->domain =iommu_domain_alloc (&amba_bustype); +if (!sdhci_arasan->domain) { +dev_err (&pdev->dev,"Unable to allocate iommu domain\n" ); +return PTR_ERR (sdhci_arasan->domain); + } + +iommu_attach_device (sdhci_arasan->domain, &pdev->dev); +#endif +
Device drivers should never care about the implementation details of the iommu. Please change the code to use the regular dma_map_* interfaces that will work both with and without IOMMU.
Arnd
PATCH 1/2 mmc: host: arasan: Add addition of-arasan quirks and add IOMMU support.
Hi Arnd,
Quoted 5 lines · On Monday 15 December 2014 22:31:06 Suman Tripathi wrote:
drivers/mmc/host/sdhci-of-arasan.c +1
-0@@ -162,6 +206,16 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } +#if defined(CONFIG_IOMMU_SUPPORT )
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 219
Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +9
-0+ sdhci_arasan->domain =iommu_domain_alloc (&amba_bustype); +if (!sdhci_arasan->domain) { +dev_err (&pdev->dev,"Unable to allocate iommu domain\n" ); +return PTR_ERR (sdhci_arasan->domain); + } + +iommu_attach_device (sdhci_arasan->domain, &pdev->dev); +#endif +
Device drivers should never care about the implementation details of the iommu. Please change the code to use the regular dma_map_* interfaces that will work both with and without IOMMU.
After refer to iommu binding , there is a service that allows "Remap address space to allow devices to access physical memory ranges that they otherwise wouldn't be capable of accessing." eg : 32-bit to 64 bit DMA .
So do we have any existing driver that uses this service ? Just asking for suggestions.
Quoted 22 lines · Arnd Bergmann
Quoted 5 lines · On Monday 15 December 2014 22:31:06 Suman Tripathi wrote:
drivers/mmc/host/sdhci-of-arasan.c +1
-0@@ -162,6 +206,16 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } +#if defined(CONFIG_IOMMU_SUPPORT )drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 219
Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +9
-0+ sdhci_arasan->domain =iommu_domain_alloc (&amba_bustype); +if (!sdhci_arasan->domain) { +dev_err (&pdev->dev,"Unable to allocate iommu domain\n" ); +return PTR_ERR (sdhci_arasan->domain); + } + +iommu_attach_device (sdhci_arasan->domain, &pdev->dev); +#endif +Device drivers should never care about the implementation details of the iommu. Please change the code to use the regular dma_map_* interfaces that will work both with and without IOMMU.
Arnd
Signature · 10 lines
Thanks, with regards, Suman Tripathi CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Applied Micro Circuits Corporation or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. All unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
PATCH 1/2 mmc: host: arasan: Add addition of-arasan quirks and add IOMMU support.
Quoted 24 lines · On Tuesday 06 January 2015 17:10:29 Suman Tripathi wrote:
Hi Arnd,
Quoted 7 lines · On Monday 15 December 2014 22:31:06 Suman Tripathi wrote:
Quoted 6 lines
(quoted diff) +0
-0@@ -162,6 +206,16 @@ static int sdhci_arasan_probe(struct
platform_device*pdev)> > >goto clk_dis_ahb; }Quoted 15 lines
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 218
Quoted 11 lines
drivers/mmc/host/sdhci-of-arasan.c +4
-0+#if defined(CONFIG_IOMMU_SUPPORT ) + sdhci_arasan->domain =iommu_domain_alloc (&amba_bustype); +if (!sdhci_arasan->domain) { + dev_err(&pdev->dev, "Unable to allocate iommudomain\n");
drivers/mmc/host/sdhci-of-arasan.c +6
-0+ return PTR_ERR(sdhci_arasan->domain); + } + +iommu_attach_device (sdhci_arasan->domain, &pdev->dev); +#endif +Device drivers should never care about the implementation details of the iommu. Please change the code to use the regular dma_map_* interfaces that will work both with and without IOMMU.
Quoted 7 lines
After refer to iommu binding , there is a service that allows "Remap address space to allow devices to access physical memory ranges that they otherwise wouldn't be capable of accessing." eg : 32-bit to 64 bit DMA .
So do we have any existing driver that uses this service ? Just asking for suggestions.
The interface is completely transparent to device drivers, it is implemented as a separate 'struct dma_map_ops' that is normally architecture independent, and that handles all sorts of DMA remapping issues for the driver, including
- address space limits
- offsets between CPU and device addresses for the same memory
- cache flushes
- bus-level synchronization
On arm32, we currently support six sets of dma_map_ops including two for IOMMU (coherent and noncoherent). On arm64, we currently always use swiotlb, which solves your problem by copying memory to bounce buffers. This is rather inefficient, and a new implementation is being worked on, based on the arm32 implementation to support IOMMUs in a generic way.
Arnd
PATCH 2/2 arm64: dts: Add APM X-Gene SDHCI DTS node.
In reply to a message not in the archiveThis patch adds the ahbclk and sdhciclk clock nodes and the sdhci device tree nodes of APM X-Gene SDHCI controller.
--- arch/arm64/boot/dts/apm-storm.dtsi | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
arch/arm64/boot/dts/apm-storm.dtsi +43 -0
@@ -144,6 +144,40 @@ clock-output-names = "socplldiv2"; }; + ahbclk: ahbclk@1f2ac000 { + compatible = "apm,xgene-device-clock"; + #clock-cells = <1>; + clocks = <&socplldiv2 0>; + reg = <0x0 0x1f2ac000 0x0 0x1000 + 0x0 0x17000000 0x0 0x2000>; + reg-names = "csr-reg", "div-reg"; + csr-offset = <0x0>; + csr-mask = <0x1>; + enable-offset = <0x8>; + enable-mask = <0x1>; + divider-offset = <0x164>; + divider-width = <0x5>; + divider-shift = <0x0>; + clock-output-names = "ahbclk"; + }; + + sdioclk: sdioclk@1f2ac000 { + compatible = "apm,xgene-device-clock"; + #clock-cells = <1>; + clocks = <&socplldiv2 0>; + reg = <0x0 0x1f2ac000 0x0 0x1000 + 0x0 0x17000000 0x0 0x2000>; + reg-names = "csr-reg", "div-reg"; + csr-offset = <0x0>; + csr-mask = <0x2>; + enable-offset = <0x8>; + enable-mask = <0x2>; + divider-offset = <0x178>; + divider-width = <0x8>; + divider-shift = <0x0>; + clock-output-names = "sdioclk"; + }; + qmlclk: qmlclk { compatible = "apm,xgene-device-clock"; #clock-cells = <1>;
@@ -397,6 +431,15 @@ clocks = <&rtcclk 0>; }; + sdhc0: sdhc@1c000000 { + device_type = "sdhc"; + compatible = "arasan,sdhci-8.9a"; + reg = <0x0 0x1c000000 0x0 0x100>; + interrupts = <0x0 0x49 0x4>; + clock-names = "clk_xin", "clk_ahb"; + clocks = <&sdioclk 0>, <&ahbclk 0>; + }; + menet: ethernet@17020000 { compatible = "apm,xgene-enet"; status = "disabled";
--
1.8.2.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html