源码版本是android5.1的,内核是3.10版本的,原厂box的SDK看RTL8201F的规格书说是10M/100M的支持然后看内核中项目用到的dts:&gmac {
// pmu_regulator = "act_ldo5";
// pmu_enable_level = <1>; //1->HIGH, 0->LOW
// power-gpio = <&gpio0 GPIO_A6 GPIO_ACTIVE_HIGH>;
reset-gpio = <&gpio4 GPIO_B0 GPIO_ACTIVE_LOW>;
phy-mode = "rgmii";
clock_in_out = "input";
tx_delay = <0x30>;
rx_delay = <0x10>;
};根据原理图改成了:
&gmac {
// pmu_regulator = "act_ldo5";
// pmu_enable_level = <1>; //1->HIGH, 0->LOW
power-gpio = <&gpio1 GPIO_D0 GPIO_ACTIVE_HIGH>;
reset-gpio = <&gpio4 GPIO_B0 GPIO_ACTIVE_LOW>;
phy-mode = "rmii"; //rgmii
clock_in_out = "input";
tx_delay = <0x30>;
rx_delay = <0x10>;
};RMII的Clock设置为input形式,得到的输出log片段:
[    1.048658] SCSI Media Changer driver v0.25 
[    1.048939] tun: Universal TUN/TAP device driver, 1.6
[    1.048955] tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
[    1.049069] vmac_init.
[    1.049590] stmmac_probe_config_dt: Can not read property: pmu_regulator.
[    1.049609] stmmac_probe_config_dt: clock input/output? (input).
[    1.049624] stmmac_probe_config_dt: TX delay(0x30).
[    1.049637] stmmac_probe_config_dt: RX delay(0x10).
[    1.049686] stmmac_probe_config_dt: is rockchip,rk3288-gmac
[    1.049699] stmmc_pltfr_init:
[    1.049718] stmmc_pltfr_init: init for RMII
[    1.050154] stmmac - user ID: 0x10, Synopsys ID: 0x35
[    1.050167]  Normal descriptors
[    1.050177]  Ring mode enabled
[    1.050188]  DMA HW capability register supported
[    1.050201]  RX Checksum Offload Engine supported (type 2)
[    1.050214]  TX Checksum insertion supported
[    1.050224]  Wake-Up On Lan supported
[    1.050261]  Enable RX Mitigation via HW Watchdog Timer
[    1.050663] PPP generic driver version 2.4.2
[    1.050797] PPP BSD Compression module registered
[    1.050812] PPP Deflate Compression module registered
[    1.050834] PPP MPPE Compression module registered
[    1.050848] NET: Registered protocol family 24
[    1.050880] SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256) (6 bit encapsulation enabled).[   46.022695] phy_power_on: enable = 1 
[   46.062118] Read the Ethernet MAC address from IDB:00:00:00:00:00:00
[   46.062163] eth0: device MAC address 32:75:5b:2d:c9:9b
[   46.064612] libphy: stmmac: probed
[   46.064626] eth0: PHY ID 001cc816 at 0 IRQ 0 (stmmac-0:00) active
[   46.064636] eth0: PHY ID 001cc816 at 1 IRQ 0 (stmmac-0:01) active
[   46.164089] stmmac_open: DMA initialization failed如果Clock改成以output形式,得到的log片段:
[    0.996533] vmac_init.
[    0.997062] stmmac_probe_config_dt: Can not read property: pmu_regulator.
[    0.997081] stmmac_probe_config_dt: clock input/output? (output).
[    0.997096] stmmac_probe_config_dt: TX delay(0x30).
[    0.997109] stmmac_probe_config_dt: RX delay(0x10).
[    0.997160] stmmac_probe_config_dt: is rockchip,rk3288-gmac
[    0.997172] stmmc_pltfr_init:
[    0.997193] stmmc_pltfr_init: init for RMII
[    0.997641] stmmac - user ID: 0x10, Synopsys ID: 0x35
[    0.997654]  Normal descriptors
[    0.997664]  Ring mode enabled
[    0.997675]  DMA HW capability register supported
[    0.997688]  RX Checksum Offload Engine supported (type 2)
[    0.997701]  TX Checksum insertion supported
[    0.997712]  Wake-Up On Lan supported
[    0.997748]  Enable RX Mitigation via HW Watchdog Timer
[    0.998144] PPP generic driver version 2.4.2
[    0.998284] PPP BSD Compression module registered
[    0.998300] PPP Deflate Compression module registered
[    0.998321] PPP MPPE Compression module registered
[    0.998336] NET: Registered protocol family 24
[    0.998368] SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256) (6 bit encapsulation enabled).[   10.014371] phy_power_on: enable = 1 
[   10.042418] android_usb gadget: high-speed config #1: android
[   10.042744] android_work: sent uevent USB_STATE=CONFIGURED
[   10.053832] Read the Ethernet MAC address from IDB:00:00:00:00:00:00
[   10.053880] eth0: device MAC address 5a:7e:9a:88:22:dd
[   10.056320] libphy: stmmac: probed
[   10.056334] eth0: PHY ID 001cc816 at 0 IRQ 0 (stmmac-0:00) active
[   10.056344] eth0: PHY ID 001cc816 at 1 IRQ 0 (stmmac-0:01) active[   12.020981] stmmc_pltfr_fix_mac_speed: fix speed to 100
[   12.021013] stmmc_pltfr_fix_mac_speed: fix speed for RMII
[   12.021025] libphy: stmmac-0:01 - Link is Up - 100/Full开关系统里的Ethernet按钮,得到:
[  151.506823] phy_power_on: enable = 0 
[  155.787585] phy_power_on: enable = 1 
[  155.830956] eth0: device MAC address 5a:7e:9a:88:22:dd
[  155.847032] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  157.790809] stmmc_pltfr_fix_mac_speed: fix speed to 100
[  157.790874] stmmc_pltfr_fix_mac_speed: fix speed for RMII
[  157.790907] libphy: stmmac-0:01 - Link is Up - 100/Full
[  157.790973] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready不知道有没有人知道,还有哪里要改的?