2009-03-18 12:39:55     How do I setup ethernet on a custom BF561 with no EEPROM

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-18 12:39:55     How do I setup ethernet on a custom BF561 with no EEPROM

John Redford (UNITED KINGDOM)

Message: 71208   

 

Hi, we are running uClinux on a custom bf561.

 

The ethernet fails to initialise in linux unless it has been initialised in u-boot first:

 

smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>

eth0: SMC91C11xFD (rev 2) at 2c010300 IRQ 82 [nowait]

eth0: Invalid ethernet MAC address.  Please set using ifconfig

physmap platform flash device: 00800000 at 20000000

physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank

Amd/Fujitsu Extended Query Table at 0x0040

physmap-flash.0: Swapping erase regions for broken CFI table.

number of CFI chips: 1

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.

RedBoot partition parsing not available

Using physmap partition information

Creating 3 MTD partitions on "physmap-flash.0":

0x00000000-0x00040000 : "Bootloader"

0x00040000-0x00200000 : "Kernel"

0x00200000-0x00800000 : "RootFS"

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@16

TCP cubic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

jffs2_scan_inode_node(): CRC failed on node at 0x004749ec: Read 0xffffffff, calculated 0xbee03ea7

VFS: Mounted root (jffs2 filesystem).

Freeing unused kernel memory: 100k freed

dma_alloc_init: dma_page @ 0x0017c000 - 256 pages at 0x03600000

Unknown option

SIOCSIFFLAGS: Invalid argument

SIOCSIFFLAGS: Invalid argument

can't find service

 

That is what is shown whilst booting... However, if I try to ping an ip in u-boot first, then when uClinux boots, eth0 initialises correctly.

 

I presume this is due to the lack of EEPROM, storing the MAC address. I have spent some time looking through the forums for similar problems and found quite a few hits.. however, there never seems to be a definitive answer given as to what should be done to overcome this... Should I modify kernel settings? and if so, what is the easiest way to get this up and running?

 

How does u-boot find the MAC address if there is no EEPROM ?

 

Thanks in advance for any advice.

 

John Redford.

QuoteReplyEditDelete

 

 

2009-03-18 14:35:54     Re: How do I setup ethernet on a custom BF561 with no EEPROM

Mike Frysinger (UNITED STATES)

Message: 71217   

 

you need to assign the MAC address yourself.  this can be done with `ifconfig hw <mac>`.

QuoteReplyEditDelete

 

 

2009-03-19 08:03:27     Re: How do I setup ethernet on a custom BF561 with no EEPROM

John Redford (UNITED KINGDOM)

Message: 71265   

 

Hi, thanks for the speedy reply.

 

This is a valid solutions, however, we require the ethernet driver to initialise the MAC at startup, allowing the system to run autonomously... Setting the MAC manually in a linux config file for every board will be too time consuming and is not what we want to do.

 

I figured that since u-boot can setup the ethernet automatically, there must be similar functions in the linux ethernet driver to perform the same initialisation?

 

Please could you point me towards the settings / functions which could be used to do this, in the smc91111 driver?

 

 

 

Thanks again,

 

John R.

QuoteReplyEditDelete

 

 

2009-03-19 08:09:17     Re: How do I setup ethernet on a custom BF561 with no EEPROM

Mike Frysinger (UNITED STATES)

Message: 71266   

 

i dont really understand what you mean.  adding `ifconfig` to the init scripts (i.e. /etc/rc) is exactly the same level of automation as if the driver did it during boot.

QuoteReplyEditDelete

 

 

2009-03-19 09:23:20     Re: How do I setup ethernet on a custom BF561 with no EEPROM

John Redford (UNITED KINGDOM)

Message: 71267   

 

Yes, but that requires prior knowledge of the MAC by the programmer.

 

Currently, without user intervention, u-boot initialises the ethernet. Linux does not.

 

We require linux to setup the ethernet in the same way that u-boot is doing so. This is because in our final release we will not be able to manually set the MAC in the rc profile.

 

Thanks again,

 

John R.

QuoteReplyEditDelete

 

 

2009-03-19 17:45:46     Re: How do I setup ethernet on a custom BF561 with no EEPROM

Mike Frysinger (UNITED STATES)

Message: 71283   

 

i didnt say you had to hardcode the mac in the rc file.  i said you had to run ifconfig there.  how you get the mac exactly doesnt matter.  it's a shell script, so you're free to make the logic as dynamic/static as you want.

 

i dont see how u-boot could possibly program the mac address if you dont have an eeprom to store it.  otherwise it's going to merely cram random garbage in there if it does anything at all.

QuoteReplyEditDelete

 

 

2009-03-20 05:14:11     Re: How do I setup ethernet on a custom BF561 with no EEPROM

John Redford (UNITED KINGDOM)

Message: 71297   

 

Ahh I think I understand now. I guess u-boot was filling the MAC with random garbage and this got my hopes up.

 

Thanks for the advice/help. I think eventually we will just program a pre-determined 6 bytes of the flash with the MAC, as suggested in a similar thread.

 

Cheers,

 

John R.

Attachments

    Outcomes