[PATCH net 3/3] riscv: dts: thead: Add APB clocks for TH1520 GMACs

Yao Zi posted 3 patches 2 months, 1 week ago
There is a newer version of this series
[PATCH net 3/3] riscv: dts: thead: Add APB clocks for TH1520 GMACs
Posted by Yao Zi 2 months, 1 week ago
Describe perisys-apb4-hclk as the APB clock for TH1520 SoC, which is
essential for accessing GMAC glue registers.

Fixes: 7e756671a664 ("riscv: dts: thead: Add TH1520 ethernet nodes")
Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 arch/riscv/boot/dts/thead/th1520.dtsi | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index 42724bf7e90e..03f1d7319049 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -297,8 +297,9 @@ gmac1: ethernet@ffe7060000 {
 			reg-names = "dwmac", "apb";
 			interrupts = <67 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
-			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC1>;
-			clock-names = "stmmaceth", "pclk";
+			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC1>,
+				 <&clk CLK_PERISYS_APB4_HCLK>;
+			clock-names = "stmmaceth", "pclk", "apb";
 			snps,pbl = <32>;
 			snps,fixed-burst;
 			snps,multicast-filter-bins = <64>;
@@ -319,8 +320,9 @@ gmac0: ethernet@ffe7070000 {
 			reg-names = "dwmac", "apb";
 			interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
-			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC0>;
-			clock-names = "stmmaceth", "pclk";
+			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC0>,
+				 <&clk CLK_PERISYS_APB4_HCLK>;
+			clock-names = "stmmaceth", "pclk", "apb";
 			snps,pbl = <32>;
 			snps,fixed-burst;
 			snps,multicast-filter-bins = <64>;
-- 
2.50.1
Re: [PATCH net 3/3] riscv: dts: thead: Add APB clocks for TH1520 GMACs
Posted by Drew Fustini 2 months, 1 week ago
On Tue, Jul 29, 2025 at 09:37:34AM +0000, Yao Zi wrote:
> Describe perisys-apb4-hclk as the APB clock for TH1520 SoC, which is
> essential for accessing GMAC glue registers.
> 
> Fixes: 7e756671a664 ("riscv: dts: thead: Add TH1520 ethernet nodes")
> Signed-off-by: Yao Zi <ziyao@disroot.org>
> ---
>  arch/riscv/boot/dts/thead/th1520.dtsi | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
> index 42724bf7e90e..03f1d7319049 100644
> --- a/arch/riscv/boot/dts/thead/th1520.dtsi
> +++ b/arch/riscv/boot/dts/thead/th1520.dtsi
> @@ -297,8 +297,9 @@ gmac1: ethernet@ffe7060000 {
>  			reg-names = "dwmac", "apb";
>  			interrupts = <67 IRQ_TYPE_LEVEL_HIGH>;
>  			interrupt-names = "macirq";
> -			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC1>;
> -			clock-names = "stmmaceth", "pclk";
> +			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC1>,
> +				 <&clk CLK_PERISYS_APB4_HCLK>;
> +			clock-names = "stmmaceth", "pclk", "apb";
>  			snps,pbl = <32>;
>  			snps,fixed-burst;
>  			snps,multicast-filter-bins = <64>;
> @@ -319,8 +320,9 @@ gmac0: ethernet@ffe7070000 {
>  			reg-names = "dwmac", "apb";
>  			interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
>  			interrupt-names = "macirq";
> -			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC0>;
> -			clock-names = "stmmaceth", "pclk";
> +			clocks = <&clk CLK_GMAC_AXI>, <&clk CLK_GMAC0>,
> +				 <&clk CLK_PERISYS_APB4_HCLK>;
> +			clock-names = "stmmaceth", "pclk", "apb";
>  			snps,pbl = <32>;
>  			snps,fixed-burst;
>  			snps,multicast-filter-bins = <64>;
> -- 
> 2.50.1
> 

Thank you for determining that this clock is needed for the GMAC.

Reviewed-by: Drew Fustini <fustini@kernel.org>