Hi all,
I need some help about setting mac address. I don't use uboot. How can I set MAC address of system.
Thanks
Mehmet
You could google about 'ethtool' utility, in sources for gingerbread I am find some matches with it.
/kernel_imx/net/core/ethtool.c
could not say about it more, because never work with it, but may be it will help you
is it only one way to resolve the problem, maybe you will find alternative.
This is a method, ok..
I boot from sdcard...and i save the mac address in the environment of sdcard using "setenv ethaddr <your new mac>".
But if in the same board, i insert a new sdcard..automatically the mac address is different, because like mac address is taken the one present in the new sdcard, instead the mac address must be univocal for a board.
There is a tool under uboot:
U-BOOT >mii
"
Usage:
mii device - list available devices
mii device <devname> - set current device
mii info <addr> - display MII PHY info
mii read <addr> <reg> - read MII PHY <addr> register <reg>
mii write <addr> <reg> <data> - write MII PHY <addr> register <reg>
mii dump <addr> <reg> - pretty-print <addr> <reg> (0-5 only)
Addr and/or reg may be ranges, e.g. 2-7.
"
but i can't use it !!
Kirill Danilenko said:
U-BOOT > setenv ethaddr <your new mac>
U-BOOT > setenv ethaddr <your new mac>
I have to set it when it makes the boot...
Kirill Danilenko said:
does "ifconfig" command not do it?
http://linuxhelp.blogspot.com/2005/09/how-to-change-mac-address-of-...
does "ifconfig" command not do it?
http://linuxhelp.blogspot.com/2005/09/how-to-change-mac-address-of-your.html
I have to set mac address too...any idea?
I can set MAC address only using bit burner where i go to write the otp register HW_OCOTP_CUST0 after changing the first fixed 16bit in mx28_evk.c under uboot sources.
Is it possible to do the same thing without using bitburner? Maybe in the boot sequence...what about using mii utilities?
Thanks
I have to set mac address too...any idea?
What about using mii utility ?
This is how U-Boot does it.(For eth0 only)
int fec_get_mac_addr(unsigned char *mac)
{
u32 val;
/*set this bit to open the OTP banks for reading*/
REG_WR(REGS_OCOTP_BASE, HW_OCOTP_CTRL_SET,
BM_OCOTP_CTRL_RD_BANK_OPEN);
/*wait until OTP contents are readable*/
while (BM_OCOTP_CTRL_BUSY & REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CTRL))
udelay(100);
mac[0] = 0x00;
mac[1] = 0x04;
val = REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CUSTn(0));
mac[2] = (val >> 24) & 0xFF;
mac[3] = (val >> 16) & 0xFF;
mac[4] = (val >> 8) & 0xFF;
mac[5] = (val >> 0) & 0xFF;
return 0;
}
The first 2 32bit OCOTP is used to store mac address. You need to read Enthernet part of datasheet and then you know how to set mac address to register.
Read uboot code and learn how it set mac address.