linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add RK3588 SATA support
@ 2023-05-22 17:34 Sebastian Reichel
  2023-05-22 17:34 ` [PATCH v2 1/6] dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon Sebastian Reichel
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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 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 (6):
  dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon
  dt-bindings: ata: ahci: add RK3588 AHCI controller
  dt-bindings: ata: ahci: dwc: enforce rockchip clocks
  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/snps,dwc-ahci-common.yaml    |  8 +-
 .../bindings/ata/snps,dwc-ahci.yaml           | 40 +++++++--
 .../phy/phy-rockchip-naneng-combphy.yaml      |  8 +-
 .../devicetree/bindings/soc/rockchip/grf.yaml |  1 +
 arch/arm64/boot/dts/rockchip/rk3588.dtsi      | 44 +++++++++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     | 90 +++++++++++++++++++
 6 files changed, 183 insertions(+), 8 deletions(-)

-- 
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 1/6] dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
@ 2023-05-22 17:34 ` Sebastian Reichel
  2023-05-22 17:34 ` [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller Sebastian Reichel
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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, Rob Herring

The pipe-phy syscon is used by rockchip,rk3588-naneng-combphy,
which in turn is the PHY for USB3, PCIe and SATA.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
index e8fca419cc8e..bf2370c66ed9 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
@@ -24,6 +24,7 @@ properties:
               - rockchip,rk3588-bigcore1-grf
               - rockchip,rk3588-ioc
               - rockchip,rk3588-php-grf
+              - rockchip,rk3588-pipe-phy-grf
               - rockchip,rk3588-sys-grf
               - rockchip,rk3588-pcie3-phy-grf
               - rockchip,rk3588-pcie3-pipe-grf
-- 
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
  2023-05-22 17:34 ` [PATCH v2 1/6] dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon Sebastian Reichel
@ 2023-05-22 17:34 ` Sebastian Reichel
  2023-05-22 19:33   ` Conor Dooley
  2023-06-04 18:58   ` Serge Semin
  2023-05-22 17:34 ` [PATCH v2 3/6] dt-bindings: ata: ahci: dwc: enforce rockchip clocks Sebastian Reichel
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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

Just like RK3568, the RK3588 has a DWC based AHCI controller.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../devicetree/bindings/ata/snps,dwc-ahci-common.yaml     | 8 ++++++--
 Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml  | 6 ++++--
 2 files changed, 10 insertions(+), 4 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
 
diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
index 5afa4b57ce20..c6a0d6c8b62c 100644
--- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
+++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
@@ -23,9 +23,11 @@ properties:
         const: snps,dwc-ahci
       - description: SPEAr1340 AHCI SATA device
         const: snps,spear-ahci
-      - description: Rockhip RK3568 AHCI controller
+      - description: Rockhip AHCI controller
         items:
-          - const: rockchip,rk3568-dwc-ahci
+          - enum:
+              - rockchip,rk3568-dwc-ahci
+              - rockchip,rk3588-dwc-ahci
           - const: snps,dwc-ahci
 
 patternProperties:
