2023-01-11 06:52:09

by Anand Moon

[permalink] [raw]
Subject: [PATCHv4 linux-next 1/4] dt-bindings: net: rockchip-dwmac: fix rv1126 compatible warning

Fix compatible string for RV1126 gmac, and constrain it to
be compatible with Synopsys dwmac 4.20a.

fix below warning
$ make CHECK_DTBS=y rv1126-edgeble-neu2-io.dtb
arch/arm/boot/dts/rv1126-edgeble-neu2-io.dtb: ethernet@ffc40000:
compatible: 'oneOf' conditional failed, one must be fixed:
['rockchip,rv1126-gmac', 'snps,dwmac-4.20a'] is too long
'rockchip,rv1126-gmac' is not one of ['rockchip,rk3568-gmac', 'rockchip,rk3588-gmac']

Fixes: b36fe2f43662 ("dt-bindings: net: rockchip-dwmac: add rv1126 compatible")
Reviewed-by: Jagan Teki <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Anand Moon <[email protected]>
---
v4: none
v3: added Ack and Rev from Rob and Jagan.
v2: drop SoB of Jagan Teki
added Fix tags and update the commit message of the warning.
---
Documentation/devicetree/bindings/net/rockchip-dwmac.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
index 42fb72b6909d..04936632fcbb 100644
--- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
@@ -49,11 +49,11 @@ properties:
- rockchip,rk3368-gmac
- rockchip,rk3399-gmac
- rockchip,rv1108-gmac
- - rockchip,rv1126-gmac
- items:
- enum:
- rockchip,rk3568-gmac
- rockchip,rk3588-gmac
+ - rockchip,rv1126-gmac
- const: snps,dwmac-4.20a

clocks:
--
2.39.0


2023-01-11 07:03:04

by Anand Moon

[permalink] [raw]
Subject: [PATCHv4 linux-next 4/4] ARM: dts: rockchip: rv1126: Enable Ethernet for Neu2-IO

Rockchip RV1126 has GMAC 10/100/1000M ethernet controller.
Enable ethernet node on Neu2-IO board.

Signed-off-by: Anand Moon <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
---
v4: none
v3: Address review coments from Johan and Add SoB Jagan Teki.
v2: drop SoB of Jagan Teki.
---
arch/arm/boot/dts/rv1126-edgeble-neu2-io.dts | 37 ++++++++++++++++++++
1 file changed, 37 insertions(+)

diff --git a/arch/arm/boot/dts/rv1126-edgeble-neu2-io.dts b/arch/arm/boot/dts/rv1126-edgeble-neu2-io.dts
index dded0a12f0cd..3340fc3f0739 100644
--- a/arch/arm/boot/dts/rv1126-edgeble-neu2-io.dts
+++ b/arch/arm/boot/dts/rv1126-edgeble-neu2-io.dts
@@ -22,6 +22,43 @@ chosen {
};
};

