Skip to contentSkip to conversation

ata: ahci-dm816: new driver

PATCH Superseded Bartosz Golaszewski 4 participants 11 messages Mar 13, 2017 – Mar 14, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

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         |  20 +++
 drivers/ata/Kconfig                                |   9 +
 drivers/ata/Makefile                               |   1 +
 drivers/ata/ahci_dm816.c                           | 200 +++++++++++++++++++++
 4 files changed, 230 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
 create mode 100644 drivers/ata/ahci_dm816.c
Signature · 1 line
2.9.3
#1 lore raw

PATCH 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.

---
 Documentation/devicetree/bindings/ata/ahci-dm816.txt | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +20 -0
new file mode 100644
index 0000000..b87ed5a
@@ -0,0 +1,20 @@
+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: clock specifiers (refer to the clock binding); two clocks
+            must be specified: the functional clock and an external
+            reference clock
+
+Example:
+
+	sata: sata@4a140000 {
+		compatible = "ti,dm816-ahci";
+		reg = <0x4a140000 0xffff>;
+		interrupts = <16>;
+		clocks = <&sysclk5_ck>, <&sata_refclk>;
+	};
Signature · 1 line
2.9.3
#2 lore raw

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

Hello!

Quoted 15 lines · Bartosz Golaszewski

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

---
 Documentation/devicetree/bindings/ata/ahci-dm816.txt | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +0 -0
new file mode 100644
index 0000000..b87ed5a

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 9

Quoted 9 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +9 -0
@@ -0,0 +1,20 @@
+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: clock specifiers (refer to the clock binding); two clocks

There should be a phandle preceding the clock specifier, all new such
props are different to the old "interrupts" (which had phandle in a separate "interrupt-parent" prop).

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 17

Quoted 8 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +8 -0
+            must be specified: the functional clock and an external
+            reference clock
+
+Example:
+
+	sata: sata@4a140000 {
+		compatible = "ti,dm816-ahci";
+		reg = <0x4a140000 0xffff>;

I think you meant 0x10000 ISO 0xffff -- this is a size, not limit.

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 20

Quoted 4 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +3 -0
+		interrupts = <16>;
+		clocks = <&sysclk5_ck>, <&sata_refclk>;
+	};

MBR, Sergei

--
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 1/2] dt-bindings: ata: add DT bindings for ahci-dm816 SATA controller

2017-03-13 17:53 GMT+01:00 Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/[email protected]>:

Quoted 27 lines

Hello!

Quoted 23 lines · Bartosz Golaszewski

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

---
 Documentation/devicetree/bindings/ata/ahci-dm816.txt | 20
++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +6 -0
new file mode 100644
index 0000000..b87ed5a
@@ -0,0 +1,20 @@
+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
Quoted 9 lines

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 9

Quoted 3 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +3 -0
+         the controller (as defined by the AHCI 1.1 standard)
+  - interrupts: interrupt specifier (refer to the interrupt binding)
+  - clocks: clock specifiers (refer to the clock binding); two clocks

There should be a phandle preceding the clock specifier, all new such
props are different to the old "interrupts" (which had phandle in a separate "interrupt-parent" prop).

I'm afraid I don't understand - could you point me to an example?

Quoted 12 lines

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 17

Quoted 8 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +8 -0
+            must be specified: the functional clock and an external
+            reference clock
+
+Example:
+
+       sata: sata@4a140000 {
+               compatible = "ti,dm816-ahci";
+               reg = <0x4a140000 0xffff>;

I think you meant 0x10000 ISO 0xffff -- this is a size, not limit.

Right, thanks.

Quoted 7 lines

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 20

Quoted 4 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +3 -0
+               interrupts = <16>;
+               clocks = <&sysclk5_ck>, <&sata_refclk>;
+       };

MBR, Sergei

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

#4 lore raw

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

Quoted 32 lines · Bartosz Golaszewski
Quoted 23 lines
Quoted 23 lines

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

