Skip to contentSkip to conversation

MACB and DM9000 support for AT91SAM9260

U-Boot Frank v/d Schoot 4 participants 5 messages Sep 2, 2008 – Sep 3, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi All,

We have a board with 2 ethernet ports: one on the macb and the other on a dm9000-chip. Got them both working under linux but the dm9000 doesn't get a MAC-address assigned now. I would like to give the dm9000 its MAC-address in U-Boot via a environment-variable. Because I'm new to U-Boot, I do not see how I can initialise the dm9000 (eth_init()) and macb (which is initialised via eth_init() in eth.c). To me it looks like macb & dm9000 driver are using a different type of driver concept. How can this problem be tackled?

Greetings Frank

#1 lore raw
Quoted 7 lines · Frank v/d Schoot

We have a board with 2 ethernet ports: one on the macb and the other on a dm9000-chip. Got them both working under linux but the dm9000 doesn't get a MAC-address assigned now. I would like to give the dm9000 its MAC-address in U-Boot via a environment-variable. Because I'm new to U-Boot, I do not see how I can initialise the dm9000 (eth_init()) and macb (which is initialised via eth_init() in eth.c). To me it looks like macb & dm9000 driver are using a different type of driver concept. How can this problem be tackled?

I don't know much about dm9000, but the macb driver is initialized by calling macb_eth_initalize() once for each instance you want to use. So assuming dm9000 has something similar, you'll just have to call both of them from board_eth_init() in the order you prefer.

Haavard

#2 lore raw

Hi,

Quoted 11 lines · Haavard Skinnemoen
Quoted 8 lines · Frank v/d Schoot

We have a board with 2 ethernet ports: one on the macb and the other on a dm9000-chip. Got them both working under linux but the dm9000 doesn't get a MAC-address assigned now. I would like to give the dm9000 its MAC-address in U-Boot via a environment-variable. Because I'm new to U-Boot, I do not see how I can initialise the dm9000 (eth_init()) and macb (which is initialised via eth_init() in eth.c). To me it looks like macb & dm9000 driver are using a different type of driver concept. How can this problem be tackled?

Quoted 3 lines

I don't know much about dm9000, but the macb driver is initialized by calling macb_eth_initalize() once for each instance you want to use. So

I think that the mac address of the dm9000 is on the eeprom. Linux write it using
ethtool. Take a look at the dm9000_write_eeprom in the linux code. I think that if you want
to use enviroment variable of u-boot, you must write in the eeprom only if the value is different
from the enviroment variable.

Quoted 5 lines

assuming dm9000 has something similar, you'll just have to call both of them from board_eth_init() in the order you prefer.

Haavard

Michael

#3 lore raw

This is certainly a good option, maybe I try to make the dm9000x-driver a eth_device. But if this is too hard than this will be my fall-back scenario.

{-------
I think that the mac address of the dm9000 is on the eeprom. Linux write

it using
ethtool. Take a look at the dm9000_write_eeprom in the linux code. I think that if you want
to use enviroment variable of u-boot, you must write in the eeprom only if the value is different
from the enviroment variable.

Quoted 1 line

assuming dm9000 has something similar, you'll just have to call both

of

Quoted 4 lines

them from board_eth_init() in the order you prefer.

Haavard

Michael
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

[Re-adding mailing list to Cc]

Quoted 8 lines · Frank van der Schoot

Well after some more investigation: the macb-driver is creating an eth_device-structure and this structure is initialised in macb_eth_initialize() and then registered with eth_register(). So this gives it some abstraction. Dm9000 driver doesn't have this. It has eth_init() (To my opinionL it collides with eth_init() of eth.c), eth_send() and doesn't register itself with eth_register(). Question:
Should all ethernet devices register itself via eth_register() (and the dm9000-driver is not updated yet for this method)?

Right...it looks like the dm9000 driver uses some sort of pre-net/eth.c interface which doesn't play well along with other drivers...

Quoted 4 lines

Via hacking I can of course rename the eth_init() of dm9000x.c to dm9000_eth_init() and call it from eth_initialize(). But first I like to try it via a decent construction and maybe I should update the dm9000-driver for working with eth_register().

That would be great.

Quoted 4 lines

By the way I'm working with Uboot 1.3.3 on which I cannot find board_eth_init() but here eth_initialize() does the initialisation of macb_eth_initialize(). I did have a short peek to the trunk but it looks like the dm9000-driver hasn't changed there.

I think 1.3.4 should have the board_eth_init() stuff in place. Ben's latest eth-initialization patches are probably worth a look too:

http://lists.denx.de/pipermail/u-boot/2008-September/039792.html

...though it looks like dm9000 is one of the "more complicated ones".

Haavard