Skip to contentSkip to conversation

ata: ahci-dm816: new driver

PATCH Applied Bartosz Golaszewski 3 participants 8 messages Mar 14, 2017 – Mar 27, 2017

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

v2 cover ata: ahci-dm816: new driver

Add support for the on-board SATA controller present on TI DM816 SoCs.

This IP suffers from the same issue DA850 does, that is: if we enable PMP, but connect the drive directly to the board, the disk cannot be detected. A workaround similar to the one implemented in ahci-da850 is included in this driver as well.

Tested on DM8168-EVM.

v1 -> v2:
PATCH 1/2
- fixed the size of the mapped register region in the example
- rephrased the clocks property description

Bartosz Golaszewski (2):
dt-bindings: ata: add DT bindings for ahci-dm816 SATA controller
ata: ahci: add support for DaVinci DM816 SATA controller

 .../devicetree/bindings/ata/ahci-dm816.txt         |  21 +++
 drivers/ata/Kconfig                                |   9 +
 drivers/ata/Makefile                               |   1 +
 drivers/ata/ahci_dm816.c                           | 200 +++++++++++++++++++++
 4 files changed, 231 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
 create mode 100644 drivers/ata/ahci_dm816.c
Signature · 6 lines
2.9.3

--
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
#1 lore raw

PATCH v2 1/2 dt-bindings: ata: add DT bindings for ahci-dm816 SATA controller

Add DT bindings for the onboard SATA controller present on the DM816x SoCs.

---
 .../devicetree/bindings/ata/ahci-dm816.txt          | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +21 -0
new file mode 100644
index 0000000..f8c535f
@@ -0,0 +1,21 @@
+Device tree binding for the TI DM816 AHCI SATA Controller
+---------------------------------------------------------
+
+Required properties:
+  - compatible: must be "ti,dm816-ahci"
+  - reg: physical base address and size of the register region used by
+         the controller (as defined by the AHCI 1.1 standard)
+  - interrupts: interrupt specifier (refer to the interrupt binding)
+  - clocks: list of phandle and clock specifier pairs (or only
+            phandles for clock providers with '0' defined for
+            #clock-cells); two clocks must be specified: the functional
+            clock and an external reference clock
+
+Example:
+
+	sata: sata@4a140000 {
+		compatible = "ti,dm816-ahci";
+		reg = <0x4a140000 0x10000>;
+		interrupts = <16>;
+		clocks = <&sysclk5_ck>, <&sata_refclk>;
+	};
Signature · 6 lines
2.9.3

--
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
#5 lore raw

PATCH v2 2/2 ata: ahci: add support for DaVinci DM816 SATA controller

In reply to Bartosz Golaszewski

This SATA controller is quite similar to the one present on the DA850 SoC, but the PHY configuration is different and it supports two HBA ports.

The IP suffers from the same PMP issue the DA850 does - if we enable PMP but don't use it - softreset fails. Appropriate workaround was implemented in this driver as well.

---
 drivers/ata/Kconfig      |   9 +++
 drivers/ata/Makefile     |   1 +
 drivers/ata/ahci_dm816.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 210 insertions(+)
 create mode 100644 drivers/ata/ahci_dm816.c
drivers/ata/Kconfig +9 -0
index 70b57d2..7f59a7a 100644
@@ -118,6 +118,15 @@ config AHCI_DA850
 
 	  If unsure, say N.
 
+config AHCI_DM816
+	tristate "DaVinci DM816 AHCI SATA support"
+	depends on ARCH_OMAP2PLUS
+	help
+	  This option enables support for the DaVinci DM816 SoC's
+	  onboard AHCI SATA controller.
+
+	  If unsure, say N.
+
 config AHCI_ST
 	tristate "ST AHCI SATA support"
 	depends on ARCH_STI
drivers/ata/Makefile +1 -0
index 89a0a19..3052c0a 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_SATA_HIGHBANK)	+= sata_highbank.o libahci.o
 obj-$(CONFIG_AHCI_BRCM)		+= ahci_brcm.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_CEVA)		+= ahci_ceva.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_DA850)	+= ahci_da850.o libahci.o libahci_platform.o
