|
发表于 2021-10-12 16:16:13
|
显示全部楼层
本帖最后由 曲奇龙 于 2021-10-12 16:18 编辑
就是参考这个知识库来的
新增了板级文件的rmii2_pin_mux,并setup_pin_mux(rmii2_pin_mux);
修改了phy_id顺序,原本eth0的地址是1,自制底板eth0的地址是0,eth1的地址是1
新增了slave配置am33xx_cpsw_slaves[0].phy_if = PHY_INTE**CE_MODE_RMII; am33xx_cpsw_slaves[1].phy_if = PHY_INTE**CE_MODE_RMII;
修改了寄存器
#define RMII_IO_CLK_EN 0x00C0
gmii_sel |= (RMII_IO_CLK_EN);
然而还是ping不通- static struct pinmux_config rmii2_pin_mux[] = {
- {"gpmc_csn3.rmii2_crs_dv", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
- {"gpmc_wpn.rmii2_rxerr", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLDOWN},
- {"gpmc_a0.rmii2_txen", OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT},
- {"gpmc_a4.rmii2_txd1", OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT},
- {"gpmc_a5.rmii2_txd0", OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT},
- {"gpmc_a10.rmii2_rxd1", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLDOWN},
- {"gpmc_a11.rmii2_rxd0", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLDOWN},
- {"gmii1_col.rmii2_refclk", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
- {"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 struct cpsw_slave_data am33xx_cpsw_slaves[] = {
- {
- .slave_reg_ofs = 0x200,
- .sliver_reg_ofs = 0xd80,
- .phy_id = "0:00",
- .dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_0,
- },
- {
- .slave_reg_ofs = 0x300,
- .sliver_reg_ofs = 0xdc0,
- .phy_id = "0:01",
- .dual_emac_reserved_vlan = CPSW_PORT_VLAN_SLAVE_1,
- },
- };
复制代码 #define RMII_IO_CLK_EN 0x00C0
gmii_sel |= (RMII_IO_CLK_EN);
|
|