Quantcast

MAC Address

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MAC Address

Dan Nelson

I’ll be using a LAN9221 on a custom expansion board but I’ll also be using a Microchip MAC address eeprom on the i2c bus.  So at some point I’ll have to configure the LAN9221 with this address.  Is this going to be an easy change to the driver?  Where exactly do I find the driver source and what’s the process needed to change it?

 

Thanks

 

Dan


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

ashcharles
Hi Dan,

On Sun, Feb 26, 2012 at 7:36 PM, Dan Nelson <[hidden email]> wrote:
> I’ll be using a LAN9221 on a custom expansion board but I’ll also be using a
> Microchip MAC address eeprom on the i2c bus.  So at some point I’ll have to
> configure the LAN9221 with this address.  Is this going to be an easy change
> to the driver?  Where exactly do I find the driver source and what’s the
> process needed to change it?
The LAN9221 gets initialized by uboot with a call to
smc911x_initialize from drivers/net/smc911x.c --- this function has
some code to read an optional eeprom.
Similarly, drivers/net/smsc911x.c is the driver file in linux.

-Ash

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

Chris Cotton
In reply to this post by Dan Nelson
If you fit the optional EEPROM to the LAN9221, you may be interested to know that the utility 'ethtool' is compatible with the LAN9221, and can be used to easily set the MAC address.  Ethtool is available in the openembedded recipes.  If you include it in your gumstix RFS, you can set the MAC from the command line as follows:

# ethtool -E eth0 offset 0 value 165
# ethtool -E eth0 offset 1 value <1st byte of MAC address>
# ethtool -E eth0 offset 2 value <2nd byte of MAC address>
# ethtool -E eth0 offset 3 value <3rd byte of MAC address>
# ethtool -E eth0 offset 4 value <4th byte of MAC address>
# ethtool -E eth0 offset 5 value <5th byte of MAC address>
# ethtool -E eth0 offset 6 value <6th byte of MAC address>

The value 165 is a 'magic number' required by the LAN9221 to confirm that the EEPROM data is a MAC address.
The MAC address bytes need to be entered in decimal, not hex when using this tool.

You can read the MAC back directly from the EEPROM by entering:
# ethtool -e eth0

After setting the MAC and rebooting the unit, the new MAC should take effect.  Be warned, on my Gumstix, upon rebooting the system detected the LAN9221 as ETH1 rather then ETH0, since the system uses the MAC address to recognise each LAN card.  I had to connect via serial and edit /etc/udev/rules.d/70-persistent-net.rules to get the LAN back to ETH0.

Also, my Windows PC got confused (presumably because it 'saw' two devices with the same IP address but different MAC addresses) and it needed rebooting before it would talk happily to the Gumstix.

Hope this helps,
Chris Cotton
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

Dan Nelson
Thanks Chris, that's very useful.

Dan

-----Original Message-----
From: Chris Cotton [mailto:[hidden email]]
Sent: Tuesday, February 28, 2012 6:55 PM
To: [hidden email]
Subject: Re: [Gumstix-users] MAC Address

If you fit the optional EEPROM to the LAN9221, you may be interested to
know
that the utility 'ethtool' is compatible with the LAN9221, and can be
used
to easily set the MAC address.  Ethtool is available in the openembedded
recipes.  If you include it in your gumstix RFS, you can set the MAC
from
the command line as follows:

# ethtool -E eth0 offset 0 value 165
# ethtool -E eth0 offset 1 value <1st byte of MAC address>
# ethtool -E eth0 offset 2 value <2nd byte of MAC address>
# ethtool -E eth0 offset 3 value <3rd byte of MAC address>
# ethtool -E eth0 offset 4 value <4th byte of MAC address>
# ethtool -E eth0 offset 5 value <5th byte of MAC address>
# ethtool -E eth0 offset 6 value <6th byte of MAC address>

The value 165 is a 'magic number' required by the LAN9221 to confirm
that
the EEPROM data is a MAC address.
The MAC address bytes need to be entered in decimal, not hex when using
this
tool.

You can read the MAC back directly from the EEPROM by entering:
# ethtool -e eth0