---
 Documentation/devicetree/bindings/ata/ahci-dm816.txt | 20
++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +6 -0
new file mode 100644
index 0000000..b87ed5a
@@ -0,0 +1,20 @@
+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
Quoted 8 lines

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 9

Quoted 3 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +3 -0
+         the controller (as defined by the AHCI 1.1 standard)
+  - interrupts: interrupt specifier (refer to the interrupt binding)
+  - clocks: clock specifiers (refer to the clock binding); two clocks

There should be a phandle preceding the clock specifier, all new such
props are different to the old "interrupts" (which had phandle in a separate "interrupt-parent" prop).

Quoted 1 line

I'm afraid I don't understand - could you point me to an example?

Have you read Documentation/devicetree/bindings/clock/clock-bindings.txt,
on clock consumers?
In fact, your own example below doesn't have clock specifiers, only phandles.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +8 -0
+            must be specified: the functional clock and an external
+            reference clock
+
+Example:
+
+       sata: sata@4a140000 {
+               compatible = "ti,dm816-ahci";
+               reg = <0x4a140000 0xffff>;

[...]

Quoted 7 lines
Quoted 4 lines

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 20

Quoted 4 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +3 -0
+               interrupts = <16>;
+               clocks = <&sysclk5_ck>, <&sata_refclk>;
+       };

Thanks,
Bartosz Golaszewski

MBR, Sergei

#5 lore raw

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

Quoted 34 lines · Sergei Shtylyov
Quoted 31 lines · Bartosz Golaszewski
Quoted 31 lines
Quoted 17 lines

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

---
 Documentation/devicetree/bindings/ata/ahci-dm816.txt | 20
++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +0 -0
new file mode 100644
index 0000000..b87ed5a

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 9

Quoted 9 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +9 -0
@@ -0,0 +1,20 @@
+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: clock specifiers (refer to the clock binding); two clocks

There should be a phandle preceding the clock specifier, all new such
props are different to the old "interrupts" (which had phandle in a separate "interrupt-parent" prop).

Quoted 4 lines
Quoted 1 line

I'm afraid I don't understand - could you point me to an example?

Have you read Documentation/devicetree/bindings/clock/clock-bindings.txt, on clock consumers? In fact, your own example below doesn't have clock specifiers, only phandles.

Hi Sergei,

I think it's perfectly clear since he mentions the "clock bindings", so it's clear the clocks property must conform to the bindings described in the clock/clock-bindings.txt file. The term "specifier" is alone not very clear, but it used as is in plenty of other bindings files about this clocks property (i.e imx-sata.txt, ahci-fsl-qoriq.txt, ahci-ceva.txt).

And it's perfectly allowed to only have a single phandle without any arguments, as described in the clock bindings actually.

Thanks,
Neil

Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +8 -0
+            must be specified: the functional clock and an external
+            reference clock
+
+Example:
+
+       sata: sata@4a140000 {
+               compatible = "ti,dm816-ahci";
+               reg = <0x4a140000 0xffff>;

[...]

Quoted 7 lines
Quoted 4 lines

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 20

Quoted 4 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +3 -0
+               interrupts = <16>;
+               clocks = <&sysclk5_ck>, <&sata_refclk>;
+       };

Thanks,
Bartosz Golaszewski

MBR, Sergei

#6 lore raw

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

In reply to Sergei Shtylyov

2017-03-13 18:27 GMT+01:00 Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/[email protected]>:

Quoted 37 lines · Bartosz Golaszewski
Quoted 34 lines
Quoted 34 lines
Quoted 18 lines

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

---
 Documentation/devicetree/bindings/ata/ahci-dm816.txt | 20
++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/ahci-dm816.txt
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +0 -0
new file mode 100644
index 0000000..b87ed5a

Documentation/devicetree/bindings/ata/ahci-dm816.txt line 9