-- 
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 3/6] dt-bindings: ata: ahci: dwc: enforce rockchip clocks
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
  2023-05-22 17:34 ` [PATCH v2 1/6] dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon Sebastian Reichel
  2023-05-22 17:34 ` [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller Sebastian Reichel
@ 2023-05-22 17:34 ` Sebastian Reichel
  2023-06-04 19:11   ` Serge Semin
  2023-05-22 17:34 ` [PATCH v2 4/6] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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

Provide a specific list of clocks allowed for RK3568 and RK3588
based DWC AHCI controllers.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../bindings/ata/snps,dwc-ahci.yaml           | 34 +++++++++++++++++--
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
index c6a0d6c8b62c..37830185b9b5 100644
--- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
+++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
@@ -13,9 +13,6 @@ description:
   This document defines device tree bindings for the generic Synopsys DWC
   implementation of the AHCI SATA controller.
 
-allOf:
-  - $ref: snps,dwc-ahci-common.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -41,6 +38,37 @@ required:
   - reg
   - interrupts
 
+allOf:
+  - $ref: snps,dwc-ahci-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3588-dwc-ahci
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: sata
+            - const: pmalive
+            - const: rxoob
+            - const: ref
+            - const: asic
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3568-dwc-ahci
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: sata
+            - const: pmalive
+            - const: rxoob
+
 unevaluatedProperties: false
 
 examples:
-- 
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 4/6] dt-bindings: phy: rockchip: rk3588 has two reset lines
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
                   ` (2 preceding siblings ...)
  2023-05-22 17:34 ` [PATCH v2 3/6] dt-bindings: ata: ahci: dwc: enforce rockchip clocks Sebastian Reichel
@ 2023-05-22 17:34 ` Sebastian Reichel
  2023-05-22 19:24   ` Conor Dooley
  2023-05-22 17:34 ` [PATCH v2 5/6] arm64: dts: rockchip: rk3588: add combo PHYs Sebastian Reichel
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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

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

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../bindings/phy/phy-rockchip-naneng-combphy.yaml         | 8 +++++++-
 1 file changed, 7 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..82550a5c2ed5 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
-- 
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 5/6] arm64: dts: rockchip: rk3588: add combo PHYs
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
                   ` (3 preceding siblings ...)
  2023-05-22 17:34 ` [PATCH v2 4/6] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
@ 2023-05-22 17:34 ` Sebastian Reichel
  2023-05-22 17:34 ` [PATCH v2 6/6] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 6/6] arm64: dts: rockchip: rk3588: add SATA support
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
                   ` (4 preceding siblings ...)
  2023-05-22 17:34 ` [PATCH v2 5/6] arm64: dts: rockchip: rk3588: add combo PHYs Sebastian Reichel
@ 2023-05-22 17:34 ` Sebastian Reichel
  2023-05-31 11:35 ` [PATCH v2 0/6] Add RK3588 " Serge Semin
  2023-06-06 17:07 ` (subset) " Heiko Stuebner
  7 siblings, 0 replies; 13+ messages in thread
From: Sebastian Reichel @ 2023-05-22 17:34 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


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 4/6] dt-bindings: phy: rockchip: rk3588 has two reset lines
  2023-05-22 17:34 ` [PATCH v2 4/6] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
