Skip to contentSkip to conversation

clk: rockchip: rk3328: Add SCLK_USB3OTG_REF support

PATCH In review Jonas Karlman 2 participants 2 messages May 1, 2024 – May 7, 2024

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

PATCH 1/1 clk: rockchip: rk3328: Add SCLK_USB3OTG_REF support

The SCLK_USB3OTG_REF clocks is used as reference clock for USB3 block.

Add simple support to get rate of SCLK_USB3OTG_REF clocks to fix reference clock period configuration.

---
This has been runtime tested on a Rock64 and NanoPi R2S Plus.

---
 drivers/clk/rockchip/clk_rk3328.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/clk/rockchip/clk_rk3328.c +4 -0
index 87075ec71340..314b903eaa03 100644
@@ -706,6 +706,9 @@ static ulong rk3328_clk_get_rate(struct clk *clk)
 	case PCLK_HDMIPHY:
 		rate = rk3328_hdmiphy_get_clk(priv->cru);
 		break;
+	case SCLK_USB3OTG_REF:
+		rate = OSC_HZ;
+		break;
 	default:
 		return -ENOENT;
 	}
@@ -780,6 +783,7 @@ static ulong rk3328_clk_set_rate(struct clk *clk, ulong rate)
 	case PCLK_DDR:
 	case ACLK_GMAC:
 	case PCLK_GMAC:
+	case SCLK_USB3OTG_REF:
 	case SCLK_USB3OTG_SUSPEND:
 	case USB480M:
 		return 0;
Signature · 1 line
2.43.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jonas Karlman

The SCLK_USB3OTG_REF clocks is used as reference clock for USB3 block.

Add simple support to get rate of SCLK_USB3OTG_REF clocks to fix reference clock period configuration.

Thanks,
- Kever

Quoted 28 lines

---
This has been runtime tested on a Rock64 and NanoPi R2S Plus.

---
  drivers/clk/rockchip/clk_rk3328.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/clk/rockchip/clk_rk3328.c +4 -0
index 87075ec71340..314b903eaa03 100644
@@ -706,6 +706,9 @@ static ulong rk3328_clk_get_rate(struct clk *clk)
  	case PCLK_HDMIPHY:
  		rate = rk3328_hdmiphy_get_clk(priv->cru);
  		break;
+	case SCLK_USB3OTG_REF:
+		rate = OSC_HZ;
+		break;
  	default:
  		return -ENOENT;
  	}
@@ -780,6 +783,7 @@ static ulong rk3328_clk_set_rate(struct clk *clk, ulong rate)
  	case PCLK_DDR:
  	case ACLK_GMAC:
  	case PCLK_GMAC:
+	case SCLK_USB3OTG_REF:
  	case SCLK_USB3OTG_SUSPEND:
  	case USB480M:
  		return 0;