+&gmac {
+ assigned-clocks = <&cru CLK_GMAC_SRC>, <&cru CLK_GMAC_TX_RX>,
+ <&cru CLK_GMAC_ETHERNET_OUT>;
+ assigned-clock-parents = <&cru CLK_GMAC_SRC_M1>, <&cru RGMII_MODE_CLK>;
+ assigned-clock-rates = <125000000>, <0>, <25000000>;
+ clock_in_out = "input";
+ phy-handle = <&phy>;
+ phy-mode = "rgmii";
+ phy-supply = <&vcc_3v3>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmiim1_pins &clk_out_ethernetm1_pins>;
+ tx_delay = <0x2a>;
+ rx_delay = <0x1a>;
+ status = "okay";
+};
+
+&mdio {
+ phy: ethernet-phy@0 {
+ compatible = "ethernet-phy-id001c.c916",
+ "ethernet-phy-ieee802.3-c22";
+ reg = <0x0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&eth_phy_rst>;
+ reset-assert-us = <20000>;
+ reset-deassert-us = <100000>;
+ reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
+ };
+};
+
+&pinctrl {
+ ethernet {
+ eth_phy_rst: eth-phy-rst {
+ rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+ };
+};
+
&sdmmc {
bus-width = <4>;
cap-mmc-highspeed;
--
2.39.0

2023-01-11 07:03:36

by Anand Moon

[permalink] [raw]
Subject: [PATCHv4 linux-next 3/4] Rockchip RV1126 has GMAC 10/100/1000M ethernet controller

Add Ethernet GMAC node for RV1126 SoC.

Signed-off-by: Anand Moon <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
---
v4: sort the node as reg adds. update the commit message.
v3: drop the gmac_clkin_m0 & gmac_clkin_m1 fix clock node which are not
used, Add SoB of Jagan Teki.
v2: drop SoB of Jagan Teki.
---
arch/arm/boot/dts/rv1126.dtsi | 49 +++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

diff --git a/arch/arm/boot/dts/rv1126.dtsi b/arch/arm/boot/dts/rv1126.dtsi
index 1cb43147e90b..1f07d0a4fa73 100644
--- a/arch/arm/boot/dts/rv1126.dtsi
+++ b/arch/arm/boot/dts/rv1126.dtsi
@@ -332,6 +332,55 @@ timer0: timer@ff660000 {
clock-names = "pclk", "timer";
};

+ gmac: ethernet@ffc40000 {
+ compatible = "rockchip,rv1126-gmac", "snps,dwmac-4.20a";
+ reg = <0xffc40000 0x4000>;
+ interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq", "eth_wake_irq";
+ rockchip,grf = <&grf>;
+ clocks = <&cru CLK_GMAC_SRC>, <&cru CLK_GMAC_TX_RX>,
+ <&cru CLK_GMAC_TX_RX>, <&cru CLK_GMAC_REF>,
+ <&cru ACLK_GMAC>, <&cru PCLK_GMAC>,
+ <&cru CLK_GMAC_TX_RX>, <&cru CLK_GMAC_PTPREF>;
+ clock-names = "stmmaceth", "mac_clk_rx",
+ "mac_clk_tx", "clk_mac_ref",
+ "aclk_mac", "pclk_mac",
+ "clk_mac_speed", "ptp_ref";
+ resets = <&cru SRST_GMAC_A>;
+ reset-names = "stmmaceth";
+
+ snps,mixed-burst;
+ snps,tso;
+
+ snps,axi-config = <&stmmac_axi_setup>;
+ snps,mtl-rx-config = <&mtl_rx_setup>;
+ snps,mtl-tx-config = <&mtl_tx_setup>;
+ status = "disabled";
+
+ mdio: mdio {
+ compatible = "snps,dwmac-mdio";
+ #address-cells = <0x1>;
+ #size-cells = <0x0>;
+ };
+
+ stmmac_axi_setup: stmmac-axi-config {
+ snps,wr_osr_lmt = <4>;
+ snps,rd_osr_lmt = <8>;
+ snps,blen = <0 0 0 0 16 8 4>;
+ };
+
+ mtl_rx_setup: rx-queues-config {
+ snps,rx-queues-to-use = <1>;
+ queue0 {};
+ };
+
+ mtl_tx_setup: tx-queues-config {
+ snps,tx-queues-to-use = <1>;
+ queue0 {};
+ };
+ };
+
emmc: mmc@ffc50000 {
compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc";
reg = <0xffc50000 0x4000>;
--
2.39.0

2023-01-11 07:24:52

by Anand Moon

[permalink] [raw]
Subject: [PATCHv4 linux-next 2/4] ARM: dts: rockchip: rv1126: Add ethernet rgmiim1 pin-control

Add ethernet pin-control for rv1126 SoC.

Signed-off-by: Anand Moon <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
---
v4: drop Rev by Jagan: Both SoB and RoB of same person is incorrect.
update the $subject.
v3: add Rev by and SoB Jagan Teki.
v2: drop SoB of Jagan Teki.
---
arch/arm/boot/dts/rv1126-pinctrl.dtsi | 42 +++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/rv1126-pinctrl.dtsi b/arch/arm/boot/dts/rv1126-pinctrl.dtsi
index 4bc419cc1210..b77021772781 100644
--- a/arch/arm/boot/dts/rv1126-pinctrl.dtsi
+++ b/arch/arm/boot/dts/rv1126-pinctrl.dtsi
@@ -11,6 +11,14 @@
* by adding changes at end of this file.
*/
&pinctrl {
+ clk_out_ethernet {
+ /omit-if-no-ref/
+ clk_out_ethernetm1_pins: clk-out-ethernetm1-pins {
+ rockchip,pins =
+ /* clk_out_ethernet_m1 */
+ <2 RK_PC5 2 &pcfg_pull_none>;
+ };
+ };
emmc {
/omit-if-no-ref/
emmc_rstnout: emmc-rstnout {
@@ -61,6 +69,40 @@ i2c0_xfer: i2c0-xfer {
<0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>;
};
};
+ rgmii {
+ /omit-if-no-ref/
+ rgmiim1_pins: rgmiim1-pins {
+ rockchip,pins =
+ /* rgmii_mdc_m1 */
+ <2 RK_PC2 2 &pcfg_pull_none>,
+ /* rgmii_mdio_m1 */
+ <2 RK_PC1 2 &pcfg_pull_none>,
+ /* rgmii_rxclk_m1 */
+ <2 RK_PD3 2 &pcfg_pull_none>,
+ /* rgmii_rxd0_m1 */
+ <2 RK_PB5 2 &pcfg_pull_none>,
+ /* rgmii_rxd1_m1 */
+ <2 RK_PB6 2 &pcfg_pull_none>,
+ /* rgmii_rxd2_m1 */
+ <2 RK_PC7 2 &pcfg_pull_none>,
+ /* rgmii_rxd3_m1 */
+ <2 RK_PD0 2 &pcfg_pull_none>,
+ /* rgmii_rxdv_m1 */
+ <2 RK_PB4 2 &pcfg_pull_none>,
+ /* rgmii_txclk_m1 */
+ <2 RK_PD2 2 &pcfg_pull_none_drv_level_3>,
+ /* rgmii_txd0_m1 */
+ <2 RK_PC3 2 &pcfg_pull_none_drv_level_3>,
+ /* rgmii_txd1_m1 */
+ <2 RK_PC4 2 &pcfg_pull_none_drv_level_3>,
+ /* rgmii_txd2_m1 */
+ <2 RK_PD1 2 &pcfg_pull_none_drv_level_3>,
+ /* rgmii_txd3_m1 */
+ <2 RK_PA4 2 &pcfg_pull_none_drv_level_3>,
+ /* rgmii_txen_m1 */
+ <2 RK_PC6 2 &pcfg_pull_none_drv_level_3>;
+ };
+ };
sdmmc0 {
/omit-if-no-ref/
sdmmc0_bus4: sdmmc0-bus4 {
--
2.39.0

2023-01-11 10:34:25

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCHv4 linux-next 3/4] Rockchip RV1126 has GMAC 10/100/1000M ethernet controller

Hi,

Am Mittwoch, 11. Januar 2023, 07:48:38 CET schrieb Anand Moon:
> Add Ethernet GMAC node for RV1126 SoC.
>
> Signed-off-by: Anand Moon <[email protected]>
> Signed-off-by: Jagan Teki <[email protected]>

patches 2-4 have this Signed-off-by from Jagan again where he is not
not the author but also not the sender.

Also this patch here, needs a fixed subject with the correct prefixes.


Heiko

> ---
> v4: sort the node as reg adds. update the commit message.
> v3: drop the gmac_clkin_m0 & gmac_clkin_m1 fix clock node which are not
> used, Add SoB of Jagan Teki.
> v2: drop SoB of Jagan Teki.
> ---
> arch/arm/boot/dts/rv1126.dtsi | 49 +++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)
>
> diff --git a/arch/arm/boot/dts/rv1126.dtsi b/arch/arm/boot/dts/rv1126.dtsi
> index 1cb43147e90b..1f07d0a4fa73 100644
> --- a/arch/arm/boot/dts/rv1126.dtsi
> +++ b/arch/arm/boot/dts/rv1126.dtsi
> @@ -332,6 +332,55 @@ timer0: timer@ff660000 {
> clock-names = "pclk", "timer";
> };
>
> + gmac: ethernet@ffc40000 {
> + compatible = "rockchip,rv1126-gmac", "snps,dwmac-4.20a";
> + reg = <0xffc40000 0x4000>;
> + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "macirq", "eth_wake_irq";
> + rockchip,grf = <&grf>;
> + clocks = <&cru CLK_GMAC_SRC>, <&cru CLK_GMAC_TX_RX>,
> + <&cru CLK_GMAC_TX_RX>, <&cru CLK_GMAC_REF>,
> + <&cru ACLK_GMAC>, <&cru PCLK_GMAC>,
> + <&cru CLK_GMAC_TX_RX>, <&cru CLK_GMAC_PTPREF>;
> + clock-names = "stmmaceth", "mac_clk_rx",
> + "mac_clk_tx", "clk_mac_ref",
> + "aclk_mac", "pclk_mac",
> + "clk_mac_speed", "ptp_ref";
> + resets = <&cru SRST_GMAC_A>;
> + reset-names = "stmmaceth";
> +
> + snps,mixed-burst;
> + snps,tso;
> +
> + snps,axi-config = <&stmmac_axi_setup>;
> + snps,mtl-rx-config = <&mtl_rx_setup>;
> + snps,mtl-tx-config = <&mtl_tx_setup>;
> + status = "disabled";
> +
> + mdio: mdio {
> + compatible = "snps,dwmac-mdio";
> + #address-cells = <0x1>;
> + #size-cells = <0x0>;
> + };
> +
> + stmmac_axi_setup: stmmac-axi-config {
> + snps,wr_osr_lmt = <4>;
> + snps,rd_osr_lmt = <8>;
> + snps,blen = <0 0 0 0 16 8 4>;
> + };
> +
> + mtl_rx_setup: rx-queues-config {
> + snps,rx-queues-to-use = <1>;
> + queue0 {};
> + };
> +
> + mtl_tx_setup: tx-queues-config {
> + snps,tx-queues-to-use = <1>;
> + queue0 {};
> + };
> + };
> +
> emmc: mmc@ffc50000 {
> compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc";
> reg = <0xffc50000 0x4000>;
>




2023-01-11 10:50:26

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCHv4 linux-next 3/4] Rockchip RV1126 has GMAC 10/100/1000M ethernet controller

Hi Heiko,

Thanks for your review comments.

On Wed, 11 Jan 2023 at 15:41, Heiko Stübner <[email protected]> wrote:
>
> Hi,
>
> Am Mittwoch, 11. Januar 2023, 07:48:38 CET schrieb Anand Moon:
> > Add Ethernet GMAC node for RV1126 SoC.
> >
> > Signed-off-by: Anand Moon <[email protected]>
> > Signed-off-by: Jagan Teki <[email protected]>
>
> patches 2-4 have this Signed-off-by from Jagan again where he is not
> not the author but also not the sender.

We both work to fix this patch hence Jagan's SoB was added.
>
> Also this patch here, needs a fixed subject with the correct prefixes.
>
Ok, will fix this in the next version.
>
> Heiko
>
> > ---
> > v4: sort the node as reg adds. update the commit message.
> > v3: drop the gmac_clkin_m0 & gmac_clkin_m1 fix clock node which are not
> > used, Add SoB of Jagan Teki.
> > v2: drop SoB of Jagan Teki.

Thanks
-Anand

2023-01-11 11:06:14

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCHv4 linux-next 3/4] Rockchip RV1126 has GMAC 10/100/1000M ethernet controller

Am Mittwoch, 11. Januar 2023, 11:31:40 CET schrieb Anand Moon:
> Hi Heiko,
>
> Thanks for your review comments.
>
> On Wed, 11 Jan 2023 at 15:41, Heiko St?bner <[email protected]> wrote:
> >
> > Hi,
> >
> > Am Mittwoch, 11. Januar 2023, 07:48:38 CET schrieb Anand Moon:
> > > Add Ethernet GMAC node for RV1126 SoC.
> > >
> > > Signed-off-by: Anand Moon <[email protected]>
> > > Signed-off-by: Jagan Teki <[email protected]>
> >
> > patches 2-4 have this Signed-off-by from Jagan again where he is not
> > not the author but also not the sender.
>
> We both work to fix this patch hence Jagan's SoB was added.

ok, then I think the correct way to express that would be:

Co-Developed-by: Jagan Teki <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
Signed-off-by: Anand Moon <[email protected]>


> >
> > Also this patch here, needs a fixed subject with the correct prefixes.
> >
> Ok, will fix this in the next version.
> >
> > Heiko
> >
> > > ---
> > > v4: sort the node as reg adds. update the commit message.
> > > v3: drop the gmac_clkin_m0 & gmac_clkin_m1 fix clock node which are not
> > > used, Add SoB of Jagan Teki.
> > > v2: drop SoB of Jagan Teki.
>
> Thanks
> -Anand
>




2023-01-11 11:16:05

by Anand Moon

[permalink] [raw]
Subject: Re: [PATCHv4 linux-next 3/4] Rockchip RV1126 has GMAC 10/100/1000M ethernet controller

Hi Heiko

On Wed, 11 Jan 2023 at 16:13, Heiko Stübner <[email protected]> wrote:
>
> Am Mittwoch, 11. Januar 2023, 11:31:40 CET schrieb Anand Moon:
> > Hi Heiko,
> >
> > Thanks for your review comments.
> >
> > On Wed, 11 Jan 2023 at 15:41, Heiko Stübner <[email protected]> wrote:
> > >
> > > Hi,
> > >
> > > Am Mittwoch, 11. Januar 2023, 07:48:38 CET schrieb Anand Moon:
> > > > Add Ethernet GMAC node for RV1126 SoC.
> > > >
> > > > Signed-off-by: Anand Moon <[email protected]>
> > > > Signed-off-by: Jagan Teki <[email protected]>
> > >
> > > patches 2-4 have this Signed-off-by from Jagan again where he is not
> > > not the author but also not the sender.
> >
> > We both work to fix this patch hence Jagan's SoB was added.
>
> ok, then I think the correct way to express that would be:
>
> Co-Developed-by: Jagan Teki <[email protected]>
> Signed-off-by: Jagan Teki <[email protected]>
> Signed-off-by: Anand Moon <[email protected]>
>
Yes, you are right.

Thanks
-Anand