Firefly开源社区

标题: [Pin-mux問題] RK3128 GPIO2與GMAC設定問題 [打印本页]

作者: malados    时间: 2016-9-29 17:44
标题: [Pin-mux問題] RK3128 GPIO2與GMAC設定問題
Hi All,
目前在rk3128的開發上屬於新手, 剛接觸此平台
在設定ethernet發生問題, 希望先進給予建議 (個人判斷Cannot attach to PHY應該是PIN MUX的部分沒處理好)
Ethernet燈號為綠燈及黃燈持續閃爍, 無法連網

Ethernet 是使用10/100M, 設定為rmii,
而GPIO2_B4, B5, B6, B7這些則設定給GMAC_MDIO_d, GMAX_TXEN_d, ..., etc
pinctrl中有開啟gpio2_gmac設定, 但查0x200080cc 卻是0x45

pinctrl debug message如下
cat pinmux-functions   
<17:18:30>  function: gpio2_gmac, groups = [ gmac-rxdv gmac-txclk gmac-crs gmac-rxclk gmac-mdio gmac-txen gmac-clk gmac-rxer gmac-rxd1 gmac-rxd0 gmac-txd1 gmac-txd0 gmac-rxd3 gmac-rxd2 gmac-txd2 gmac-txd3 gmac-col gmac-col-gpio gmac-mdc ]
<17:18:30>  function: gpio2_lcdc0, groups = [ lcdc0-lcdc lcdc0-gpio ]

cat pinmux-pins
<16:55:49>  pin 72 (gpio2-8): device (GPIO UNCLAIMED) function gpio2_lcdc0 group lcdc0-lcdc
<16:55:49>  pin 73 (gpio2-9): device (GPIO UNCLAIMED) function gpio2_lcdc0 group lcdc0-lcdc
<16:55:49>  pin 74 (gpio2-10): device gpio2:74 function gpio2_lcdc0 group lcdc0-lcdc
<16:55:49>  pin 75 (gpio2-11): device (GPIO UNCLAIMED) function gpio2_lcdc0 group lcdc0-lcdc
<16:55:49>  pin 76 (gpio2-12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 77 (gpio2-13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 78 (gpio2-14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 79 (gpio2-15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 80 (gpio2-16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 81 (gpio2-17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 82 (gpio2-18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 83 (gpio2-19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
<16:55:49>  pin 84 (gpio2-20): 2005a000.i2c gpio2:84 function gpio1_i2c2 group i2c2-sda
<16:55:49>  pin 85 (gpio2-21): 2005a000.i2c gpio2:85 function gpio1_i2c2 group i2c2-scl

而在實際的PHY probe log
<17:21:06>  [   13.883660] phy_power_on: enable = 1
<17:21:06>  [   13.923239] Read the Ethernet MAC address from IDB:00:00:00:00:00:00
<17:21:06>  [   13.923434] eth0: device MAC address 42:df:90:78:6b:86
<17:21:07>  [   13.964757] libphy: stmmac: probed
<17:21:07>  [   13.964816] eth0: PHY ID 00000000 at 0 IRQ 0 (stmmac-0:00) active
<17:21:07>  [   13.964845] eth0: PHY ID 00000000 at 1 IRQ 0 (stmmac-0:01) active
<17:21:07>  [   13.964871] eth0: PHY ID 00000000 at 2 IRQ 0 (stmmac-0:02)
.............................
<17:21:07>  [   13.965577] eth0: PHY ID 00000000 at 31 IRQ 0 (stmmac-0:1f)
<17:21:07>  [   13.965732] stmmac_open: Cannot attach to PHY (error: -19)


作者: woody.lee    时间: 2016-9-30 17:19
感覺是 i2c 2 被啟用了
使得 GMAC_RXD3_d GMAC_RXD2_d 切換成 i2c2 使用
所以網路也就不能用了





欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1