求助TI的大神们,
am335x +DP83848双网卡MII模式如何配置(uboot、内核)?我现在用的是SDK7.
因为以前没有网络基础,TI有没有比较简单的手册一步步介绍如何配置?
uboot中对应网络的配置这些值该怎么设置呀?
static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_addr = 0,
},
{
.slave_reg_ofs = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_addr = 7,
},
};
static struct cpsw_platform_data cpsw_data = {
.mdio_base = CPSW_MDIO_BASE,
.cpsw_base = CPSW_BASE,
.mdio_div = 0xff,
.channels = 8,
.cpdma_reg_ofs = 0x800,
.slaves = 2,
.slave_data = cpsw_slaves,
.ale_reg_ofs = 0xd00,
.ale_entries = 1024,
.host_port_reg_ofs = 0x108,
.hw_stats_reg_ofs = 0x900,
.bd_ram_ofs = 0x2000,
.mac_control = (1 << 5),
.control = cpsw_control,
.host_port_num = 0,
.version = CPSW_CTRL_VERSION_2,
};
yongpan mei:
内核中只配置了设备树, 其他还需做什么?
cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* J16->mii1_txen->mii1_txen */ 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* J17->mii1_rxdv->mii1_rxdv */ 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* J18->mii1_txd3->mii1_txd3 */ 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* K15->mii1_txd2->mii1_txd2 */ 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* K16->mii1_txd1->mii1_txd1 */ 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* K17->mii1_txd0->mii1_txd0 */ 0x12c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* K18->mii1_txclk->mii1_txclk */ 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* L18->mii1_rxclk->mii1_rxclk */ 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* L17->mii1_rxd3->mii1_rxd3 */ 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* L16->mii1_rxd2->mii1_rxd2 */ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE0) /* L15->mii1_rxd1->mii1_rxd1 */ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* M16->mii1_rxd0->mii1_rxd0 */
/* Slave 2 */ 0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* R13->gpmc_a0->mii2_txen */ 0x44 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* V14->gpmc_a1->mii2_rxdv */ 0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* U14->gpmc_a2->mii2_txd3 */ 0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* T14->gpmc_a3->mii2_txd2 */ 0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* R14->gpmc_a4->mii2_txd1 */ 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* V15->gpmc_a5->mii2_txd0 */ 0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* U15->gpmc_a6->mii1_txclk */ 0x5c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* T15->gpmc_a7->mii1_rxclk */ 0x60 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* V16->gpmc_a8->mii1_rxd3 */ 0x64 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* U16->gpmc_a9->mii1_rxd2 */ 0x68 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* T16->gpmc_a10->mii1_rxd1 */ 0x6c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* V17->gpmc_a11->mii1_rxd0 */ >; };
cpsw_sleep: cpsw_sleep { pinctrl-single,pins = < /* Slave 1 reset value */ 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
/* Slave 2 reset value*/ 0x40 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x44 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x48 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x50 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x54 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x58 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x5c (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7) 0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7) >; };
yongpan mei:
目前的状态是系统中只能显示一个eth0,但是无法获得IP,127.0.0.1 可以ping通
eth0 Link encap:Ethernet HWaddr 68:C9:0B:80:53:B6 UP 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) Interrupt:56
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:700 (700.0 B) TX bytes:700 (700.0 B)
yongpan mei:
回复 yongpan mei:
目前的情况是网口1可在Linux系统中看到,网线插上后灯亮(差不多1S闪一次),网口2在系统中看不到,灯也不亮。ping 回环地址能ping通。
eth0 Link encap:Ethernet HWaddr 68:C9:0B:80:53:B6 UP 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) Interrupt:56
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:700 (700.0 B) TX bytes:700 (700.0 B)
Jian Zhou:
回复 yongpan mei:
这种双网卡的问题,建议先在U-boot下把每个网口都调试一下,然后参考SK板的device tree进行配置。