linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Add RK3588 SATA support
@ 2023-06-12 17:13 Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 1/5] dt-bindings: ata: dwc-ahci: add PHY clocks Sebastian Reichel
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-06-12 17:13 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

Hi,

This enables SATA support for RK3588.

Changes since PATCHv3:
 * https://lore.kernel.org/all/20230608162238.50078-1-sebastian.reichel@collabora.com/
 * Add Reviewed-by from Serge and Krzysztof to patch 1
 * Update patch 2
   - Add maxItems to 'clocks' property; without specifying minItems it's
     implied to be the same
   - Keep allOf above the properties in snps,dwc-ahci.yaml
   - Add 'sata-port@0' to list of allowed properties
   - Replace sata-port pattern property, so that it disallows using any
     sata-port nodes besides @0 to override the pattern property from the
     common binding
 * Add Reviewed-by from Krzysztof to patch 3

Changes since PATCHv2:
 * https://lore.kernel.org/all/20230522173423.64691-1-sebastian.reichel@collabora.com/
 * Drop patch 1 (applied by Heiko)
 * Update SATA DT binding to split Rockchip into its own file
 * Enforce correct resets numbers for the rk3568/rk3588 combo PHY

Changes since PATCHv1:
 * https://lore.kernel.org/all/20230413182345.92557-1-sebastian.reichel@collabora.com/
 * Rebase to v6.4-rc1
 * Collect Acked-by for syscon DT binding update
 * Use ASIC clock description suggested by Serge Semin
 * Also add RBC clock (not used by RK3588)
 * Add extra patch narrowing down the allowed clocks for RK356x and RK3588

-- Sebastian

Sebastian Reichel (5):
  dt-bindings: ata: dwc-ahci: add PHY clocks
  dt-bindings: ata: dwc-ahci: add Rockchip RK3588
  dt-bindings: phy: rockchip: rk3588 has two reset lines
  arm64: dts: rockchip: rk3588: add combo PHYs
  arm64: dts: rockchip: rk3588: add SATA support

 .../bindings/ata/rockchip,dwc-ahci.yaml       | 124 ++++++++++++++++++
 .../bindings/ata/snps,dwc-ahci-common.yaml    |   8 +-
 .../bindings/ata/snps,dwc-ahci.yaml           |  13 +-
 .../phy/phy-rockchip-naneng-combphy.yaml      |  34 ++++-
 arch/arm64/boot/dts/rockchip/rk3588.dtsi      |  44 +++++++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     |  90 +++++++++++++
 6 files changed, 306 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml

