Skip to contentSkip to conversation

Support for Marvell AHCI interface on Armada 38x

PATCH New Thomas Petazzoni 4 participants 18 messages Apr 15, 2014 – May 6, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover Support for Marvell AHCI interface on Armada 38x

Hello,

The Marvell Armada 38x ARM processors use an AHCI compatible interface for SATA (in replacement of the Marvell-specific SATA interface, handled by the sata_mv driver). However, like all DMA-capable Marvell interfaces, some specific MBus window configuration must be done, so a small specific glue layer is needed, which relies on the recently introduced libahci_platform.c.

Changes since v2:

* Added Acked-by from Andrew Lunn <[email protected]> on the first patch.

* Added comment in the code to explain why we don't have suspend/resume support for now. Suggested by Bartlomiej Zolnierkiewicz.

* Added a ahci_mvebu_regret_option() function which enables the vendor-specific regret bit, which allows to solve a potential deadlock situation in the AHCI interface.

Changes since v1:

* Rebased on top of v3.15-rc1

* Added a preliminary patch that orders alphabetically the list of compatible strings in the DT binding document ahci-platform.txt. Suggested by Andrew Lunn.

* Made the availability of MBus DRAM window informations mandatory. Suggested by Andrew Lunn.

* Fixed the module alias name. Suggested by Bartlomiej Zolnierkiewicz.

Details of the patches:

* The first patch is a DT binding documentation cleanup. I believe it should be taken by the ATA maintainer, because the second patch (driver patch) depends on it.

* The second patch of this series contains the driver itself, which is fairly straight-forward. It should be taken by Tejun Heo as the ATA maintainer.

* The last three patches add the Device Tree and defconfig changes. They should be taken by the respective ARM maintainers (mvebu maintainers for the DT and mvebu_v7_defconfig, and arm-soc maintainers for the multi_v7_defconfig change).

Thanks!

Thomas

Thomas Petazzoni (5):
Documentation: dt-bindings: reformat and order list of ahci-platform
compatibles
ata: ahci_mvebu: new driver for Marvell Armada 380 AHCI interfaces
ARM: mvebu: add Device Tree description of AHCI interfaces on Armada

    38x

ARM: configs: add ahci_mvebu to mvebu_v7_defconfig
ARM: configs: add ahci_mvebu to multi_v7_defconfig

 .../devicetree/bindings/ata/ahci-platform.txt      |  13 ++-
 arch/arm/boot/dts/armada-385-db.dts                |   8 ++
 arch/arm/boot/dts/armada-38x.dtsi                  |  16 +++
 arch/arm/configs/multi_v7_defconfig                |   1 +
 arch/arm/configs/mvebu_v7_defconfig                |   1 +
 drivers/ata/Kconfig                                |   9 ++
 drivers/ata/Makefile                               |   1 +
 drivers/ata/ahci_mvebu.c                           | 127 +++++++++++++++++++++
 8 files changed, 172 insertions(+), 4 deletions(-)
 create mode 100644 drivers/ata/ahci_mvebu.c
Signature · 1 line
1.9.2
#1 lore raw

PATCH v3 1/5 Documentation: dt-bindings: reformat and order list of ahci-platform compatibles

The ahci-platform.txt Device Tree binding documentation is gaining a growing number of compatible strings, and it will gain one more with the addition of the Marvell Armada 380 AHCI support. It is therefore time to reformat this list into a proper bullet list, and more importantly order it alphabetically;

---
 Documentation/devicetree/bindings/ata/ahci-platform.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/ata/ahci-platform.txt +8 -4
index 48b285f..5598862 100644
@@ -4,10 +4,14 @@ SATA nodes are defined to describe on-chip Serial ATA controllers.
 Each SATA controller should have its own node.
 
 Required properties:
-- compatible        : compatible list, one of "snps,spear-ahci",
-                      "snps,exynos5440-ahci", "ibm,476gtr-ahci",
-                      "allwinner,sun4i-a10-ahci", "fsl,imx53-ahci"
-                      "fsl,imx6q-ahci" or "snps,dwc-ahci"
+- compatible        : compatible string, one of:
+  - "allwinner,sun4i-a10-ahci"
+  - "fsl,imx53-ahci"
+  - "fsl,imx6q-ahci"
+  - "ibm,476gtr-ahci"
+  - "snps,dwc-ahci"
+  - "snps,exynos5440-ahci"
+  - "snps,spear-ahci"
 - interrupts        : <interrupt mapping for SATA IRQ>
 - reg               : <registers mapping>
 
