[U-Boot] How do I use AM335x eth1 rather than eth0 ?

We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet ports connected.
I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, };
... to ...
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, };
... assuming that eth0 would now be ignored (as only 1 slave is configured).
But (eg) dhcp still only responds on eth0 !?!
What else do I have to change ?
Cheers Mark J.

On Fri, Apr 12, 2013 at 11:56:57AM +0100, Mark Jackson wrote:
We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet ports connected.
I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, };
... to ...
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, };
... assuming that eth0 would now be ignored (as only 1 slave is configured).
But (eg) dhcp still only responds on eth0 !?!
What else do I have to change ?
Good question, do you have both ports working in Linux yet? The EVM-SK design supports two interfaces and I know the cpsw driver in the kernel required some changes to support two. I strongly suspect similar changes would be required in the U-Boot driver (I don't have any specific links other than look at the vendor kernel tree).

On 12/04/13 17:05, Tom Rini wrote:
On Fri, Apr 12, 2013 at 11:56:57AM +0100, Mark Jackson wrote:
We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet ports connected.
I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-
<snip>
... assuming that eth0 would now be ignored (as only 1 slave is configured).
But (eg) dhcp still only responds on eth0 !?!
What else do I have to change ?
Good question, do you have both ports working in Linux yet? The EVM-SK design supports two interfaces and I know the cpsw driver in the kernel required some changes to support two. I strongly suspect similar changes would be required in the U-Boot driver (I don't have any specific links other than look at the vendor kernel tree).
Well, I've realised I needed to change CONFIG_PHY_ADDR in my board config file.
So the link up/down portion now works to PHY#2, but I'm still unable to ping anything from our board.
I'm guessing there's some hard-coded assumptions in the cpsw.c driver. I've taken quick look at the Ethernet section of the TRM, but that's *waaaay* over my head !?!
I've so far been unable to get Linux to see the 2nd port, and there is no "vendor kernel tree" ... I'm the vendor :-)
Mark J.

On 12/04/13 11:56, Mark Jackson wrote:
We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet ports connected.
I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, };
... to ...
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, };
... assuming that eth0 would now be ignored (as only 1 slave is configured).
But (eg) dhcp still only responds on eth0 !?!
What else do I have to change ?
After much experimenting, I've managed to get it to work.
Based on the original board.c file copied from the TI starter kit, I simply changed the slaves count to 2, and set CONFIG_PHY_ADDR to 1 in my board config file.
Simple.

On 12/04/13 11:56, Mark Jackson wrote:
We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet ports connected.
I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, };
... to ...
static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x308, .sliver_reg_ofs = 0xdc0, .phy_id = 1, }, { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, .phy_id = 0, }, };
... assuming that eth0 would now be ignored (as only 1 slave is configured).
But (eg) dhcp still only responds on eth0 !?!
What else do I have to change ?
After much experimenting, I've managed to get it to work.
Based on the original board.c file copied from the TI starter kit, I simply changed the slaves count to 2, and set CONFIG_PHY_ADDR to 1 in my board config file.
Simple.

We are also facing the same issue.We are trying to use phy id1 on eth1 for ethernet gigabit phy and rest is for ethernet switch.I did some of the changes w.r.t slaves and CONFIG_ADDR_PHY but nothing come out.So Kindly let me know what other changes you made in order to enable eth1 .
Tj
-- View this message in context: http://u-boot.10912.n7.nabble.com/How-do-I-use-AM335x-eth1-rather-than-eth0-... Sent from the U-Boot mailing list archive at Nabble.com.
participants (4)
-
Mark Jackson
-
Mark Jackson
-
tejbir
-
Tom Rini