TI中文支持网
TI专业的中文技术问题搜集分享网站

AM3352在uboot中如何使用eth1

买了一块迈冲科技的AM335X开发板,开发板上有2个网口,用的phy是2块KSZ8081,RMII模式,在uboot下只能使用ETH0,linux启动后2个网口都能用。

现在我要在uboot下使用ETH1,请问该怎么修改uboot?

现在我uboot中按照内核的配置添加了RMII2的引脚初始化:

static struct module_pin_mux rmii1_pin_mux[] = {
{OFFSET(mii1_txen), MODE(1)}, /* RMII1_Txen */
{OFFSET(mii1_crs), MODE(1) | RXACTIVE}, /* RMII1_CRS */
{OFFSET(mii1_txd1), MODE(1)}, /* RMII1_TD1 */
{OFFSET(mii1_txd0), MODE(1)}, /* RMII1_TD0 */
{OFFSET(mii1_rxd1), MODE(1) | RXACTIVE}, /* RMII1_RD1 */
{OFFSET(mii1_rxd0), MODE(1) | RXACTIVE}, /* RMII1_RD0 */
{OFFSET(rmii1_refclk), MODE(0) | RXACTIVE}, /* RMII1_REF */
{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},/* MDIO_DATA */
{OFFSET(mdio_clk), MODE(0) | PULLUP_EN}, /* MDIO_CLK */
{-1},
};

static struct module_pin_mux rmii2_pin_mux[] = {
{OFFSET(gpmc_a0), MODE(3)}, /* RMII1_Txen */
{OFFSET(gpmc_a9), MODE(3) | RXACTIVE}, /* RMII1_CRS */
{OFFSET(gpmc_a4), MODE(3)}, /* RMII1_TD1 */
{OFFSET(gpmc_a5), MODE(3)}, /* RMII1_TD0 */
{OFFSET(gpmc_a10), MODE(3) | RXACTIVE}, /* RMII1_RD1 */
{OFFSET(gpmc_a11), MODE(3) | RXACTIVE}, /* RMII1_RD0 */
{OFFSET(mii1_col), MODE(1) | RXACTIVE}, /* RMII1_REF */
{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},/* MDIO_DATA */
{OFFSET(mdio_clk), MODE(0) | PULLUP_EN}, /* MDIO_CLK */
{-1},
};

configure_module_pin_mux(rmii1_pin_mux);
configure_module_pin_mux(rmii2_pin_mux);

board/ti/am335x/board.c中应该怎么修改呢?求指教

static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_id = 0, /*0*/
},

{
.slave_reg_ofs = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_id = 3, /*1*/
},
};

static struct cpsw_platform_data cpsw_data = {
.mdio_base = AM335X_CPSW_MDIO_BASE,
.cpsw_base = AM335X_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,
.mac_control = (1 << 5),
.control = cpsw_control,
.host_port_num = 0,
.version = CPSW_CTRL_VERSION_2,
};

Jian Zhou:

把PHY_ID交换下试试。

user3335286:

回复 Jian Zhou:

我交换了.phy_id,但还是ETH0能用,ETH1 ping 不通

Jian Zhou:

回复 user3335286:

板子上的U-boot是哪个版本的?能和提供商确认下么?

赞(0)
未经允许不得转载:TI中文支持网 » AM3352在uboot中如何使用eth1
分享到: 更多 (0)