Signature · 1 line
1.9.2
#2 lore raw

PATCH v3 1/5 Documentation: dt-bindings: reformat and order list of ahci-platform compatibles

Rob,

Quoted 8 lines · Thomas Petazzoni

The ahci-platform.txt Device Tree binding documentation is gaining a growing number of compatible strings, and it will gain one more with the addition of the Marvell Armada 380 AHCI support. It is therefore time to reformat this list into a proper bullet list, and more importantly order it alphabetically;

thx,

Jason.

Applied
#3 lore raw

PATCH v3 1/5 Documentation: dt-bindings: reformat and order list of ahci-platform compatibles

In reply to Thomas Petazzoni
Quoted 8 lines · Thomas Petazzoni

The ahci-platform.txt Device Tree binding documentation is gaining a growing number of compatible strings, and it will gain one more with the addition of the Marvell Armada 380 AHCI support. It is therefore time to reformat this list into a proper bullet list, and more importantly order it alphabetically;

Applied to libata/for-3.16.

Thanks.

Signature · 1 line
tejun
#4 lore raw

PATCH v3 2/5 ata: ahci_mvebu: new driver for Marvell Armada 380 AHCI interfaces

In reply to Thomas Petazzoni

The Marvell Armada 380 SoC includes two AHCI compatible interfaces. However, like all DMA-capable Marvell interface, they require special handling to configure MBus windows. Therefore, this commit adds a new ahci_mvebu driver, which relies on the libahci_platform.c code recently introduced.

---
 .../devicetree/bindings/ata/ahci-platform.txt      |   1 +
 drivers/ata/Kconfig                                |   9 ++
 drivers/ata/Makefile                               |   1 +
 drivers/ata/ahci_mvebu.c                           | 127 +++++++++++++++++++++
 4 files changed, 138 insertions(+)
 create mode 100644 drivers/ata/ahci_mvebu.c
Documentation/devicetree/bindings/ata/ahci-platform.txt +1 -0
index 5598862..d6b07e8 100644
@@ -9,6 +9,7 @@ Required properties:
   - "fsl,imx53-ahci"
   - "fsl,imx6q-ahci"
   - "ibm,476gtr-ahci"
+  - "marvell,armada-380-ahci"
   - "snps,dwc-ahci"
   - "snps,exynos5440-ahci"
   - "snps,spear-ahci"
drivers/ata/Kconfig +9 -0
index 20e03a7..58d04cb 100644
@@ -123,6 +123,15 @@ config AHCI_IMX
 
 	  If unsure, say N.
 
+config AHCI_MVEBU
+	tristate "Marvell EBU AHCI SATA support"
+	depends on ARCH_MVEBU
+	help
+	  This option enables support for the Marvebu EBU SoC's
+	  onboard AHCI SATA.
+
+	  If unsure, say N.
+
 config AHCI_SUNXI
 	tristate "Allwinner sunxi AHCI SATA support"
 	depends on ARCH_SUNXI
drivers/ata/Makefile +1 -0
index 44c8016..5a02aee 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_SATA_DWC)		+= sata_dwc_460ex.o
 obj-$(CONFIG_SATA_HIGHBANK)	+= sata_highbank.o libahci.o
 obj-$(CONFIG_AHCI_DA850)	+= ahci_da850.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_IMX)		+= ahci_imx.o libahci.o libahci_platform.o
+obj-$(CONFIG_AHCI_MVEBU)	+= ahci_mvebu.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_SUNXI)	+= ahci_sunxi.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_ST)		+= ahci_st.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_XGENE)	+= ahci_xgene.o libahci.o libahci_platform.o
drivers/ata/ahci_mvebu.c new file +127 -0

127 lines not on this page · raw message

Signature · 1 line
1.9.2
#5 lore raw

PATCH v3 2/5 ata: ahci_mvebu: new driver for Marvell Armada 380 AHCI interfaces

Tejun,

Quoted 7 lines · Thomas Petazzoni

The Marvell Armada 380 SoC includes two AHCI compatible interfaces. However, like all DMA-capable Marvell interface, they require special handling to configure MBus windows. Therefore, this commit adds a new ahci_mvebu driver, which relies on the libahci_platform.c code recently introduced.

thx,

Jason.

#6 lore raw

PATCH v3 2/5 ata: ahci_mvebu: new driver for Marvell Armada 380 AHCI interfaces