-- 
2.39.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v4 1/5] dt-bindings: ata: dwc-ahci: add PHY clocks
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
@ 2023-06-12 17:13 ` Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588 Sebastian Reichel
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-06-12 17:13 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel, Krzysztof Kozlowski

Add PHY transmit and receive clocks as described by the
DW SATA AHCI HW manual.

Suggested-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../devicetree/bindings/ata/snps,dwc-ahci-common.yaml     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml
index c1457910520b..34c5bf65b02d 100644
--- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml
+++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml
@@ -31,11 +31,11 @@ properties:
       PM-alive clock, RxOOB detection clock, embedded PHYs reference (Rx/Tx)
       clock, etc.
     minItems: 1
-    maxItems: 4
+    maxItems: 6
 
   clock-names:
     minItems: 1
-    maxItems: 4
+    maxItems: 6
     items:
       oneOf:
         - description: Application APB/AHB/AXI BIU clock
@@ -48,6 +48,10 @@ properties:
           const: pmalive
         - description: RxOOB detection clock
           const: rxoob
+        - description: PHY Transmit Clock
+          const: asic
+        - description: PHY Receive Clock
+          const: rbc
         - description: SATA Ports reference clock
           const: ref
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 1/5] dt-bindings: ata: dwc-ahci: add PHY clocks Sebastian Reichel
@ 2023-06-12 17:13 ` Sebastian Reichel
  2023-06-12 19:27   ` Serge Semin
  2023-06-13  6:56   ` Krzysztof Kozlowski
  2023-06-12 17:13 ` [PATCH v4 3/5] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-06-12 17:13 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

This adds Rockchip RK3588 AHCI binding. In order to narrow down the
allowed clocks without bloating the generic binding, the description
of Rockchip's AHCI controllers has been moved to its own file.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../bindings/ata/rockchip,dwc-ahci.yaml       | 124 ++++++++++++++++++
 .../bindings/ata/snps,dwc-ahci.yaml           |  13 +-
 2 files changed, 133 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml

diff --git a/Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml
new file mode 100644
index 000000000000..b5e5767d8698
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml
@@ -0,0 +1,124 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ata/rockchip,dwc-ahci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synopsys DWC AHCI SATA controller for Rockchip devices
+
+maintainers:
+  - Serge Semin <fancer.lancer@gmail.com>
+
+description:
+  This document defines device tree bindings for the Synopsys DWC
+  implementation of the AHCI SATA controller found in Rockchip
+  devices.
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - rockchip,rk3568-dwc-ahci
+          - rockchip,rk3588-dwc-ahci
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - rockchip,rk3568-dwc-ahci
+          - rockchip,rk3588-dwc-ahci
+      - const: snps,dwc-ahci
+
+  ports-implemented:
+    const: 1
+
+  sata-port@0:
+    $ref: /schemas/ata/snps,dwc-ahci-common.yaml#/$defs/dwc-ahci-port
+
+    properties:
+      reg:
+        const: 0
+
+    unevaluatedProperties: false
+
+patternProperties:
+  "^sata-port@[1-9a-e]$": false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - ports-implemented
+
+allOf:
+  - $ref: snps,dwc-ahci-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3588-dwc-ahci
+    then:
+      properties:
+        clocks:
+          maxItems: 5
+        clock-names:
+          items:
+            - const: sata
+            - const: pmalive
+            - const: rxoob
+            - const: ref
+            - const: asic
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3568-dwc-ahci
+    then:
+      properties:
+        clocks:
+          maxItems: 3
+        clock-names:
+          items:
+            - const: sata
+            - const: pmalive
+            - const: rxoob
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/rockchip,rk3588-cru.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/ata/ahci.h>
+    #include <dt-bindings/phy/phy.h>
+
+    sata@fe210000 {
+      compatible = "rockchip,rk3588-dwc-ahci", "snps,dwc-ahci";
+      reg = <0xfe210000 0x1000>;
+      clocks = <&cru ACLK_SATA0>, <&cru CLK_PMALIVE0>,
+               <&cru CLK_RXOOB0>, <&cru CLK_PIPEPHY0_REF>,
+               <&cru CLK_PIPEPHY0_PIPE_ASIC_G>;
+      clock-names = "sata", "pmalive", "rxoob", "ref", "asic";
+      interrupts = <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH 0>;
+      ports-implemented = <0x1>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      sata-port@0 {
+        reg = <0>;
+        hba-port-cap = <HBA_PORT_FBSCP>;
+        phys = <&combphy0_ps PHY_TYPE_SATA>;
+        phy-names = "sata-phy";
+        snps,rx-ts-max = <32>;
+        snps,tx-ts-max = <32>;
+      };
+    };
+
+...
diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
index 5afa4b57ce20..4c848fcb5a5d 100644
--- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
+++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
@@ -13,6 +13,15 @@ description:
   This document defines device tree bindings for the generic Synopsys DWC
   implementation of the AHCI SATA controller.
 
+select:
+  properties:
+    compatible:
+      enum:
+        - snps,dwc-ahci
+        - snps,spear-ahci
+  required:
+    - compatible
+
 allOf:
   - $ref: snps,dwc-ahci-common.yaml#
 
@@ -23,10 +32,6 @@ properties:
         const: snps,dwc-ahci
       - description: SPEAr1340 AHCI SATA device
         const: snps,spear-ahci
-      - description: Rockhip RK3568 AHCI controller
-        items:
-          - const: rockchip,rk3568-dwc-ahci
-          - const: snps,dwc-ahci
 
 patternProperties:
   "^sata-port@[0-9a-e]$":
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 3/5] dt-bindings: phy: rockchip: rk3588 has two reset lines
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 1/5] dt-bindings: ata: dwc-ahci: add PHY clocks Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588 Sebastian Reichel
@ 2023-06-12 17:13 ` Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 4/5] arm64: dts: rockchip: rk3588: add combo PHYs Sebastian Reichel
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-06-12 17:13 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel, Krzysztof Kozlowski

