[ECOS] Re:ECOS] Re: Re: [ECOS] store mac address

越 王 wangyue0921@yahoo.com.cn
Fri Aug 10 08:05:00 GMT 2007


Hi Mark and ecosers,
    Some days ago,Mark told me try to use codes below
to store mac address to flash, in ixp425 board.
    And it worked,but I still have 3 questions.
    1  When I use "fconfig -i" to set mac address,and
reset my board the first time,the cmd "fconfig -l"
tell me the two macs were set successfully.But after
taht I reset my board several times,and found my
eth0's mac was still right while the eth1's mac was
changed into default value {0x00, 0x03, 0x47,0xdf,
0x32, 0xaa}.
    It is so strange that the redboot.bin was still
only one file.When first time set eth1's mac was
successfully and it can not changed itself.Since the
flash was non-volatile memery, when use fconfig write
it and reset several times without use fconfig -i cmd,
the mac should be stored always.  
   2  I can't change default net device from eth0 into
eth1.When I used the cmd "fconfig -i" to set this
option and reset the board, it said the default net
device was still eth0. 
   3  I want to read the codes about mac stored in
ixdp425 board and grg board.Which file can tell me how
the grg board store mac in flash? And which file can
tell me how ixdp425 board store mac in eeprom?
 
   Thank you!
                                      

--- Mark Salter <msalter@redhat.com>дµÀ:

> On Fri, 2007-04-20 at 15:04 +0800, Ô½ Íõ wrote:
> > > > I want to use the redboot command set_npe_mac
> to
> > > set a
> > > > new mac address,then what do I need to do?
> > > 
> > > set_npe_mac is used when there is an eeprom.
> > > If you are storing the mac in flash, use fconfig
> to
> > > set the mac.
> > > 
> > > --Mark
> > > 
> > The fconfig cmd doesn't have the option to set
> npe's
> > mac address.
> > Perhaps it is because when I configure the redboot
> use
> > the ixdp425 for my template.And at grg board, the
> cmd
> > fconfig has this option.
> > 
> > Since both two boards share the same file
> fconfig.c.
> > Maybe I can config some packages or options to
> store
> > the mac in flash, just like grg did it? How can I
> do
> > it?
> > 
> > If it does, the mac will stored in redboot config
> > area.But what is address it stored exactly?
> > 
> 
> In devs/eth/arm/grg/npe/<version>/include/*.inl, you
> will see something
> like:
> 
> #if defined(CYGPKG_REDBOOT) &&
> defined(CYGPKG_REDBOOT_FLASH) && \
>     defined(CYGSEM_REDBOOT_FLASH_CONFIG) &&
> defined(CYGPKG_REDBOOT_NETWORKING)
> 
> #define CYGSEM_NPE_REDBOOT_HOLDS_ESA 1
> #define CYGDAT_ETH0_DEFAULT_ESA {0x00, 0x03, 0x47,
> 0xdf, 0x32, 0xa8}
> #define CYGDAT_ETH1_DEFAULT_ESA {0x00, 0x03, 0x47,
> 0xdf, 0x32, 0xaa}
> #endif
> 
> It is the defining of CYGSEM_NPE_REDBOOT_HOLDS_ESA
> which causes RedBoot
> to create an fconfig option to hold the mac address.
> 
> --Mark
> 
> 
> 



      ___________________________________________________________ 
ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä3.5GÈÝÁ¿£¬20M¸½¼þ£¡ 
http://cn.mail.yahoo.com


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list