Skip to contentSkip to conversation

dt-bindings: soc: rockchip: add rk3576 vo1-grf syscon

PATCH Applied Frank Wang 5 participants 11 messages Oct 17, 2024 – Oct 21, 2024

Subsystems (3)
lore
Share & tools
lore

Frank Wang

author
#0 lore raw

PATCH v2 1/3 dt-bindings: soc: rockchip: add rk3576 vo1-grf syscon

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

---
Changelog:
v2:
- This is a new patch adds rk3576-vo1-grf syscon.

v1:
- none

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +2 -0
index 50d727f4b76c6..fd42217ab85e7 100644
@@ -33,6 +33,7 @@ properties:
               - rockchip,rk3576-usb-grf
               - rockchip,rk3576-usbdpphy-grf
               - rockchip,rk3576-vo0-grf
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3576-vop-grf
               - rockchip,rk3588-bigcore0-grf
               - rockchip,rk3588-bigcore1-grf
@@ -283,6 +284,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3588-vo-grf
               - rockchip,rk3588-vo0-grf
               - rockchip,rk3588-vo1-grf
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v2 2/3 dt-bindings: phy: rockchip-usbdp: add rk3576

From: Frank Wang <[email protected]>

Add compatible for the USBDP phy in the Rockchip RK3576 SoC.

---
Changelog:
v2:
- add Reviewed and Acked tag.

v1:
- https://patchwork.kernel.org/project/linux-phy/patch/[email protected]/

 Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml +1 -0
index 1f1f8863b80d0..b42f1272903d8 100644
@@ -13,6 +13,7 @@ maintainers:
 properties:
   compatible:
     enum:
+      - rockchip,rk3576-usbdp-phy
       - rockchip,rk3588-usbdp-phy
 
   reg:
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH v2 3/3 phy: rockchip: usbdp: add rk3576 device match data

In reply to Frank Wang

From: Frank Wang <[email protected]>

This adds RK3576 device match data support.

---
Changelog:
v2:
- add Reviewed and Acked tag.

v1:
- https://patchwork.kernel.org/project/linux-phy/patch/[email protected]/

 drivers/phy/rockchip/phy-rockchip-usbdp.c | 41 +++++++++++++++++++++++
 1 file changed, 41 insertions(+)
drivers/phy/rockchip/phy-rockchip-usbdp.c +41 -0
index 2c51e5c62d3eb..5b1e8a3806ed4 100644
@@ -1538,6 +1538,43 @@ static const char * const rk_udphy_rst_list[] = {
 	"init", "cmn", "lane", "pcs_apb", "pma_apb"
 };
 
