User avatar
rew
Posts: 416
Joined: Fri Aug 26, 2011 3:25 pm

Two LAN9514 chips on one raspberry.

Sun May 05, 2019 12:16 pm

I have a project where one Compute module (CM3) gets connected to two LAN9514 chips for Ethernet connectivity.

It seems that the raspberry pi uses the last 3 bytes of its serial number for the MAC on the LAN chips. That's all nice if you have one of them, but I'd say it is not allowed when there are two. Sure, when, as intended, the two interfaces end up on different networks, then there is no issue, but I'd think odd things would happen if they did get connected to the same network.

Shouldn't the ethernet driver think of a new MAC address to use? I've had 4-port ethernet cards in the past with just one EEPROM. The driver would then use the +1 +2 and +3 mac addresses on the other ports. In this case, that strategy might not be ideal: if serial numbers are assigned sequentially, when this goes into production and we buy 100+ CM3's in one go, it suddenly becomes likely that we'll end up with sequential serial numbers. Another pi with serial+1 on the same network would then cause an even bigger mess.

My proposal is to flip the "bit 23" in the MAC for the second LAN9514 chip.

Any comments?
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

W. H. Heydt
Posts: 9988
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Two LAN9514 chips on one raspberry.

Sun May 05, 2019 3:41 pm

Just curious...how are you connecting two LAN chips to your CM3? Cascading one from the other?

User avatar
rew
Posts: 416
Joined: Fri Aug 26, 2011 3:25 pm

Re: Two LAN9514 chips on one raspberry.

Tue May 07, 2019 3:41 pm

Yes. I need the lan ports and get the "hub" part for free.

I could've maybe tried another USB-lan chip, but 1) this one works on the raspberry 2) I need at least one hub anyway. (I would've gotten by with a bare usb-ethernet chip and a LAN9512, but the complexity of two different chips is not worth the trouble at this point in time).

So with each having 4 downstream USB ports, there are a total of 8 downstream ports. And with one being used for the other lan chip there are 7 "open". I've wired up one USB port to a micro USB connector. Currently useful for communicating with other hardware in the project... So there are 6 of those ports that are just dangling there....
Last edited by rew on Wed May 08, 2019 10:35 am, edited 1 time in total.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

andrum99
Posts: 543
Joined: Fri Jul 20, 2012 2:41 pm

Re: Two LAN9514 chips on one raspberry.

Tue May 07, 2019 8:20 pm

This won't be a problem, for several reasons. Firstly, the LAN9514 built into the Pi uses a custom USB device ID: I would not expect the firmware to set the MAC address on any 'standard' LAN9514 which may be present. Also, you can set the MAC address to whatever you want in your chosen OS: this is very easy to do. Thirdly, if you are building your own hardware, you can set the MAC address of the LAN9514 by attaching an i2c EEPROM to it. (In fact, unless you do it will have no preset MAC address).

W. H. Heydt
Posts: 9988
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Two LAN9514 chips on one raspberry.

Tue May 07, 2019 9:26 pm

andrum99 wrote:
Tue May 07, 2019 8:20 pm
This won't be a problem, for several reasons. Firstly, the LAN9514 built into the Pi uses a custom USB device ID: I would not expect the firmware to set the MAC address on any 'standard' LAN9514 which may be present. Also, you can set the MAC address to whatever you want in your chosen OS: this is very easy to do. Thirdly, if you are building your own hardware, you can set the MAC address of the LAN9514 by attaching an i2c EEPROM to it. (In fact, unless you do it will have no preset MAC address).
OP is putting the LAN packages on the carrier board for a CM3. CM3 doesn't have anything but SoC, memory, and eMMC flash on it. The LAN chip on a B-series Pi isn't relevant, save that he is using the same one that has been used from the B+ through the Pi3B.

User avatar
rpdom
Posts: 14074
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Two LAN9514 chips on one raspberry.

Wed May 08, 2019 5:19 am

This post in the Compute Module forum might be of interest: viewtopic.php?f=98&t=239594

Also, consider asking for your (OP) post to be moved to the Compute Module area rather than General Discussion, as it may get more relevant responses.
Signature is on holiday.

Return to “Compute Module”