Quoted 9 lines
Documentation/devicetree/bindings/ata/ahci-dm816.txt new file +9 -0
@@ -0,0 +1,20 @@
+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: clock specifiers (refer to the clock binding); two clocks

There should be a phandle preceding the clock specifier, all new such
props are different to the old "interrupts" (which had phandle in a separate
"interrupt-parent" prop).

Quoted 5 lines
Quoted 1 line

I'm afraid I don't understand - could you point me to an example?

Have you read Documentation/devicetree/bindings/clock/clock-bindings.txt,
on clock consumers?

Yes I have. It says:

 66 clocks:         List of phandle and clock specifier pairs, one pair
 67                 for each clock input to the device.  Note: if the
 68                 clock provider specifies '0' for #clock-cells, then
 69                 only the phandle portion of the pair will appear.
Quoted 3 lines

In fact, your own example below doesn't have clock specifiers, only
phandles.

Since the SATA reference clock specifies 0 for #clock-cells I'll omit the clock specifier. On the other hand: I'll rephrase the clocks property description in the bindings for clarity.

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

#7 lore raw

PATCH 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
#8 lore raw

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

Hello!

Quoted 21 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.

---
 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 +0 -0
index 70b57d2..7f59a7a 100644

drivers/ata/Kconfig config AHCI_DA850 · line 122

Quoted 5 lines
drivers/ata/Kconfig +2 -0
@@ -118,6 +118,15 @@ config AHCI_DA850
 
 	  If unsure, say N.
 
+config AHCI_DM816
+	tristate "DaVinci DM816 AHCI SATA support"

Is it really DaVinci?

drivers/ata/Kconfig config AHCI_DA850 · line 123

Quoted 1 line
drivers/ata/Kconfig +1 -0
+	depends on ARCH_OMAP2PLUS

Especially if it depends on OMAP...

[...]

MBR, Sergei

#9 lore raw

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

Quoted 28 lines · Sergei Shtylyov

Hello!

Quoted 24 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.

---
 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 +0 -0
index 70b57d2..7f59a7a 100644
@@ -118,6 +118,15 @@ config AHCI_DA850
 
       If unsure, say N.
 
Quoted 8 lines

drivers/ata/Kconfig config AHCI_DA850 · line 122

Quoted 2 lines
drivers/ata/Kconfig +2 -0
+config AHCI_DM816
+    tristate "DaVinci DM816 AHCI SATA support"

Is it really DaVinci?

drivers/ata/Kconfig config AHCI_DA850 · line 123

Quoted 1 line
drivers/ata/Kconfig +1 -0
+    depends on ARCH_OMAP2PLUS

Especially if it depends on OMAP...

Hi Sergei,

Yes it's a DaVinci family SoC, but shares a lot of IPs with the OMAP family.

Neil

Quoted 5 lines

[...]

MBR, Sergei

#10 lore raw

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

Quoted 34 lines · Neil Armstrong
Quoted 33 lines · Sergei Shtylyov

Hello!

Quoted 21 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.

---
 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 +0 -0
index 70b57d2..7f59a7a 100644

drivers/ata/Kconfig config AHCI_DA850 · line 122

Quoted 5 lines
drivers/ata/Kconfig +2 -0
@@ -118,6 +118,15 @@ config AHCI_DA850
 
       If unsure, say N.
 
+config AHCI_DM816
+    tristate "DaVinci DM816 AHCI SATA support"

Is it really DaVinci?

Quoted 8 lines
Quoted 3 lines

drivers/ata/Kconfig config AHCI_DA850 · line 123

Quoted 1 line
drivers/ata/Kconfig +1 -0
+    depends on ARCH_OMAP2PLUS

Especially if it depends on OMAP...

Hi Sergei,

Yes it's a DaVinci family SoC, but shares a lot of IPs with the OMAP family.

Actually, this is more of an OMAP family, which shares some IP from DaVinci family

I think in other parts of the kernel, we refer to this as TI 816x instead of using either DaVinci or OMAP.

Kevin