In reply to Thomas Petazzoni
Quoted 7 lines · Thomas Petazzoni

The Marvell Armada 380 SoC includes two AHCI compatible interfaces. However, like all DMA-capable Marvell interface, they require special handling to configure MBus windows. Therefore, this commit adds a new ahci_mvebu driver, which relies on the libahci_platform.c code recently introduced.

How should this be routed? Can I pick up just this one and apply it to libata/for-3.16?

Thanks.

Signature · 1 line
tejun
#7 lore raw

PATCH v3 2/5 ata: ahci_mvebu: new driver for Marvell Armada 380 AHCI interfaces

Dear Tejun Heo,

Quoted 11 lines · Tejun Heo
Quoted 7 lines · Thomas Petazzoni

The Marvell Armada 380 SoC includes two AHCI compatible interfaces. However, like all DMA-capable Marvell interface, they require special handling to configure MBus windows. Therefore, this commit adds a new ahci_mvebu driver, which relies on the libahci_platform.c code recently introduced.

How should this be routed? Can I pick up just this one and apply it to libata/for-3.16?

Yes. And I believe you should also take PATCH 1 in the series, which updates the Device Tree binding documentation for the AHCI driver. Both patches have received a Acked-by from Jason Cooper, the maintainer of the mvebu platforms.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Applied
#8 lore raw

PATCH v3 2/5 ata: ahci_mvebu: new driver for Marvell Armada 380 AHCI interfaces

In reply to Thomas Petazzoni
Quoted 7 lines · Thomas Petazzoni

The Marvell Armada 380 SoC includes two AHCI compatible interfaces. However, like all DMA-capable Marvell interface, they require special handling to configure MBus windows. Therefore, this commit adds a new ahci_mvebu driver, which relies on the libahci_platform.c code recently introduced.

Applied to libata/for-3.16.

Thanks.

Signature · 1 line
tejun
#9 lore raw

PATCH v3 3/5 ARM: mvebu: add Device Tree description of AHCI interfaces on Armada 38x

In reply to Thomas Petazzoni

The Marvell Armada 38x processors contain two AHCI compatible interfaces. This commit adds the Device Tree description of those interfaces at the SoC level, and also enables them on the Armada 385 DB platform, which allows access to both interfaces through SATA ports.

---
 arch/arm/boot/dts/armada-385-db.dts |  8 ++++++++
 arch/arm/boot/dts/armada-38x.dtsi   | 16 ++++++++++++++++
 2 files changed, 24 insertions(+)
arch/arm/boot/dts/armada-385-db.dts +8 -0
index 6828d77..bdde8ff 100644
@@ -81,6 +81,14 @@
 				};
 			};
 
+			sata at a8000 {
+				status = "okay";
+			};
+
+			sata at e0000 {
+				status = "okay";
+			};
+
 			flash at d0000 {
 				status = "okay";
 				num-cs = <1>;
arch/arm/boot/dts/armada-38x.dtsi +16 -0
index a064f59..634a020 100644
@@ -338,6 +338,22 @@
 				reg = <0x72004 0x4>;
 			};
 
