我使用ethtool设置dm385自适应使能,设置网卡eth0的时候,只能设置phy 0:00而不能设置0:01是为什么?求指教
Eason Wang:
有没有用vlan?
Linux Linux:
回复 Eason Wang:
有vlan的,
struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x50, .sliver_reg_ofs = 0x700, .phy_id = "0:00", .dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_0, }, { .slave_reg_ofs = 0x90, .sliver_reg_ofs = 0x740, .phy_id = "0:01", .dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_1, },};static struct cpsw_platform_data ti814x_cpsw_pdata = { .ss_reg_ofs = 0x900, .channels = 8, .cpdma_reg_ofs = 0x100, .cpdma_sram_ofs = 0x200, .slaves = 2, .slave_data = cpsw_slaves, .ale_reg_ofs = 0x600, .ale_entries = 1024, .host_port_reg_ofs = 0x28, .hw_stats_reg_ofs = 0x400, .cpts_reg_ofs = 0x500, .bd_ram_ofs = 0x2000, .bd_ram_size = SZ_8K, .rx_descs = 64, .mac_control = BIT(5), /* MIIEN */ .gigabit_en = 1, .host_port_num = 0, .no_bd_ram = false, .default_vlan = TI81XX_DEFAULT_VLAN,};
不知道要怎么做修改,请指教
Linux Linux:
回复 Eason Wang:
要设置phy0:00和phy0:01,内核里面应该怎么配置
Linux Linux:
回复 Eason Wang:
具体配置是DM385+RTL8211e(g)的形式的
我使用TI81XX_PSP_ETHERNET_Switch_User_Guide这个文档里面的CONFIG_SWITCH_SET_PORT_CONFIG is used to set Phy Config.进行内核配置
使用文档里面的sample代码,运行结果返回Command failed,跟踪内核代码发觉
cpsw_ndo_do_ioctl-》
default: return -EOPNOTSUPP;
好像根本就没有实现的函数,
那需要怎么设置DM385的phy0:01的自适应呢,请指教
Louis:
回复 Linux Linux:
你好,
请问你是需要使能CPSW双网口这个功能么?若果是的话,请参考:
http://processors.wiki.ti.com/index.php/TI81XX_PSP_ETHERNET_Switch_User_Guide#Dual_Standalone_EMAC_mode
另外,cpsw_slaves[0],cpsw_slaves[1]分别对应两个EMAC口(基地址寄存器不同),默认EMAC0的phy _id是0,即0:00,EMAC1的phy_id是1,即0:01.
下面是内核里面的代码:
struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x50, .sliver_reg_ofs = 0x700, .phy_id = "0:00", .dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_0, }, { .slave_reg_ofs = 0x90, .sliver_reg_ofs = 0x740, .phy_id = "0:01", .dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_1, },};