RK3588 Linux修改将gmac0注册为eth0

将dts中gmac1相关节点内容全部移至gmac0之后即可。

修改内容如下:

diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rk3588.dtsi
old mode 100644
new mode 100755
index eed99fd45..06dc705d3
--- a/kernel/arch/arm64/boot/dts/rockchip/rk3588.dtsi
+++ b/kernel/arch/arm64/boot/dts/rockchip/rk3588.dtsi
@@ -14,6 +14,7 @@
                edp0 = &edp0;
                edp1 = &edp1;
                ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
                hdptx0 = &hdptxphy0;
                hdptx1 = &hdptxphy1;
                hdptxhdmi0 = &hdptxphy_hdmi0;
@@ -735,6 +736,62 @@
                        queue0 {};
                };
        };
+       
+       gmac_uio1: uio@fe1c0000 {
+               compatible = "rockchip,uio-gmac";
+               reg = <0x0 0xfe1c0000 0x0 0x10000>;
+               rockchip,ethernet = <&gmac1>;
+               status = "disabled";
+       };
+       
+       gmac1: ethernet@fe1c0000 {
+               compatible = "rockchip,rk3588-gmac", "snps,dwmac-4.20a";
+               reg = <0x0 0xfe1c0000 0x0 0x10000>;
+               interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "macirq", "eth_wake_irq";
+               rockchip,grf = <&sys_grf>;
+               rockchip,php_grf = <&php_grf>;
+               clocks = <&cru CLK_GMAC_125M>, <&cru CLK_GMAC_50M>,
+                        <&cru PCLK_GMAC1>, <&cru ACLK_GMAC1>,
+                        <&cru CLK_GMAC1_PTP_REF>;
+               clock-names = "stmmaceth", "clk_mac_ref",
+                             "pclk_mac", "aclk_mac",
+                             "ptp_ref";
+               resets = <&cru SRST_A_GMAC1>;
+               reset-names = "stmmaceth";
+               power-domains = <&power RK3588_PD_GMAC>;
+
+               snps,mixed-burst;
+               snps,tso;
+
+               snps,axi-config = <&gmac1_stmmac_axi_setup>;
+               snps,mtl-rx-config = <&gmac1_mtl_rx_setup>;
+               snps,mtl-tx-config = <&gmac1_mtl_tx_setup>;
+               status = "disabled";
+
+               mdio1: mdio {
+                       compatible = "snps,dwmac-mdio";
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+               };
+
+               gmac1_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>;
+               };
+
+               gmac1_mtl_rx_setup: rx-queues-config {
+                       snps,rx-queues-to-use = <1>;
+                       queue0 {};
+               };
+
+               gmac1_mtl_tx_setup: tx-queues-config {
+                       snps,tx-queues-to-use = <1>;
+                       queue0 {};
+               };
+       };
 
        sata1: sata@fe220000 {
                compatible = "rockchip,rk-ahci", "snps,dwc-ahci";
diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
old mode 100644
new mode 100755
index 6b46d1b10..57b2fb689
--- a/kernel/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/kernel/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -31,7 +31,6 @@
                csi2dphy5 = &csi2_dphy5;
                dsi0 = &dsi0;
                dsi1 = &dsi1;
-               ethernet1 = &gmac1;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
                gpio2 = &gpio2;
@@ -5460,62 +5459,6 @@
                };
        };
 
-       gmac_uio1: uio@fe1c0000 {
-               compatible = "rockchip,uio-gmac";
-               reg = <0x0 0xfe1c0000 0x0 0x10000>;
-               rockchip,ethernet = <&gmac1>;
-               status = "disabled";
-       };
-
-       gmac1: ethernet@fe1c0000 {
-               compatible = "rockchip,rk3588-gmac", "snps,dwmac-4.20a";
-               reg = <0x0 0xfe1c0000 0x0 0x10000>;
-               interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>;
-               interrupt-names = "macirq", "eth_wake_irq";
-               rockchip,grf = <&sys_grf>;
-               rockchip,php_grf = <&php_grf>;
-               clocks = <&cru CLK_GMAC_125M>, <&cru CLK_GMAC_50M>,
-                        <&cru PCLK_GMAC1>, <&cru ACLK_GMAC1>,
-                        <&cru CLK_GMAC1_PTP_REF>;
-               clock-names = "stmmaceth", "clk_mac_ref",
-                             "pclk_mac", "aclk_mac",
-                             "ptp_ref";
-               resets = <&cru SRST_A_GMAC1>;
-               reset-names = "stmmaceth";
-               power-domains = <&power RK3588_PD_GMAC>;
-
-               snps,mixed-burst;
-               snps,tso;
-
-               snps,axi-config = <&gmac1_stmmac_axi_setup>;
-               snps,mtl-rx-config = <&gmac1_mtl_rx_setup>;
-               snps,mtl-tx-config = <&gmac1_mtl_tx_setup>;
-               status = "disabled";
-
-               mdio1: mdio {
-                       compatible = "snps,dwmac-mdio";
-                       #address-cells = <0x1>;
-                       #size-cells = <0x0>;
-               };
-
-               gmac1_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>;
-               };
-
-               gmac1_mtl_rx_setup: rx-queues-config {
-                       snps,rx-queues-to-use = <1>;
-                       queue0 {};
-               };
-
-               gmac1_mtl_tx_setup: tx-queues-config {
-                       snps,tx-queues-to-use = <1>;
-                       queue0 {};
-               };
-       };
-
        sata0: sata@fe210000 {
                compatible = "rockchip,rk-ahci", "snps,dwc-ahci";
                reg = <0 0xfe210000 0 0x1000>;

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值