玩客云使用Amlogic S805+ RTL8211f 千兆网卡,市面上除了Odroid C1好像没有同样的配置。经过各种测试发现网卡严重依赖于u-boot,最逗的是Amlogic自己的源代码是错的。
-
下载u-boot源代码uboot-meson-next-2015-04-01-a77c4dec33.tar.gz,解压
修改board/amlogic/configs/m8b_m201_v1.h里的宏定义,rtl8211f需要使用RGMII配置
将宏 RMII_PHY_INTERFACE改为 RGMII_PHY_INTERFACE -
board/amlogic/m8b_m201_v1/m8b_m201_v1.c中关于RGMII的配置是错的,需要从Amlogic_Ethenet_controller_user_Guide.pdf中替换如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#elif RGMII_PHY_INTERFACE SET_CBUS_REG_MASK(PERIPHS_PIN_MUX_6, 0x3f4f); SET_CBUS_REG_MASK(PERIPHS_PIN_MUX_7, 0xf00000); eth_reg0.d32 = 0; eth_reg0.b.phy_intf_sel = 1; eth_reg0.b.data_endian = 0; eth_reg0.b.desc_endian = 0; eth_reg0.b.rx_clk_rmii_invert = 0; eth_reg0.b.rgmii_tx_clk_src = 0; eth_reg0.b.rgmii_tx_clk_phase = 0; eth_reg0.b.rgmii_tx_clk_ratio = 2; eth_reg0.b.phy_ref_clk_enable = 1; eth_reg0.b.clk_rmii_i_invert = 1; eth_reg0.b.clk_en = 1; eth_reg0.b.adj_enable = 1; eth_reg0.b.adj_setup = 1; eth_reg0.b.adj_delay = 4; eth_reg0.b.adj_skew = 0xc; eth_reg0.b.cali_start = 0; eth_reg0.b.cali_rise = 0; eth_reg0.b.cali_sel = 0; eth_reg0.b.rgmii_rx_reuse = 0; eth_reg0.b.eth_urgent = 0; WRITE_CBUS_REG(0x2050, eth_reg0.d32);// rgmii mode SET_CBUS_REG_MASK(0x10a5,1<<27); WRITE_CBUS_REG(0x2050,0x7d21);// rgmii mode SET_CBUS_REG_MASK(0x108a,0xb803); SET_CBUS_REG_MASK(HHI_MPLL_CNTL9,(1638<<0)| (0<<14)|(1<<15) | (1<<14) | (5<<16) | (0<<25) | (0<<26) |(0<<30) |(0<<31)); #endif
-
编译u-boot,烧入编译后的u-boot
-
测试jocover修改过的Armbian,网卡正常