+static const struct rk_udphy_cfg rk3576_udphy_cfgs = {
+	.num_phys = 1,
+	.phy_ids = { 0x2b010000 },
+	.num_rsts = ARRAY_SIZE(rk_udphy_rst_list),
+	.rst_list = rk_udphy_rst_list,
+	.grfcfg	= {
+		/* u2phy-grf */
+		.bvalid_phy_con		= RK_UDPHY_GEN_GRF_REG(0x0010, 1, 0, 0x2, 0x3),
+		.bvalid_grf_con		= RK_UDPHY_GEN_GRF_REG(0x0000, 15, 14, 0x1, 0x3),
+
+		/* usb-grf */
+		.usb3otg0_cfg		= RK_UDPHY_GEN_GRF_REG(0x0030, 15, 0, 0x1100, 0x0188),
+
+		/* usbdpphy-grf */
+		.low_pwrn		= RK_UDPHY_GEN_GRF_REG(0x0004, 13, 13, 0, 1),
+		.rx_lfps		= RK_UDPHY_GEN_GRF_REG(0x0004, 14, 14, 0, 1),
+	},
+	.vogrfcfg = {
+		{
+			.hpd_trigger	= RK_UDPHY_GEN_GRF_REG(0x0000, 11, 10, 1, 3),
+			.dp_lane_reg    = 0x0000,
+		},
+	},
+	.dp_tx_ctrl_cfg = {
+		rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+		rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+		rk3588_dp_tx_drv_ctrl_hbr2,
+		rk3588_dp_tx_drv_ctrl_hbr3,
+	},
+	.dp_tx_ctrl_cfg_typec = {
+		rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+		rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+		rk3588_dp_tx_drv_ctrl_hbr2,
+		rk3588_dp_tx_drv_ctrl_hbr3,
+	},
+};
+
 static const struct rk_udphy_cfg rk3588_udphy_cfgs = {
 	.num_phys = 2,
 	.phy_ids = {
@@ -1584,6 +1621,10 @@ static const struct rk_udphy_cfg rk3588_udphy_cfgs = {
 };
 
 static const struct of_device_id rk_udphy_dt_match[] = {
+	{
+		.compatible = "rockchip,rk3576-usbdp-phy",
+		.data = &rk3576_udphy_cfgs
+	},
 	{
 		.compatible = "rockchip,rk3588-usbdp-phy",
 		.data = &rk3588_udphy_cfgs
Signature · 1 line
2.25.1
maintainer Applied
#4 lore raw

Re: (subset) [PATCH v2 1/3] dt-bindings: soc: rockchip: add rk3576 vo1-grf syscon

In reply to Frank Wang
Quoted 6 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

Applied, thanks!

[2/3] dt-bindings: phy: rockchip-usbdp: add rk3576

      commit: b3e804ab9aad465ba7285aa5daf83656d5efc59f
[3/3] phy: rockchip: usbdp: add rk3576 device match data
      commit: a76de028c619dd18f89786805bcc7bb4d379ea9f

Best regards,

Signature · 1 line
~Vinod
#5 lore raw
In reply to Frank Wang

Hello Frank,

Quoted 10 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

---
Changelog:
v2:
- This is a new patch adds rk3576-vo1-grf syscon.

Could you, please, clarify a bit why is this additional patch needed in this series?

Quoted 27 lines

v1:
- none

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +2 -0
index 50d727f4b76c6..fd42217ab85e7 100644
@@ -33,6 +33,7 @@ properties:
               - rockchip,rk3576-usb-grf
               - rockchip,rk3576-usbdpphy-grf
               - rockchip,rk3576-vo0-grf
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3576-vop-grf
               - rockchip,rk3588-bigcore0-grf
               - rockchip,rk3588-bigcore1-grf
@@ -283,6 +284,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3588-vo-grf
               - rockchip,rk3588-vo0-grf
               - rockchip,rk3588-vo1-grf
author
#6 lore raw

Hi Dragan,

Quoted 8 lines · Dragan Simic

Hello Frank,

Quoted 5 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

Quoted 9 lines
Quoted 5 lines

---
Changelog:
v2:
 - This is a new patch adds rk3576-vo1-grf syscon.

Could you, please, clarify a bit why is this additional patch needed in this series?

I mentioned in the commit content. The usbdp-phy driver select dp lanes via configuring the vo1-grf.

Best regards,
Frank

Quoted 27 lines
Quoted 27 lines

v1:
 - none

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++

 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
index 50d727f4b76c6..fd42217ab85e7 100644
@@ -33,6 +33,7 @@ properties:

               - rockchip,rk3576-usb-grf
               - rockchip,rk3576-usbdpphy-grf
               - rockchip,rk3576-vo0-grf
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3576-vop-grf
               - rockchip,rk3588-bigcore0-grf
               - rockchip,rk3588-bigcore1-grf

Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
@@ -283,6 +284,7 @@ allOf:

         compatible:
           contains:
             enum:
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3588-vo-grf
               - rockchip,rk3588-vo0-grf
               - rockchip,rk3588-vo1-grf

#7 lore raw

Hello Frank,

Quoted 13 lines · Frank Wang
Quoted 12 lines · Dragan Simic
Quoted 10 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

---
Changelog:
v2:
 - This is a new patch adds rk3576-vo1-grf syscon.

Quoted 5 lines
Quoted 2 lines

Could you, please, clarify a bit why is this additional patch needed in this series?

I mentioned in the commit content. The usbdp-phy driver select dp lanes via configuring the vo1-grf.

Yes, I already saw that in the patch description. Though, and I apologize if I'm missing something obvious, I can't see where is it actually used in the code? Is it yet to be used in the dts(i) files?

I'd appreciate if you could clarify that just a bit further, so I can hopefully understand it better.

Quoted 33 lines
Quoted 19 lines
Quoted 19 lines

v1:
 - none

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++

 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
index 50d727f4b76c6..fd42217ab85e7 100644
@@ -33,6 +33,7 @@ properties:

               - rockchip,rk3576-usb-grf
               - rockchip,rk3576-usbdpphy-grf
               - rockchip,rk3576-vo0-grf
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3576-vop-grf
               - rockchip,rk3588-bigcore0-grf
               - rockchip,rk3588-bigcore1-grf

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
@@ -283,6 +284,7 @@ allOf:

         compatible:
           contains:
             enum:
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3588-vo-grf
               - rockchip,rk3588-vo0-grf
               - rockchip,rk3588-vo1-grf

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

author
#8 lore raw

Hi Dragan,

Quoted 22 lines · Dragan Simic

Hello Frank,

Quoted 13 lines · Frank Wang
Quoted 12 lines · Dragan Simic
Quoted 10 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

---
Changelog:
v2:
 - This is a new patch adds rk3576-vo1-grf syscon.

Quoted 5 lines
Quoted 2 lines

Could you, please, clarify a bit why is this additional patch needed in this series?

I mentioned in the commit content. The usbdp-phy driver select dp lanes via configuring the vo1-grf.

Quoted 8 lines

Yes, I already saw that in the patch description.  Though, and I apologize if I'm missing something obvious, I can't see where is it actually used in the code?  Is it yet to be used in the dts(i) files?

I'd appreciate if you could clarify that just a bit further, so I can hopefully understand it better.

Yes, the usbdp_phy node in dts(i) will assign the vo1-grf phandle like this:

usbdp_phy: phy@2b010000 {
        ...
        rockchip,vo-grf = <&vo1_grf>;
};

And the usbdp-phy driver parses it and assign to udphy->vogrf, it uses in rk_udphy_dplane_select().

The related codes have already existed in the current driver, so for RK3576, just only need to do a configuration.

Best regards,
Frank

Quoted 33 lines
Quoted 33 lines
Quoted 19 lines
Quoted 19 lines

v1:
 - none

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++

 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
index 50d727f4b76c6..fd42217ab85e7 100644
@@ -33,6 +33,7 @@ properties:

               - rockchip,rk3576-usb-grf
               - rockchip,rk3576-usbdpphy-grf
               - rockchip,rk3576-vo0-grf
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3576-vop-grf
               - rockchip,rk3588-bigcore0-grf
               - rockchip,rk3588-bigcore1-grf

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
@@ -283,6 +284,7 @@ allOf:

         compatible:
           contains:
             enum:
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3588-vo-grf
               - rockchip,rk3588-vo0-grf
               - rockchip,rk3588-vo1-grf

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

Reviewed-by
#9 lore raw

Hello Frank,

Quoted 36 lines · Frank Wang
Quoted 20 lines · Dragan Simic
Quoted 13 lines · Frank Wang
Quoted 12 lines · Dragan Simic
Quoted 10 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

---
Changelog:
v2:
 - This is a new patch adds rk3576-vo1-grf syscon.

Quoted 5 lines
Quoted 2 lines

Could you, please, clarify a bit why is this additional patch needed in this series?

I mentioned in the commit content. The usbdp-phy driver select dp lanes via configuring the vo1-grf.

Quoted 7 lines

Yes, I already saw that in the patch description.  Though, and I apologize if I'm missing something obvious, I can't see where is it actually used in the code?  Is it yet to be used in the dts(i) files?

I'd appreciate if you could clarify that just a bit further, so I can hopefully understand it better.

Yes, the usbdp_phy node in dts(i) will assign the vo1-grf phandle like this:

usbdp_phy: phy@2b010000 {
        ...
        rockchip,vo-grf = <&vo1_grf>;
};

Quoted 5 lines

And the usbdp-phy driver parses it and assign to udphy->vogrf, it uses in rk_udphy_dplane_select().

The related codes have already existed in the current driver, so for RK3576, just only need to do a configuration.

Great, thanks for the detailed explanation! This confirms my latest assumption and everything is looking good, so please free to include:

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines

v1:
 - none

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++

 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
index 50d727f4b76c6..fd42217ab85e7 100644
@@ -33,6 +33,7 @@ properties:

               - rockchip,rk3576-usb-grf
               - rockchip,rk3576-usbdpphy-grf
               - rockchip,rk3576-vo0-grf
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3576-vop-grf
               - rockchip,rk3588-bigcore0-grf
               - rockchip,rk3588-bigcore1-grf

Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
@@ -283,6 +284,7 @@ allOf:

         compatible:
           contains:
             enum:
+              - rockchip,rk3576-vo1-grf
               - rockchip,rk3588-vo-grf
               - rockchip,rk3588-vo0-grf
               - rockchip,rk3588-vo1-grf

maintainer Applied
#10 lore raw

Re: (subset) [PATCH v2 1/3] dt-bindings: soc: rockchip: add rk3576 vo1-grf syscon

In reply to Frank Wang
Quoted 6 lines · Frank Wang

From: Frank Wang <[email protected]>

Add rockchip,rk3576-vo1-grf syscon compatible, the vo1-grf is configured in usbdp phy driver.

Applied, thanks!

[1/3] dt-bindings: soc: rockchip: add rk3576 vo1-grf syscon

      commit: ab79914808df7163564bffbc9f79801898fa906d

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>