linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Changing Mac address
@ 2008-07-28 14:25 Guillaume Dargaud
  2008-07-28 16:24 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Dargaud @ 2008-07-28 14:25 UTC (permalink / raw)
  To: linuxppc-dev

Hello all,
there's something I miss here. I'd like to setup a MAC address in software 
at the start of the boot process. I'm trying to figure out where this is 
done in the kernel code.
I'm on a custom variant of a Xilinx ML405 card, still in PPC arch.
So it appears to be going in the arch/ppc/boot/simple/embed_config.c piece 
of code, but since I don't have I2C, the only 'relevant' code is this one:

#if (!defined(CONFIG_XILINX_MLxxx) || !defined(XPAR_IIC_0_BASEADDR) || 
!defined(XPAR_PERSISTENT_0_IIC_0_BASEADDR))
int get_cfg_data(unsigned char **cfg_data) {
#warning I2C needed for obtaining the Ethernet MAC address. Using hard-coded 
MAC address
 return 0; /* no cfg data found */
}

Nonetheless, ifconfig (from busybox) gives me a proper MAC address 
(00:0A:35:01:02:03) and can even change it:
ifconfig eth0 down hw ether 00:0A:35:01:02:10 up
But I want to do that before the network is up.

What is the relevant kernel section to change in order to set the MAC 
address ?
Thanks.
-- 
Guillaume Dargaud
http://www.gdargaud.net/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Changing Mac address
  2008-07-28 14:25 Changing Mac address Guillaume Dargaud
@ 2008-07-28 16:24 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2008-07-28 16:24 UTC (permalink / raw)
  To: Guillaume Dargaud; +Cc: linuxppc-dev

On Mon, Jul 28, 2008 at 04:25:54PM +0200, Guillaume Dargaud wrote:
> Hello all,
> there's something I miss here. I'd like to setup a MAC address in 
> software at the start of the boot process. I'm trying to figure out where 
> this is done in the kernel code.
> I'm on a custom variant of a Xilinx ML405 card, still in PPC arch.
> So it appears to be going in the arch/ppc/boot/simple/embed_config.c 

Yes, this is the correct location to set it.  Do whatever you need to
set a different MAC address.

In arch/powerpc this all goes away and you can just set it in the device
tree.

g.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-28 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-28 14:25 Changing Mac address Guillaume Dargaud
2008-07-28 16:24 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).