+			sata at a8000 {
+				compatible = "marvell,armada-380-ahci";
+				reg = <0xa8000 0x2000>;
+				interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&gateclk 15>;
+				status = "disabled";
+			};
+
+			sata at e0000 {
+				compatible = "marvell,armada-380-ahci";
+				reg = <0xe0000 0x2000>;
+				interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&gateclk 30>;
+				status = "disabled";
+			};
+
 			coredivclk: clock at e4250 {
 				compatible = "marvell,armada-380-corediv-clock";
 				reg = <0xe4250 0xc>;
Signature · 1 line
1.9.2
Applied
#10 lore raw

PATCH v3 3/5 ARM: mvebu: add Device Tree description of AHCI interfaces on Armada 38x

Quoted 11 lines · Thomas Petazzoni

The Marvell Armada 38x processors contain two AHCI compatible interfaces. This commit adds the Device Tree description of those interfaces at the SoC level, and also enables them on the Armada 385 DB platform, which allows access to both interfaces through SATA ports.

---
 arch/arm/boot/dts/armada-385-db.dts |  8 ++++++++
 arch/arm/boot/dts/armada-38x.dtsi   | 16 ++++++++++++++++
 2 files changed, 24 insertions(+)

Applied to mvebu/dt

thx,

Jason.

#11 lore raw

PATCH v3 4/5 ARM: configs: add ahci_mvebu to mvebu_v7_defconfig

In reply to Thomas Petazzoni

The Marvell Armada 38x platform needs the ahci_mvebu driver enabled for the AHCI interfaces, so this commit enables the corresponding Kconfig option in mvebu_v7_defconfig.

---
 arch/arm/configs/mvebu_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/mvebu_v7_defconfig +1 -0
index a34713d..aaa625a 100644
@@ -36,6 +36,7 @@ CONFIG_CFG80211=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_BLK_DEV_SD=y
 CONFIG_ATA=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
 CONFIG_MVNETA=y
Signature · 1 line
1.9.2
Applied
#12 lore raw

PATCH v3 4/5 ARM: configs: add ahci_mvebu to mvebu_v7_defconfig

Quoted 8 lines · Thomas Petazzoni

The Marvell Armada 38x platform needs the ahci_mvebu driver enabled for the AHCI interfaces, so this commit enables the corresponding Kconfig option in mvebu_v7_defconfig.

---
 arch/arm/configs/mvebu_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

Applied to mvebu/defconfig

thx,

Jason.

#13 lore raw

PATCH v3 5/5 ARM: configs: add ahci_mvebu to multi_v7_defconfig

In reply to Thomas Petazzoni

The Marvell Armada 38x platform needs the ahci_mvebu driver enabled for the AHCI interfaces, so this commit enables the corresponding Kconfig option in multi_v7_defconfig.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index d4e8a47..59f7ede 100644
@@ -116,6 +116,7 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_SCSI_MULTI_LUN=y
 CONFIG_ATA=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_SATA_AHCI_PLATFORM=y
 CONFIG_SATA_HIGHBANK=y
 CONFIG_SATA_MV=y
Signature · 1 line
1.9.2
#14 lore raw

PATCH v3 5/5 ARM: configs: add ahci_mvebu to multi_v7_defconfig

Arnd, Olof, Kevin,

Quoted 8 lines · Thomas Petazzoni

The Marvell Armada 38x platform needs the ahci_mvebu driver enabled for the AHCI interfaces, so this commit enables the corresponding Kconfig option in multi_v7_defconfig.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

Conflict-ridden file, please take directly.

thx,

Jason.

#15 lore raw

PATCH v3 5/5 ARM: configs: add ahci_mvebu to multi_v7_defconfig

Quoted 7 lines · Jason Cooper

Arnd, Olof, Kevin,

Quoted 4 lines · Thomas Petazzoni

The Marvell Armada 38x platform needs the ahci_mvebu driver enabled for the AHCI interfaces, so this commit enables the corresponding Kconfig option in multi_v7_defconfig.

Quoted 8 lines
Quoted 4 lines
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

Conflict-ridden file, please take directly.

Just like many other maintainers, just getting added on cc on the ack doesn't fit our work flows very well.

When I get one of these, I have to go hunting for the original patch on whatever list it was posted on, verifying that it's indeed the right one, and then apply it, and then add your ack.

It's much easier if we get the patch remailed to us, or resubmitted with the ack and sent to us. It's how others (like Greg) tend to prefer to get patches as well.

So, Thomas, care to resend us ([email protected]) the patch with the ack appended? Thanks!

-Olof

#16 lore raw

PATCH v3 5/5 ARM: configs: add ahci_mvebu to multi_v7_defconfig

Dear Olof Johansson,

Quoted 6 lines · Olof Johansson

It's much easier if we get the patch remailed to us, or resubmitted with the ack and sent to us. It's how others (like Greg) tend to prefer to get patches as well.

So, Thomas, care to resend us (arm at kernel.org) the patch with the ack appended? Thanks!

Sure, will do, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#17 lore raw

PATCH v3 5/5 ARM: configs: add ahci_mvebu to multi_v7_defconfig

In reply to Olof Johansson
Quoted 13 lines · Olof Johansson
Quoted 12 lines · Jason Cooper

Arnd, Olof, Kevin,

Quoted 8 lines · Thomas Petazzoni

The Marvell Armada 38x platform needs the ahci_mvebu driver enabled for the AHCI interfaces, so this commit enables the corresponding Kconfig option in multi_v7_defconfig.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 6 lines
Quoted 3 lines

Conflict-ridden file, please take directly.

Just like many other maintainers, just getting added on cc on the ack doesn't fit our work flows very well.

gah, yes of course. I was being lazy. I'll bounce or resend in the future.

thx,

Jason.