+obj-$(CONFIG_AHCI_DM816)	+= ahci_dm816.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_OCTEON)	+= ahci_octeon.o
drivers/ata/ahci_dm816.c new file +200 -0

200 lines not on this page · raw message

Signature · 1 line
2.9.3
maintainer Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: ata: add DT bindings for ahci-dm816 SATA controller

In reply to Bartosz Golaszewski
Quoted 8 lines · Bartosz Golaszewski

Add DT bindings for the onboard SATA controller present on the DM816x SoCs.

---
 .../devicetree/bindings/ata/ahci-dm816.txt          | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
#6 lore raw

Re: [PATCH v2 2/2] ata: ahci: add support for DaVinci DM816 SATA controller

In reply to Bartosz Golaszewski

2017-03-14 12:04 GMT+01:00 Bartosz Golaszewski <[email protected]>:

Quoted 8 lines

This SATA controller is quite similar to the one present on the DA850 SoC, but the PHY configuration is different and it supports two HBA ports.

The IP suffers from the same PMP issue the DA850 does - if we enable PMP but don't use it - softreset fails. Appropriate workaround was implemented in this driver as well.

Quoted 8 lines
---
 drivers/ata/Kconfig      |   9 +++
 drivers/ata/Makefile     |   1 +
 drivers/ata/ahci_dm816.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 210 insertions(+)
 create mode 100644 drivers/ata/ahci_dm816.c

Hi Tejun,

the DT bindings have been acked by Rob Herring and Tony Lindgren has picked up the arch/arm patches. If there are no objections, could you merge this driver and DT bindings for 4.12?

Thanks,
Bartosz

Applied
#7 lore raw

Re: [PATCH v2 2/2] ata: ahci: add support for DaVinci DM816 SATA controller

In reply to Bartosz Golaszewski
Quoted 9 lines · Bartosz Golaszewski

This SATA controller is quite similar to the one present on the DA850 SoC, but the PHY configuration is different and it supports two HBA ports.

The IP suffers from the same PMP issue the DA850 does - if we enable PMP but don't use it - softreset fails. Appropriate workaround was implemented in this driver as well.

Applied to libata/for-4.12.

Thanks.

Signature · 5 lines
tejun
--
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
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: ata: add DT bindings for ahci-dm816 SATA controller

In reply to Bartosz Golaszewski

2017-03-14 12:04 GMT+01:00 Bartosz Golaszewski <bgolaszewski-rdvid1DuHRBWk0Htik3J/[email protected]>:

Quoted 37 lines

Add DT bindings for the onboard SATA controller present on the DM816x SoCs.

---
 .../devicetree/bindings/ata/ahci-dm816.txt          | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +21 -1
new file mode 100644
index 0000000..f8c535f
@@ -0,0 +1,21 @@
+Device tree binding for the TI DM816 AHCI SATA Controller
+---------------------------------------------------------
+
+Required properties:
+  - compatible: must be "ti,dm816-ahci"
+  - reg: physical base address and size of the register region used by
+         the controller (as defined by the AHCI 1.1 standard)
+  - interrupts: interrupt specifier (refer to the interrupt binding)
+  - clocks: list of phandle and clock specifier pairs (or only
+            phandles for clock providers with '0' defined for
+            #clock-cells); two clocks must be specified: the functional
+            clock and an external reference clock
+
+Example:
+
+       sata: sata@4a140000 {
+               compatible = "ti,dm816-ahci";
+               reg = <0x4a140000 0x10000>;
+               interrupts = <16>;
+               clocks = <&sysclk5_ck>, <&sata_refclk>;
+       };
--
Quoted 2 lines

2.9.3

Hi Tejun,

can you pick this one up for your tree as well?

Thanks,
Bartosz
--
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