Skip to contentSkip to conversation

ARM: rmobile: beacon-renesom: Enable USB and ethernet ref clocks

PATCH Superseded Adam Ford 2 participants 7 messages Aug 24, 2021 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/2 ARM: rmobile: beacon-renesom: Enable USB and ethernet ref clocks

There are two versaclock programmable clock chips used to provide reference clocks for both USB and Ethernet. Enable the driver in the configs to run these clocks.

configs/r8a774a1_beacon_defconfig +2 -0
index 7ba4ac05f5..002b91176f 100644
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CLK=y
+CONFIG_CLK_CCF=y
 CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y
 CONFIG_RCAR_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
configs/r8a774b1_beacon_defconfig +2 -0
index 44528cd2e1..389e0d9ccc 100644
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CLK=y
+CONFIG_CLK_CCF=y
 CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y
 CONFIG_RCAR_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
configs/r8a774e1_beacon_defconfig +2 -0
index 9cde39f467..cb9f4e2ffa 100644
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CLK=y
+CONFIG_CLK_CCF=y
 CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y
 CONFIG_RCAR_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 ARM: rmobile: beacon-renesom: Enable Ethernet

Now that the versaclock driver is available, point the ethernet node at these clocks and configure the RGMII to enable Ethernet.

arch/arm/dts/beacon-renesom-som.dtsi +3 -0
index d30bab3c8b..9fe541b607 100644
@@ -60,8 +60,11 @@
 	pinctrl-0 = <&avb_pins>;
 	pinctrl-names = "default";
 	phy-handle = <&phy0>;
+	phy-mode = "rgmii-txid";
 	rx-internal-delay-ps = <1800>;
 	tx-internal-delay-ps = <2000>;
+	clocks = <&cpg CPG_MOD 812>, <&versaclock5 4>;
+	clock-names = "fck", "refclk";
 	status = "okay";
 
 	phy0: ethernet-phy@0 {
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 2/2] ARM: rmobile: beacon-renesom: Enable Ethernet

Quoted 10 lines · Adam Ford

Now that the versaclock driver is available, point the ethernet node at these clocks and configure the RGMII to enable Ethernet.

arch/arm/dts/beacon-renesom-som.dtsi +0 -0
index d30bab3c8b..9fe541b607 100644

arch/arm/dts/beacon-renesom-som.dtsi line 67

Quoted 8 lines
arch/arm/dts/beacon-renesom-som.dtsi +3 -0
@@ -60,8 +60,11 @@
  	pinctrl-0 = <&avb_pins>;
  	pinctrl-names = "default";
  	phy-handle = <&phy0>;
+	phy-mode = "rgmii-txid";
  	rx-internal-delay-ps = <1800>;
  	tx-internal-delay-ps = <2000>;
+	clocks = <&cpg CPG_MOD 812>, <&versaclock5 4>;
+	clock-names = "fck", "refclk";

The subject should be ARM: dts: rmobile, I can fix that, but see 1/2 comment in a bit.

#3 lore raw
In reply to Adam Ford
Quoted 11 lines · Adam Ford

There are two versaclock programmable clock chips used to provide reference clocks for both USB and Ethernet. Enable the driver in the configs to run these clocks.

configs/r8a774a1_beacon_defconfig +0 -0
index 7ba4ac05f5..002b91176f 100644

configs/r8a774a1_beacon_defconfig CONFIG_VERSION_VARIABLE=y · line 44

Quoted 6 lines
configs/r8a774a1_beacon_defconfig +2 -0
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
  CONFIG_REGMAP=y
  CONFIG_SYSCON=y
  CONFIG_CLK=y
+CONFIG_CLK_CCF=y
  CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y

There is a lot of duplication here, look into arch/arm/mach-rmobile/Kconfig.64 and for TARGET_BEACON_RZG2M (where are the others?) add "select CLK_VERSACLOCK" . You can also fix it up and add whatever other mandatory config options should be enabled for that platform. And then you reduce the defconfig too.

author
#4 lore raw
Quoted 17 lines · Marek Vasut
Quoted 15 lines · Adam Ford

There are two versaclock programmable clock chips used to provide reference clocks for both USB and Ethernet. Enable the driver in the configs to run these clocks.

configs/r8a774a1_beacon_defconfig +1 -0
index 7ba4ac05f5..002b91176f 100644
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
  CONFIG_REGMAP=y
  CONFIG_SYSCON=y
  CONFIG_CLK=y