@ 2023-05-22 19:24   ` Conor Dooley
  0 siblings, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2023-05-22 19:24 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Heiko Stuebner, 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


[-- Attachment #1.1: Type: text/plain, Size: 1216 bytes --]

Hey Sebastian,

On Mon, May 22, 2023 at 07:34:21PM +0200, Sebastian Reichel wrote:
> The RK3588 has two reset lines for the combphy. One for the
> APB interface and one for the actual PHY.

But the 68 only has one? Should per-compatible enforcement be added
like you added for the clocks?

> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  .../bindings/phy/phy-rockchip-naneng-combphy.yaml         | 8 +++++++-
>  1 file changed, 7 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..82550a5c2ed5 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
> -- 
> 2.39.2
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller
  2023-05-22 17:34 ` [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller Sebastian Reichel
@ 2023-05-22 19:33   ` Conor Dooley
  2023-06-04 18:58   ` Serge Semin
  1 sibling, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2023-05-22 19:33 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Heiko Stuebner, 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


[-- Attachment #1.1: Type: text/plain, Size: 1743 bytes --]

On Mon, May 22, 2023 at 07:34:19PM +0200, Sebastian Reichel wrote:
> Just like RK3568, the RK3588 has a DWC based AHCI controller.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  .../devicetree/bindings/ata/snps,dwc-ahci-common.yaml     | 8 ++++++--
>  Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml  | 6 ++++--
>  2 files changed, 10 insertions(+), 4 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

My brain is failing me at the moment, what is the reason for adding
these into the middle of the list, as opposed to tacking them onto the
end? Apologies if this came up on some past version that Rob or
Krzysztof had a look at.

Cheers,
Conor.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 0/6] Add RK3588 SATA support
  2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
                   ` (5 preceding siblings ...)
  2023-05-22 17:34 ` [PATCH v2 6/6] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
@ 2023-05-31 11:35 ` Serge Semin
  2023-06-06 17:07 ` (subset) " Heiko Stuebner
  7 siblings, 0 replies; 13+ messages in thread
From: Serge Semin @ 2023-05-31 11:35 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

Hello Sebastian

On Mon, May 22, 2023 at 07:34:17PM +0200, Sebastian Reichel wrote:
> Hi,
> 
> This enables SATA support for RK3588.

Thanks for the updated series. I'll have a look at the DW AHCI SATA
part of it on this week.

-Serge(y)

> 
> 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 (6):
>   dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon
>   dt-bindings: ata: ahci: add RK3588 AHCI controller
>   dt-bindings: ata: ahci: dwc: enforce rockchip clocks
>   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/snps,dwc-ahci-common.yaml    |  8 +-
>  .../bindings/ata/snps,dwc-ahci.yaml           | 40 +++++++--
>  .../phy/phy-rockchip-naneng-combphy.yaml      |  8 +-
>  .../devicetree/bindings/soc/rockchip/grf.yaml |  1 +
>  arch/arm64/boot/dts/rockchip/rk3588.dtsi      | 44 +++++++++
>  arch/arm64/boot/dts/rockchip/rk3588s.dtsi     | 90 +++++++++++++++++++
>  6 files changed, 183 insertions(+), 8 deletions(-)
> 
> -- 
> 2.39.2
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller
  2023-05-22 17:34 ` [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller Sebastian Reichel
  2023-05-22 19:33   ` Conor Dooley
@ 2023-06-04 18:58   ` Serge Semin
  1 sibling, 0 replies; 13+ messages in thread
From: Serge Semin @ 2023-06-04 18:58 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, May 22, 2023 at 07:34:19PM +0200, Sebastian Reichel wrote:
> Just like RK3568, the RK3588 has a DWC based AHCI controller.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  .../devicetree/bindings/ata/snps,dwc-ahci-common.yaml     | 8 ++++++--
>  Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml  | 6 ++++--
>  2 files changed, 10 insertions(+), 4 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

This part looks good but as I mentioned in my comment to the previous
patchset revision these are generic clocks. Extending the common
schema could be done in a framework of a preparation patch with
the justification described in my comment back then.

>  
> diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> index 5afa4b57ce20..c6a0d6c8b62c 100644
> --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> @@ -23,9 +23,11 @@ properties:
>          const: snps,dwc-ahci
>        - description: SPEAr1340 AHCI SATA device
>          const: snps,spear-ahci

> -      - description: Rockhip RK3568 AHCI controller
> +      - description: Rockhip AHCI controller
>          items:
> -          - const: rockchip,rk3568-dwc-ahci
> +          - enum:
> +              - rockchip,rk3568-dwc-ahci
> +              - rockchip,rk3588-dwc-ahci

Regarding this part. I would suggest to just create a separate
DT-schema instead of extending the generic one. See my comment to the
next patch in the series and my suggestion posted in a comment to
the previous patchset revision.

-Serge(y)

>            - const: snps,dwc-ahci
>  
>  patternProperties:
> -- 
> 2.39.2
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 3/6] dt-bindings: ata: ahci: dwc: enforce rockchip clocks
  2023-05-22 17:34 ` [PATCH v2 3/6] dt-bindings: ata: ahci: dwc: enforce rockchip clocks Sebastian Reichel
@ 2023-06-04 19:11   ` Serge Semin
  0 siblings, 0 replies; 13+ messages in thread
From: Serge Semin @ 2023-06-04 19:11 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, May 22, 2023 at 07:34:20PM +0200, Sebastian Reichel wrote:
> Provide a specific list of clocks allowed for RK3568 and RK3588
> based DWC AHCI controllers.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  .../bindings/ata/snps,dwc-ahci.yaml           | 34 +++++++++++++++++--
>  1 file changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> index c6a0d6c8b62c..37830185b9b5 100644
> --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml
> @@ -13,9 +13,6 @@ description:
>    This document defines device tree bindings for the generic Synopsys DWC
>    implementation of the AHCI SATA controller.
>  
> -allOf:
> -  - $ref: snps,dwc-ahci-common.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -41,6 +38,37 @@ required:
>    - reg
>    - interrupts
>  
> +allOf:
> +  - $ref: snps,dwc-ahci-common.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3588-dwc-ahci
> +    then:
> +      properties:
> +        clock-names:
> +          items:
> +            - const: sata
> +            - const: pmalive
> +            - const: rxoob
> +            - const: ref
> +            - const: asic
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3568-dwc-ahci
> +    then:
> +      properties:
> +        clock-names:
> +          items:
> +            - const: sata
> +            - const: pmalive
> +            - const: rxoob
> +

As I already suggested here
https://lore.kernel.org/all/20230421192822.yckihqlk2vlkueyc@mobilestation/
let's create a separate DT-schema for the Rockchip AHCI SATA
controllers. Please see the way it's done for Baikal-T1 AHCI SATA
here: Documentation/devicetree/bindings/ata/baikal,bt1-ahci.yaml
Your generic schema patch doesn't provide a full hardware constraints
(what about resets, number of ports, etc?), but makes the generic
DW AHCI SATA controller DT-schema harder to read.

* Don't forget to add the "select: ..." property to prevent your
DT-schema from being applied to all the "snps,dwc-ahci"-compatible
DT-nodes (see my comment to the previous patchset revision).
Alternatively you can just drop the generic DW AHCI compatible string
from the DT-files (but in this case you would need to add vendor-specific
compatible string to the driver).

-Serge(y)

>  unevaluatedProperties: false
>  
>  examples:
> -- 
> 2.39.2
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

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

On Mon, 22 May 2023 19:34:17 +0200, Sebastian Reichel wrote:
> This enables SATA support for RK3588.
> 
> 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
> 
> [...]

Applied, thanks!

[1/6] dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon
      commit: ea85370df14011255c60e1951ef4ef749806aa5c

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2023-06-06 17:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 17:34 [PATCH v2 0/6] Add RK3588 SATA support Sebastian Reichel
2023-05-22 17:34 ` [PATCH v2 1/6] dt-bindings: soc: rockchip: add rk3588 pipe-phy syscon Sebastian Reichel
2023-05-22 17:34 ` [PATCH v2 2/6] dt-bindings: ata: ahci: add RK3588 AHCI controller Sebastian Reichel
2023-05-22 19:33   ` Conor Dooley
2023-06-04 18:58   ` Serge Semin
2023-05-22 17:34 ` [PATCH v2 3/6] dt-bindings: ata: ahci: dwc: enforce rockchip clocks Sebastian Reichel
2023-06-04 19:11   ` Serge Semin
2023-05-22 17:34 ` [PATCH v2 4/6] dt-bindings: phy: rockchip: rk3588 has two reset lines Sebastian Reichel
2023-05-22 19:24   ` Conor Dooley
2023-05-22 17:34 ` [PATCH v2 5/6] arm64: dts: rockchip: rk3588: add combo PHYs Sebastian Reichel
2023-05-22 17:34 ` [PATCH v2 6/6] arm64: dts: rockchip: rk3588: add SATA support Sebastian Reichel
2023-05-31 11:35 ` [PATCH v2 0/6] Add RK3588 " Serge Semin
2023-06-06 17:07 ` (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).