The RK3588 has two reset lines for the combphy. One for the
APB interface and one for the actual PHY.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../phy/phy-rockchip-naneng-combphy.yaml      | 34 ++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-combphy.yaml b/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-combphy.yaml
index 9ae514fa7533..d3cd7997879f 100644
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-combphy.yaml
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-naneng-combphy.yaml
@@ -31,8 +31,14 @@ properties:
       - const: pipe
 
   resets:
+    minItems: 1
+    maxItems: 2
+
+  reset-names:
+    minItems: 1
     items:
-      - description: exclusive PHY reset line
+      - const: phy
+      - const: apb
 
   rockchip,enable-ssc:
     type: boolean
@@ -78,6 +84,32 @@ required:
   - rockchip,pipe-phy-grf
   - "#phy-cells"
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3568-naneng-combphy
+    then:
+      properties:
+        resets:
+          maxItems: 1
+        reset-names:
+          maxItems: 1
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3588-naneng-combphy
+    then:
+      properties:
+        resets:
+          minItems: 2
+        reset-names:
+          minItems: 2
+      required:
+        - reset-names
+
 additionalProperties: false
 
 examples:
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 4/5] arm64: dts: rockchip: rk3588: add combo PHYs
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
                   ` (2 preceding siblings ...)
  2023-06-12 17:13 ` [PATCH v4 3/5] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
