why the MAC addresss is 00:00:00:00:00:00 on 9200

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

armleaner
Posts: 4
Joined: Fri Feb 24, 2006 10:11 am

why the MAC addresss is 00:00:00:00:00:00 on 9200

Fri Feb 24, 2006 10:19 am

hi, I meet something mysterious. I have store my kernel and ramdisk in my flash. but when the system boot up. i use "ifconfg -a " , i found the eth0 mac address is 00:00:00:00:00:00. But if i interrupt the autoboot, and use "tftp" down load something to my board, and then boot up the system. it got the correct MAC address!!! Is there anyone can help me? thank you!!!
Plohish
Posts: 17
Joined: Wed Dec 28, 2005 4:07 pm

Sun Feb 26, 2006 8:22 am

Looks like MAC-addr not saved in Flash or something. I'm at the same stage, but have 00:...:00 every time - it's even worse riddle. But ... I think the mystery is not what you've asked... How Linux knows the location of u-boot's environment?! I use u-boot 1.1.4 and Linux 2.6 version for at91rm9200.
liftboy
Posts: 17
Joined: Sun Dec 11, 2005 1:17 am

Re: why the MAC addresss is 00:00:00:00:00:00 on 9200

Sun Feb 26, 2006 8:12 pm

armleaner wrote:... But if i interrupt the autoboot, and use "tftp" down load something to my board, and then boot up the system. it got the correct MAC address!!! Is there anyone can help me? thank you!!!
it's pretty simple.
you have to program your board mac address 'by hand' every time you boot up. if you boot by tftp your card is programmed by uboot - look at the uboot's environment variable called ethaddr. it's special, protected variable. you can't change it directly - first you have to 'clear' it by setting to empty value, next you can program new mac.
in linux you can set mac address by ifconfig command, e.g. ifconfig eth0 hw ether 01:23:45:67:89:ab
armleaner
Posts: 4
Joined: Fri Feb 24, 2006 10:11 am

Tue Feb 28, 2006 3:24 am

Thank you for your answer my question!!! I found the problem lies in here: u-boot save the MAC address in its env area, and when the u-boot boot up, it will not initialize the MAC register until the user use network to download the file. And the linux(ATMEL provide) get the MAC address directly from the 9200 MAC register(at this moment, these registers have not been initialized), so the linux will get the MAC address are all zero!!!

I also can set the MAC address by manaual in linux. Is there any one can resolve the problem. I am a hardware engineer, help me please!!!


by the way,
Plohish -- can you compile uboot1.1.4 correctly by toolchain 2.95.3 ? I met some error report!

liftboy--- thank you for your advice
armleaner
Posts: 4
Joined: Fri Feb 24, 2006 10:11 am

This bug has been fixed!

Wed Mar 01, 2006 3:02 am

last night, I add the following code before main loop in board.c. I resolved the MAC address problem!

{
ulong reg;
AT91PS_EMAC p_mac;

p_mac = AT91C_BASE_EMAC;

*AT91C_PMC_PCER = 1 << AT91C_ID_EMAC; /* Peripheral Clock Enable Register */
p_mac->EMAC_SA2L = (gd->bd->bi_enetaddr[3] << 24) | (gd->bd->bi_enetaddr[2] << 16) | (gd->bd->bi_enetaddr[1] << 8) | (gd->bd->bi_enetaddr[0]);
p_mac->EMAC_SA2H = ((gd->bd->bi_enetaddr[5] << 8) | (gd->bd->bi_enetaddr[4]<< 0));

}

Today, I receive a e-mail from atmel. Nathalie CYRILLE provide a more better way to resolve the problem.

#ifdef CONFIG_AT91RM9200DK
eth_init(gd->bd);
#endif

I hope this will help anyone who has the same problem!!! thank you again Nathalie CYRILLE.
niksky
Location: sydney
Posts: 5
Joined: Sun Sep 24, 2006 5:20 am

mac address

Wed Jun 06, 2007 2:22 pm

you can make the mac address programmed into uboot or complied special uboot.
i would like to know where i can get "real mac address for this device"
Can atmel provide them or the chip supplier?
I hope i dont have to get my own vendor id and pay the admin fee! just to get a Mac address that i can use in production.
I was expecting to use a chip with a pre loaded mac address which can be changed by software. ( i dont care what vendor code is used on my app)
How is this normally handled?
ulf
Location: Sweden
Posts: 134
Joined: Wed Feb 18, 2004 5:53 pm

Re: mac address

Wed Jun 06, 2007 10:29 pm

niksky wrote:you can make the mac address programmed into uboot or complied special uboot.
i would like to know where i can get "real mac address for this device"
Can atmel provide them or the chip supplier?
I hope i dont have to get my own vendor id and pay the admin fee! just to get a Mac address that i can use in production.
I was expecting to use a chip with a pre loaded mac address which can be changed by software. ( i dont care what vendor code is used on my app)
How is this normally handled?
The maintainers of u-boot will not allow patches that initializes the
the U-Boot MAC address, because they beleive that is the job of the linux kernel.
The proper way is to pass a mac address as a parameter to the kernel.
I have no clue if this works, since I did the fix myself in my u-boot.

AFAIK, Atmel has no plans to provide MAC addresses with their kits.
There is no volatile memory in the AT91RM9200/SAM926x chips
so it is really not possible to do that.

For prototyping, you can steal the MAC address of an obsolete network card
or buy a new one, or (WARNING BAD IDEA): invent one.
Best Regards
Ulf Samuelsson
mwolfram
Contact:
Location: Erfurt/Germany
Posts: 87
Joined: Thu Feb 03, 2005 11:41 am

Wed Jun 20, 2007 7:37 am

Hi,

an alternativ way is to use the small to which comes with u-boot and can read u-boot environment. So you can read the mac and pass it to ifconfig.

--
Mike
Senior IT Consultant
Germany

Return to “LINUX”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests