hi3516d 更换phy为rtl8201 笔记

5,758次阅读
没有评论

刚买的板子PHY为RTL8201,而SDK里的是RTL8211.刚开始没注意到这个问题,烧录后发现网络不通.需要更改uboot及kernel.现在记录如下:

一: UBOOT
修改 /include/configs/hi3516a.h

/*-----------------------------------------------------------------------
 * network config
 -----------------------------------------------------------------------*/
.....
#define CONFIG_CMD_MII
#define CONFIG_CMD_RMII             // justchen增加: RMII RTL8201
#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	1
/*-----------------------------------------------------------------------
 * HIETH-GMAC driver
 -----------------------------------------------------------------------*/
..
/*	#define CONFIG_HIGMAC_PHY2_ADDR		2	  */
  #define CONFIG_HIGMAC_PHY1_INTERFACE_MODE	1     // justchen修改: 0:MII 1:RMII 2:GRMII
/*	#define CONFIG_HIGMAC_PHY2_INTERFACE_MODE	2 */
...

其实在这里还可以把默认IP这些改改,注意phy地址与RMII MII模式需要与原理图对应
修改好后编译 uboot.bin
hi3516d 更换phy为rtl8201 笔记
然后还需要修改excel中的 muxctrl_reg93 项 ,将值改为2. 在uboot模式下应该能顺利连网了

二:内核
在内核menuconfig中找不到rmii rgmii的选项. 不过在http://www.ebaina.com/bbs/thread-7876-1-1.html中有大神提到

hieth-gmac phy0 interface mode.                                                                            |   
  | 1---MII,                                                                                                   |   
  | 5---RMII,                                                                                                  |   
  | 6---RGMII.                                                                                                 |   
  | Symbol: HIGMAC_PHY0_INTERFACE_MODE [=5]                                                                    |   
  | Type  : integer                                                                                            |   
  | Range : [1 6]                                                                                              |   
  | Prompt: hieth-gmac phy0 interface mode                                                                     |   
  |   Defined at drivers/net/ethernet/hieth-gmac/Kconfig:46                                                    |   
  |   Depends on: NETDEVICES [=y] && ETHERNET [=y] && HIETH_GMAC [=y]                                          |   
  |   Location:                                                                                                |   
  |     -> Device Drivers                                                                                      |   
  |       -> Network device support (NETDEVICES [=y])                                                          |   
  |         -> Ethernet driver support (ETHERNET [=y])                                                         |   
  |           -> hieth gmac family network device support (HIETH_GMAC [=y])

所以找到 hieth-gmac phy0 interface mode 将默认的6改为5 即RMII模式.收工!

正文完
 0
评论(没有评论)