@ 2023-06-12 17:13 ` Sebastian Reichel
  2023-06-12 17:13 ` [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-06-12 17:13 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

Add all 3 combo PHYs that can be found in RK3588.
They are used for SATA, PCIe or USB3.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 arch/arm64/boot/dts/rockchip/rk3588.dtsi  | 21 ++++++++++++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 42 +++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588.dtsi
index 8be75556af8f..9d8539b5309b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588.dtsi
@@ -7,6 +7,11 @@
 #include "rk3588-pinctrl.dtsi"
 
 / {
+	pipe_phy1_grf: syscon@fd5c0000 {
+		compatible = "rockchip,rk3588-pipe-phy-grf", "syscon";
+		reg = <0x0 0xfd5c0000 0x0 0x100>;
+	};
+
 	i2s8_8ch: i2s@fddc8000 {
 		compatible = "rockchip,rk3588-i2s-tdm";
 		reg = <0x0 0xfddc8000 0x0 0x1000>;
@@ -123,4 +128,20 @@ gmac0_mtl_tx_setup: tx-queues-config {
 			queue1 {};
 		};
 	};
+
+	combphy1_ps: phy@fee10000 {
+		compatible = "rockchip,rk3588-naneng-combphy";
+		reg = <0x0 0xfee10000 0x0 0x100>;
+		#phy-cells = <1>;
+		clocks = <&cru CLK_REF_PIPE_PHY1>, <&cru PCLK_PCIE_COMBO_PIPE_PHY1>,
+			 <&cru PCLK_PHP_ROOT>;
+		clock-names = "ref", "apb", "pipe";
+		assigned-clocks = <&cru CLK_REF_PIPE_PHY1>;
+		assigned-clock-rates = <100000000>;
+		resets = <&cru SRST_REF_PIPE_PHY1>, <&cru SRST_P_PCIE2_PHY1>;
+		reset-names = "phy", "apb";
+		rockchip,pipe-grf = <&php_grf>;
+		rockchip,pipe-phy-grf = <&pipe_phy1_grf>;
+		status = "disabled";
+	};
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
index 01058fed8f96..45ae457a22a4 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -944,6 +944,16 @@ php_grf: syscon@fd5b0000 {
 		reg = <0x0 0xfd5b0000 0x0 0x1000>;
 	};
 
+	pipe_phy0_grf: syscon@fd5bc000 {
+		compatible = "rockchip,rk3588-pipe-phy-grf", "syscon";
+		reg = <0x0 0xfd5bc000 0x0 0x100>;
+	};
+
+	pipe_phy2_grf: syscon@fd5c4000 {
+		compatible = "rockchip,rk3588-pipe-phy-grf", "syscon";
+		reg = <0x0 0xfd5c4000 0x0 0x100>;
+	};
+
 	ioc: syscon@fd5f0000 {
 		compatible = "rockchip,rk3588-ioc", "syscon";
 		reg = <0x0 0xfd5f0000 0x0 0x10000>;
@@ -2371,6 +2381,38 @@ dmac2: dma-controller@fed10000 {
 		#dma-cells = <1>;
 	};
 
+	combphy0_ps: phy@fee00000 {
+		compatible = "rockchip,rk3588-naneng-combphy";
+		reg = <0x0 0xfee00000 0x0 0x100>;
+		#phy-cells = <1>;
+		clocks = <&cru CLK_REF_PIPE_PHY0>, <&cru PCLK_PCIE_COMBO_PIPE_PHY0>,
+			 <&cru PCLK_PHP_ROOT>;
+		clock-names = "ref", "apb", "pipe";
+		assigned-clocks = <&cru CLK_REF_PIPE_PHY0>;
+		assigned-clock-rates = <100000000>;
+		resets = <&cru SRST_REF_PIPE_PHY0>, <&cru SRST_P_PCIE2_PHY0>;
+		reset-names = "phy", "apb";
+		rockchip,pipe-grf = <&php_grf>;
+		rockchip,pipe-phy-grf = <&pipe_phy0_grf>;
+		status = "disabled";
+	};
+
+	combphy2_psu: phy@fee20000 {
+		compatible = "rockchip,rk3588-naneng-combphy";
+		reg = <0x0 0xfee20000 0x0 0x100>;
+		#phy-cells = <1>;
+		clocks = <&cru CLK_REF_PIPE_PHY2>, <&cru PCLK_PCIE_COMBO_PIPE_PHY2>,
+			 <&cru PCLK_PHP_ROOT>;
+		clock-names = "ref", "apb", "pipe";
+		assigned-clocks = <&cru CLK_REF_PIPE_PHY2>;
+		assigned-clock-rates = <100000000>;
+		resets = <&cru SRST_REF_PIPE_PHY2>, <&cru SRST_P_PCIE2_PHY2>;
+		reset-names = "phy", "apb";
+		rockchip,pipe-grf = <&php_grf>;
+		rockchip,pipe-phy-grf = <&pipe_phy2_grf>;
+		status = "disabled";
+	};
+
 	system_sram2: sram@ff001000 {
 		compatible = "mmio-sram";
 		reg = <0x0 0xff001000 0x0 0xef000>;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
                   ` (3 preceding siblings ...)
  2023-06-12 17:13 ` [PATCH v4 4/5] arm64: dts: rockchip: rk3588: add combo PHYs Sebastian Reichel
@ 2023-06-12 17:13 ` Sebastian Reichel
  2023-06-18  3:10   ` Damien Le Moal
  2023-06-20  1:17 ` [PATCH v4 0/5] Add RK3588 " Damien Le Moal
  2023-07-11 14:48 ` (subset) " Heiko Stuebner
  6 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2023-06-12 17:13 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, Sebastian Reichel,
	kernel

Add all three SATA IP blocks to the RK3588 DT.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 arch/arm64/boot/dts/rockchip/rk3588.dtsi  | 23 +++++++++++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 48 +++++++++++++++++++++++
 2 files changed, 71 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588.dtsi
index 9d8539b5309b..b9508cea34f1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588.dtsi
@@ -129,6 +129,29 @@ gmac0_mtl_tx_setup: tx-queues-config {
 		};
 	};
 
+	sata1: sata@fe220000 {
+		compatible = "rockchip,rk3588-dwc-ahci", "snps,dwc-ahci";
+		reg = <0 0xfe220000 0 0x1000>;
+		clocks = <&cru ACLK_SATA1>, <&cru CLK_PMALIVE1>,
+			 <&cru CLK_RXOOB1>, <&cru CLK_PIPEPHY1_REF>,
+			 <&cru CLK_PIPEPHY1_PIPE_ASIC_G>;
+		clock-names = "sata", "pmalive", "rxoob", "ref", "asic";
+		interrupts = <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH 0>;
+		ports-implemented = <0x1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+
+		sata-port@0 {
+			reg = <0>;
+			hba-port-cap = <HBA_PORT_FBSCP>;
+			phys = <&combphy1_ps PHY_TYPE_SATA>;
+			phy-names = "sata-phy";
+			snps,rx-ts-max = <32>;
+			snps,tx-ts-max = <32>;
+		};
+	};
+
 	combphy1_ps: phy@fee10000 {
 		compatible = "rockchip,rk3588-naneng-combphy";
 		reg = <0x0 0xfee10000 0x0 0x100>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
index 45ae457a22a4..00a91b08e3bb 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -9,6 +9,8 @@
 #include <dt-bindings/power/rk3588-power.h>
 #include <dt-bindings/reset/rockchip,rk3588-cru.h>
 #include <dt-bindings/thermal/thermal.h>
+#include <dt-bindings/phy/phy.h>
+#include <dt-bindings/ata/ahci.h>
 
 / {
 	compatible = "rockchip,rk3588";
@@ -1717,6 +1719,52 @@ gmac1_mtl_tx_setup: tx-queues-config {
 		};
 	};
 
+	sata0: sata@fe210000 {
+		compatible = "rockchip,rk3588-dwc-ahci", "snps,dwc-ahci";
+		reg = <0 0xfe210000 0 0x1000>;
+		clocks = <&cru ACLK_SATA0>, <&cru CLK_PMALIVE0>,
+			 <&cru CLK_RXOOB0>, <&cru CLK_PIPEPHY0_REF>,
+			 <&cru CLK_PIPEPHY0_PIPE_ASIC_G>;
+		clock-names = "sata", "pmalive", "rxoob", "ref", "asic";
+		interrupts = <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH 0>;
+		ports-implemented = <0x1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+
+		sata-port@0 {
+			reg = <0>;
+			hba-port-cap = <HBA_PORT_FBSCP>;
+			phys = <&combphy0_ps PHY_TYPE_SATA>;
+			phy-names = "sata-phy";
+			snps,rx-ts-max = <32>;
+			snps,tx-ts-max = <32>;
+		};
+	};
+
+	sata2: sata@fe230000 {
+		compatible = "rockchip,rk3588-dwc-ahci", "snps,dwc-ahci";
+		reg = <0 0xfe230000 0 0x1000>;
+		clocks = <&cru ACLK_SATA2>, <&cru CLK_PMALIVE2>,
+			 <&cru CLK_RXOOB2>, <&cru CLK_PIPEPHY2_REF>,
+			 <&cru CLK_PIPEPHY2_PIPE_ASIC_G>;
+		clock-names = "sata", "pmalive", "rxoob", "ref", "asic";
+		interrupts = <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH 0>;
+		ports-implemented = <0x1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+
+		sata-port@0 {
+			reg = <0>;
+			hba-port-cap = <HBA_PORT_FBSCP>;
+			phys = <&combphy2_psu PHY_TYPE_SATA>;
+			phy-names = "sata-phy";
+			snps,rx-ts-max = <32>;
+			snps,tx-ts-max = <32>;
+		};
+	};
+
 	sdmmc: mmc@fe2c0000 {
 		compatible = "rockchip,rk3588-dw-mshc", "rockchip,rk3288-dw-mshc";
 		reg = <0x0 0xfe2c0000 0x0 0x4000>;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588
  2023-06-12 17:13 ` [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588 Sebastian Reichel
@ 2023-06-12 19:27   ` Serge Semin
  2023-06-13  6:56   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 13+ messages in thread
From: Serge Semin @ 2023-06-12 19:27 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Heiko Stuebner, Rob Herring, Krzysztof Kozlowski, Damien Le Moal,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, kernel

On Mon, Jun 12, 2023 at 07:13:34PM +0200, Sebastian Reichel wrote:
> This adds Rockchip RK3588 AHCI binding. In order to narrow down the
> allowed clocks without bloating the generic binding, the description
> of Rockchip's AHCI controllers has been moved to its own file.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Thanks. The patch now looks good.
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

> ---
>  .../bindings/ata/rockchip,dwc-ahci.yaml       | 124 ++++++++++++++++++
>  .../bindings/ata/snps,dwc-ahci.yaml           |  13 +-
>  2 files changed, 133 insertions(+), 4 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml
> 
> diff --git a/Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml
> new file mode 100644
> index 000000000000..b5e5767d8698
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ata/rockchip,dwc-ahci.yaml
> @@ -0,0 +1,124 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ata/rockchip,dwc-ahci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Synopsys DWC AHCI SATA controller for Rockchip devices
> +
> +maintainers:
> +  - Serge Semin <fancer.lancer@gmail.com>
> +
> +description:
> +  This document defines device tree bindings for the Synopsys DWC
> +  implementation of the AHCI SATA controller found in Rockchip
> +  devices.
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - rockchip,rk3568-dwc-ahci
> +          - rockchip,rk3588-dwc-ahci
> +  required:
> +    - compatible
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - rockchip,rk3568-dwc-ahci
> +          - rockchip,rk3588-dwc-ahci
> +      - const: snps,dwc-ahci
> +
> +  ports-implemented:
> +    const: 1
> +
> +  sata-port@0:
> +    $ref: /schemas/ata/snps,dwc-ahci-common.yaml#/$defs/dwc-ahci-port
> +
> +    properties:
> +      reg:
> +        const: 0
> +
> +    unevaluatedProperties: false
> +
> +patternProperties:
> +  "^sata-port@[1-9a-e]$": false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - ports-implemented
> +
> +allOf:
> +  - $ref: snps,dwc-ahci-common.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3588-dwc-ahci
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 5
> +        clock-names:
> +          items:
> +            - const: sata
> +            - const: pmalive
> +            - const: rxoob
> +            - const: ref
> +            - const: asic
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3568-dwc-ahci
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 3
> +        clock-names:
> +          items:
> +            - const: sata
> +            - const: pmalive
> +            - const: rxoob
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/rockchip,rk3588-cru.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/ata/ahci.h>
> +    #include <dt-bindings/phy/phy.h>
> +
> +    sata@fe210000 {
> +      compatible = "rockchip,rk3588-dwc-ahci", "snps,dwc-ahci";
> +      reg = <0xfe210000 0x1000>;
> +      clocks = <&cru ACLK_SATA0>, <&cru CLK_PMALIVE0>,
> +               <&cru CLK_RXOOB0>, <&cru CLK_PIPEPHY0_REF>,
> +               <&cru CLK_PIPEPHY0_PIPE_ASIC_G>;
> +      clock-names = "sata", "pmalive", "rxoob", "ref", "asic";
> +      interrupts = <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH 0>;
> +      ports-implemented = <0x1>;
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      sata-port@0 {
> +        reg = <0>;
> +        hba-port-cap = <HBA_PORT_FBSCP>;
> +        phys = <&combphy0_ps PHY_TYPE_SATA>;
> +        phy-names = "sata-phy";
> +        snps,rx-ts-max = <32>;
> +        snps,tx-ts-max = <32>;
> +      };
> +    };
> +
> +...
> diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> index 5afa4b57ce20..4c848fcb5a5d 100644
> --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> @@ -13,6 +13,15 @@ description:
>    This document defines device tree bindings for the generic Synopsys DWC
>    implementation of the AHCI SATA controller.
>  
> +select:
> +  properties:
> +    compatible:
> +      enum:
> +        - snps,dwc-ahci
> +        - snps,spear-ahci
> +  required:
> +    - compatible
> +
>  allOf:
>    - $ref: snps,dwc-ahci-common.yaml#
>  
> @@ -23,10 +32,6 @@ properties:
>          const: snps,dwc-ahci
>        - description: SPEAr1340 AHCI SATA device
>          const: snps,spear-ahci
> -      - description: Rockhip RK3568 AHCI controller
> -        items:
> -          - const: rockchip,rk3568-dwc-ahci
> -          - const: snps,dwc-ahci
>  
>  patternProperties:
>    "^sata-port@[0-9a-e]$":
> -- 
> 2.39.2
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588
  2023-06-12 17:13 ` [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588 Sebastian Reichel
  2023-06-12 19:27   ` Serge Semin
@ 2023-06-13  6:56   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-13  6:56 UTC (permalink / raw)
  To: Sebastian Reichel, Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, kernel

On 12/06/2023 19:13, Sebastian Reichel wrote:
> This adds Rockchip RK3588 AHCI binding. In order to narrow down the
> allowed clocks without bloating the generic binding, the description
> of Rockchip's AHCI controllers has been moved to its own file.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support
  2023-06-12 17:13 ` [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
@ 2023-06-18  3:10   ` Damien Le Moal
  2023-06-18  8:13     ` Heiko Stübner
  0 siblings, 1 reply; 13+ messages in thread
From: Damien Le Moal @ 2023-06-18  3:10 UTC (permalink / raw)
  To: Sebastian Reichel, Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, kernel

On 6/13/23 02:13, Sebastian Reichel wrote:
> Add all three SATA IP blocks to the RK3588 DT.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

This patch does not apply to libata for-6.5 branch. What is it based on ?

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support
  2023-06-18  3:10   ` Damien Le Moal
@ 2023-06-18  8:13     ` Heiko Stübner
  2023-06-18 11:41       ` Damien Le Moal
  0 siblings, 1 reply; 13+ messages in thread
From: Heiko Stübner @ 2023-06-18  8:13 UTC (permalink / raw)
  To: Sebastian Reichel, Damien Le Moal
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, kernel

Hi Damien,

Am Sonntag, 18. Juni 2023, 05:10:58 CEST schrieb Damien Le Moal:
> On 6/13/23 02:13, Sebastian Reichel wrote:
> > Add all three SATA IP blocks to the RK3588 DT.
> > 
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> 
> This patch does not apply to libata for-6.5 branch. What is it based on ?

I guess probably either mainline or my dts-branch [0] .

Most of the time we have series doing driver changes + devicetree changes
where subsystem maintainers pick the driver + binding patches 
(1-3 in this case) and after that I pick the devicetree changes (4-5 here).


Heiko


[0] https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/log/?h=v6.5-armsoc/dts64



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support
  2023-06-18  8:13     ` Heiko Stübner
@ 2023-06-18 11:41       ` Damien Le Moal
  0 siblings, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2023-06-18 11:41 UTC (permalink / raw)
  To: Heiko Stübner, Sebastian Reichel
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, kernel

On 6/18/23 17:13, Heiko Stübner wrote:
> Hi Damien,
> 
> Am Sonntag, 18. Juni 2023, 05:10:58 CEST schrieb Damien Le Moal:
>> On 6/13/23 02:13, Sebastian Reichel wrote:
>>> Add all three SATA IP blocks to the RK3588 DT.
>>>
>>> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>>
>> This patch does not apply to libata for-6.5 branch. What is it based on ?
> 
> I guess probably either mainline or my dts-branch [0] .
> 
> Most of the time we have series doing driver changes + devicetree changes
> where subsystem maintainers pick the driver + binding patches 
> (1-3 in this case) and after that I pick the devicetree changes (4-5 here).

OK. I will queue 1-3 only then. Please pickup 4 & 5.
Thanks !

> 
> 
> Heiko
> 
> 
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/log/?h=v6.5-armsoc/dts64
> 
> 

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/5] Add RK3588 SATA support
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
                   ` (4 preceding siblings ...)
  2023-06-12 17:13 ` [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
@ 2023-06-20  1:17 ` Damien Le Moal
  2023-07-11 14:48 ` (subset) " Heiko Stuebner
  6 siblings, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2023-06-20  1:17 UTC (permalink / raw)
  To: Sebastian Reichel, Heiko Stuebner
  Cc: Rob Herring, Krzysztof Kozlowski, Damien Le Moal, Serge Semin,
	Vinod Koul, Kishon Vijay Abraham I, linux-ide, linux-phy,
	linux-rockchip, devicetree, linux-kernel, kernel

On 6/13/23 02:13, Sebastian Reichel wrote:
> Hi,
> 
> This enables SATA support for RK3588.

Applied 1-3 to libata for-6.5 branch. Thanks !



-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: (subset) [PATCH v4 0/5] Add RK3588 SATA support
  2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
                   ` (5 preceding siblings ...)
  2023-06-20  1:17 ` [PATCH v4 0/5] Add RK3588 " Damien Le Moal
@ 2023-07-11 14:48 ` Heiko Stuebner
  6 siblings, 0 replies; 13+ messages in thread
From: Heiko Stuebner @ 2023-07-11 14:48 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Heiko Stuebner, Damien Le Moal, linux-ide, Krzysztof Kozlowski,
	linux-rockchip, linux-kernel, kernel, devicetree, Vinod Koul,
	linux-phy, Serge Semin, Kishon Vijay Abraham I, Rob Herring

On Mon, 12 Jun 2023 19:13:32 +0200, Sebastian Reichel wrote:
> This enables SATA support for RK3588.
> 
> Changes since PATCHv3:
>  * https://lore.kernel.org/all/20230608162238.50078-1-sebastian.reichel@collabora.com/
>  * Add Reviewed-by from Serge and Krzysztof to patch 1
>  * Update patch 2
>    - Add maxItems to 'clocks' property; without specifying minItems it's
>      implied to be the same
>    - Keep allOf above the properties in snps,dwc-ahci.yaml
>    - Add 'sata-port@0' to list of allowed properties
>    - Replace sata-port pattern property, so that it disallows using any
>      sata-port nodes besides @0 to override the pattern property from the
>      common binding
>  * Add Reviewed-by from Krzysztof to patch 3
> 
> [...]

Applied, thanks!

[4/5] arm64: dts: rockchip: rk3588: add combo PHYs
      commit: 6ebd55b3bba383e0523b0c014f17c97f3ce80708
[5/5] arm64: dts: rockchip: rk3588: add SATA support
      commit: 34d6c15d8e86256ef2456c604b1c8d8242720871

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-07-11 14:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 17:13 [PATCH v4 0/5] Add RK3588 SATA support Sebastian Reichel
2023-06-12 17:13 ` [PATCH v4 1/5] dt-bindings: ata: dwc-ahci: add PHY clocks Sebastian Reichel
2023-06-12 17:13 ` [PATCH v4 2/5] dt-bindings: ata: dwc-ahci: add Rockchip RK3588 Sebastian Reichel
2023-06-12 19:27   ` Serge Semin
2023-06-13  6:56   ` Krzysztof Kozlowski
2023-06-12 17:13 ` [PATCH v4 3/5] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
2023-06-12 17:13 ` [PATCH v4 4/5] arm64: dts: rockchip: rk3588: add combo PHYs Sebastian Reichel
2023-06-12 17:13 ` [PATCH v4 5/5] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
2023-06-18  3:10   ` Damien Le Moal
2023-06-18  8:13     ` Heiko Stübner
2023-06-18 11:41       ` Damien Le Moal
2023-06-20  1:17 ` [PATCH v4 0/5] Add RK3588 " Damien Le Moal
2023-07-11 14:48 ` (subset) " Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).