After setting the MAC and rebooting the unit, the new MAC should take
effect.  Be warned, on my Gumstix, upon rebooting the system detected
the
LAN9221 as ETH1 rather then ETH0, since the system uses the MAC address
to
recognise each LAN card.  I had to connect via serial and edit
/etc/udev/rules.d/70-persistent-net.rules to get the LAN back to ETH0.

Also, my Windows PC got confused (presumably because it 'saw' two
devices
with the same IP address but different MAC addresses) and it needed
rebooting before it would talk happily to the Gumstix.

Hope this helps,
Chris Cotton


--
View this message in context:
http://gumstix.8.n6.nabble.com/MAC-Address-tp4512973p4521681.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------
------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

the suicidal eggroll
In reply to this post by Chris Cotton
Unfortunately this isn't working for me.  The LAN and EEPROM are identical to those used on the Tobi board, laid out in the same way, but ethtool is having problems setting the MAC.

# ethtool -e eth0
Offset Values
------ ------
0x0000 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0010 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0020 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0030 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0040 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0050 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0060 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
0x0070 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef

# ethtool -E eth0 offset 0 value 165
Cannot set EEPROM data: Invalid argument

# ethtool -e eth0
Cannot get EEPROM data: Invalid argument

No matter what offsets or values I give "ethtool -E", it always returns "Invalid argument", and after running it just once I can no longer read back the EEPROM with "ethtool -e" either.  I end up having to reboot, and then "ethtool -e" can read without issue again but I still can't write.

The ethernet is working perfectly on the device, it's just coming up with a random MAC address at every boot.

Any suggestions?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

Nye, Philip
It's not a lot of help, but the data you're reading doesn't look genuine anyway. I'd expect ff ff ff …

Is this one prototype or consistent across a bunch of boards?

When you say the EEPROM is identical, do you mean same part code from same manufacturer? or just same base number? The basic 93C46 part comes in a huge mass of subtly different versions from a lot of manufacturers and I'm pretty sure we've had discontinued notices on some of the ones we originally specified.

Try removing R31(Tobi designator) - the 10K pull-down on nCS which seems wrong to me and I haven't used). You could also try reducing R29 a bit (e.g. 4K7).

Philip

On 30 Sep 2013, at 17:19, the suicidal eggroll <[hidden email]> wrote:

> Unfortunately this isn't working for me.  The LAN and EEPROM are identical to
> those used on the Tobi board, laid out in the same way, but ethtool is
> having problems setting the MAC.
>
> # ethtool -e eth0
> Offset Values
> ------ ------
> 0x0000 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0010 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0020 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0030 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0040 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0050 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0060 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
> 0x0070 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>
> # ethtool -E eth0 offset 0 value 165
> Cannot set EEPROM data: Invalid argument
>
> # ethtool -e eth0
> Cannot get EEPROM data: Invalid argument
>
> No matter what offsets or values I give "ethtool -E", it always returns
> "Invalid argument", and after running it just once I can no longer read back
> the EEPROM with "ethtool -e" either.  I end up having to reboot, and then
> "ethtool -e" can read without issue again but I still can't write.
>
> The ethernet is working perfectly on the device, it's just coming up with a
> random MAC address at every boot.
>
> Any suggestions?
>
>
>
> --
> View this message in context: http://gumstix.8.x6.nabble.com/MAC-Address-tp4512973p4968023.html
> Sent from the Gumstix mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

the suicidal eggroll
Philip - Thanks for the reply.  The ethtool behavior (including the odd
"0f ef" pattern) is consistent on all five prototype boards.  The part
is the one specified in the Tobi schematic, 93AA76C from Microchip
Technology.  I'll try your suggestions in regards to R31 and R29 if the
suggestion below doesn't work.

Katu - That sounds very promising.  I've looked closer at the Tobi I
have sitting here and you're right, the part actually being used is the
46A, not the 76C referenced in the schematic.  I'll pick up a few
93AA46A and see if swapping it out fixes the problem.

-Adam

On 09/30/2013 10:41 AM, Nye, Philip wrote:

