am335x 的板文件中如何配置ksz8041nl 网卡,求高人指点。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好!
查看了下,KSZ8041NL为一个支持MII/RMII的百兆PHY。
如果你跑linux的话,在u-boot和linux中使用的是general driver,所以需要的位置比较简单,可以参考之前的一个链接
http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/t/45981.aspx
是不是这样配置呀:
/* Module pin mux for rmii1 */
static struct pinmux_config rmii1_pin_mux[] = {
{"mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"mii1_txen.mii1_txen", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"mii1_txd1.mii1_txd1", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"mii1_txd0.mii1_txd0", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
{"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
{NULL, 0},
};
static void rmii1_init(int evm_id, int profile)
{
setup_pin_mux(rmii1_pin_mux);
return;
}
{rmii1_init, DEV_ON_BASEBOARD, PROFILE_ALL},
eth0 Link encap:Ethernet HWaddr C8:A0:30:8C:7C:53
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@(none):/# ifconfig eth0 192.168.100.2
root@(none):/# ifconfig eth0 down
root@(none):/# ifconfig eth0 up
PHY 0:00 not found
PHY 0:01 not found
求高人指点哪里设置的不正确
你的PHY的RXD1/2/3上的上下拉状态是如何的?
根据你使用的PHY的DATASHEET,这几个脚是决定PHY的地址的,有无对应上?
同时,想知道你使用的是MII还是RMII的方式连接?
方便贴出原理图吗?
static struct cpsw_slave_data am33xx_cpsw_slaves[] = {
{
.slave_reg_ofs = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_id = "0:01",
.dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_0,
},
{
.slave_reg_ofs = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_id = "0:02",
.dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_1,
},
};
这个结构中的参数是如何计算的,这个phy_id 与 #define PHY_ID_KS8041 0x00221510 这个是如何对应的。