+CONFIG_CLK_CCF=y
Quoted 8 lines

configs/r8a774a1_beacon_defconfig CONFIG_VERSION_VARIABLE=y · line 44

Quoted 2 lines
configs/r8a774a1_beacon_defconfig +1 -0
  CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y

There is a lot of duplication here, look into arch/arm/mach-rmobile/Kconfig.64 and for TARGET_BEACON_RZG2M (where are the others?) add "select CLK_VERSACLOCK" . You can also fix it up and add whatever other mandatory config options should be enabled for that platform. And then you reduce the defconfig too.

Are you OK if i put that into board/beacon/beacon-rzg2m/Kconfig? there is a check to see if TARGET_BEACON_RZG2H || TARGET_BEACON_RZG2M || TARGET_BEACON_RZG2N is set. From there, i should be able to select the common options that are required and it won't have to be duplicated in either the defconfigs or the arch/arm/mach-rmobile/Kconfig.64

adam

author
#5 lore raw
Quoted 28 lines · Adam Ford
Quoted 17 lines · Marek Vasut
Quoted 15 lines · Adam Ford

There are two versaclock programmable clock chips used to provide reference clocks for both USB and Ethernet. Enable the driver in the configs to run these clocks.

configs/r8a774a1_beacon_defconfig +1 -0
index 7ba4ac05f5..002b91176f 100644
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
  CONFIG_REGMAP=y
  CONFIG_SYSCON=y
  CONFIG_CLK=y
+CONFIG_CLK_CCF=y
Quoted 8 lines

configs/r8a774a1_beacon_defconfig CONFIG_VERSION_VARIABLE=y · line 44

Quoted 2 lines
configs/r8a774a1_beacon_defconfig +1 -0
  CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y

There is a lot of duplication here, look into arch/arm/mach-rmobile/Kconfig.64 and for TARGET_BEACON_RZG2M (where are the others?) add "select CLK_VERSACLOCK" . You can also fix it up and add whatever other mandatory config options should be enabled for that platform. And then you reduce the defconfig too.

Quoted 6 lines

Are you OK if i put that into board/beacon/beacon-rzg2m/Kconfig? there is a check to see if TARGET_BEACON_RZG2H || TARGET_BEACON_RZG2M || TARGET_BEACON_RZG2N is set. From there, i should be able to select the common options that are required and it won't have to be duplicated in either the defconfigs or the arch/arm/mach-rmobile/Kconfig.64

My idea won't work. sorry for the noise. I'll re-do it as you requested.

Quoted 2 lines

adam

#6 lore raw
In reply to Adam Ford
Quoted 27 lines · Adam Ford
Quoted 17 lines · Marek Vasut
Quoted 15 lines · Adam Ford

There are two versaclock programmable clock chips used to provide reference clocks for both USB and Ethernet. Enable the driver in the configs to run these clocks.

configs/r8a774a1_beacon_defconfig +1 -0
index 7ba4ac05f5..002b91176f 100644
@@ -39,7 +39,9 @@ CONFIG_VERSION_VARIABLE=y
   CONFIG_REGMAP=y
   CONFIG_SYSCON=y
   CONFIG_CLK=y
+CONFIG_CLK_CCF=y
Quoted 8 lines

configs/r8a774a1_beacon_defconfig CONFIG_VERSION_VARIABLE=y · line 44

Quoted 2 lines
configs/r8a774a1_beacon_defconfig +1 -0
   CONFIG_CLK_RENESAS=y
+CONFIG_CLK_VERSACLOCK=y

There is a lot of duplication here, look into arch/arm/mach-rmobile/Kconfig.64 and for TARGET_BEACON_RZG2M (where are the others?) add "select CLK_VERSACLOCK" . You can also fix it up and add whatever other mandatory config options should be enabled for that platform. And then you reduce the defconfig too.

Quoted 6 lines

Are you OK if i put that into board/beacon/beacon-rzg2m/Kconfig? there is a check to see if TARGET_BEACON_RZG2H || TARGET_BEACON_RZG2M || TARGET_BEACON_RZG2N is set. From there, i should be able to select the common options that are required and it won't have to be duplicated in either the defconfigs or the arch/arm/mach-rmobile/Kconfig.64

Yeah, the less duplication the better.