[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.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 7ba4ac05f5..002b91176f 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -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 diff --git a/configs/r8a774b1_beacon_defconfig b/configs/r8a774b1_beacon_defconfig index 44528cd2e1..389e0d9ccc 100644 --- a/configs/r8a774b1_beacon_defconfig +++ b/configs/r8a774b1_beacon_defconfig @@ -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 diff --git a/configs/r8a774e1_beacon_defconfig b/configs/r8a774e1_beacon_defconfig index 9cde39f467..cb9f4e2ffa 100644 --- a/configs/r8a774e1_beacon_defconfig +++ b/configs/r8a774e1_beacon_defconfig @@ -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

Now that the versaclock driver is available, point the ethernet node at these clocks and configure the RGMII to enable Ethernet.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/arch/arm/dts/beacon-renesom-som.dtsi b/arch/arm/dts/beacon-renesom-som.dtsi index d30bab3c8b..9fe541b607 100644 --- a/arch/arm/dts/beacon-renesom-som.dtsi +++ b/arch/arm/dts/beacon-renesom-som.dtsi @@ -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 {

On 8/24/21 6:43 PM, Adam Ford wrote:
Now that the versaclock driver is available, point the ethernet node at these clocks and configure the RGMII to enable Ethernet.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/arch/arm/dts/beacon-renesom-som.dtsi b/arch/arm/dts/beacon-renesom-som.dtsi index d30bab3c8b..9fe541b607 100644 --- a/arch/arm/dts/beacon-renesom-som.dtsi +++ b/arch/arm/dts/beacon-renesom-som.dtsi @@ -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.

On 8/24/21 6:43 PM, Adam Ford wrote:
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.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 7ba4ac05f5..002b91176f 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -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.

On Tue, Aug 24, 2021 at 1:02 PM Marek Vasut marex@denx.de wrote:
On 8/24/21 6:43 PM, Adam Ford wrote:
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.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 7ba4ac05f5..002b91176f 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -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.
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

On Tue, Aug 24, 2021 at 1:13 PM Adam Ford aford173@gmail.com wrote:
On Tue, Aug 24, 2021 at 1:02 PM Marek Vasut marex@denx.de wrote:
On 8/24/21 6:43 PM, Adam Ford wrote:
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.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 7ba4ac05f5..002b91176f 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -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.
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.
adam

On 8/24/21 8:13 PM, Adam Ford wrote:
On Tue, Aug 24, 2021 at 1:02 PM Marek Vasut marex@denx.de wrote:
On 8/24/21 6:43 PM, Adam Ford wrote:
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.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 7ba4ac05f5..002b91176f 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -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.
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.
participants (2)
-
Adam Ford
-
Marek Vasut