> It's not a lot of help, but the data you're reading doesn't look genuine anyway. I'd expect ff ff ff …
>
> Is this one prototype or consistent across a bunch of boards?
>
> When you say the EEPROM is identical, do you mean same part code from same manufacturer? or just same base number? The basic 93C46 part comes in a huge mass of subtly different versions from a lot of manufacturers and I'm pretty sure we've had discontinued notices on some of the ones we originally specified.
>
> Try removing R31(Tobi designator) - the 10K pull-down on nCS which seems wrong to me and I haven't used). You could also try reducing R29 a bit (e.g. 4K7).
>
> Philip
>
> On 30 Sep 2013, at 17:19, the suicidal eggroll <[hidden email]> wrote:
>
>> Unfortunately this isn't working for me.  The LAN and EEPROM are identical to
>> those used on the Tobi board, laid out in the same way, but ethtool is
>> having problems setting the MAC.
>>
>> # ethtool -e eth0
>> Offset Values
>> ------ ------
>> 0x0000 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0010 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0020 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0030 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0040 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0050 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0060 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>> 0x0070 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef 0f ef
>>
>> # ethtool -E eth0 offset 0 value 165
>> Cannot set EEPROM data: Invalid argument
>>
>> # ethtool -e eth0
>> Cannot get EEPROM data: Invalid argument
>>
>> No matter what offsets or values I give "ethtool -E", it always returns
>> "Invalid argument", and after running it just once I can no longer read back
>> the EEPROM with "ethtool -e" either.  I end up having to reboot, and then
>> "ethtool -e" can read without issue again but I still can't write.
>>
>> The ethernet is working perfectly on the device, it's just coming up with a
>> random MAC address at every boot.
>>
>> Any suggestions?
>>
>>
>>
>> --
>> View this message in context: http://gumstix.8.x6.nabble.com/MAC-Address-tp4512973p4968023.html
>> Sent from the Gumstix mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
>> the latest Intel processors and coprocessors. See abstracts and register >
>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> gumstix-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

Chris Cotton
Hi Adam, just noticed your posts.
I can confirm that we use the 93AA46A on our custom PCBs.  I would not expect the 76C to work, as it has the wrong memory address pattern.

Quoted from the SMSC92111 Datasheet:
The LAN9221/LAN9221i EEPROM controller also allows the host system to read, write and erase the contents of the Serial EEPROM. The EEPROM controller supports most “93C46” type EEPROMs configured for 128 x 8-bit operation.

Interestingly, this appears to be an error which has crept into Later versions of the schematic; our archived version of the schematic from June 2009 has the correct 93AA46A part shown...

Other than that, we use the same components around the IC as shown the TOBI board schematic.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

the suicidal eggroll
I'd just like to thank Katu and Chris, swapping out the EEPROM fixed the issue.

The EEPROM specified in the Tobi schematic - 93AA76CST - appears to be incompatible with the LAN9221 being used on the Tobi.  It seems to be another case of the part numbers specified in the Tobi schematic not reflecting what's actually being used in production.

The part actually being used on the Tobi appears to be the 93AA46A.  After swapping out the EEPROM with this new part, everything works as expected.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC Address

Andrew Simpson
Adam, Chris and Philip,

Thank you for bringing this to our attention. One of our hardware engineers has confirmed that the 93AA46A is in fact the correct part and we've added this to our README for the Tobi board. We're glad you were able to get everything working as expected!

Andrew Simpson
Content Developer


On 7 October 2013 15:04, the suicidal eggroll <[hidden email]> wrote:
I'd just like to thank Katu and Chris, swapping out the EEPROM fixed the
issue.

The EEPROM specified in the Tobi schematic - 93AA76CST - appears to be
incompatible with the LAN9221 being used on the Tobi.  It seems to be
another case of the part numbers specified in the Tobi schematic not
reflecting what's actually being used in production.

The part actually being used on the Tobi appears to be the 93AA46A.  After
swapping out the EEPROM with this new part, everything works as expected.



--
View this message in context: http://gumstix.8.x6.nabble.com/MAC-Address-tp4512973p4968066.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Loading...