2008-04-16 06:27:10     smsc9118 to smsc911x

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

2008-04-16 06:27:10     smsc9118 to smsc911x

Michiel Verschueren (BELGIUM)

Message: 54330    Hi,

 

I'm using a board with an smsc lan9115 ethernet chip. This works without any problems using the existing lan9118 driver, given a few minor adaptations. I would suggest to alter the existing driver to a generic lan911x driver, since the family of IC's (lan9115-lan9118 and lan9215-lan9218) are entirely compatible.

 

Basically, the only necessary change is to check the contents of the ID_REV register against a few more revisions than the 9118 revision (see smsc9118_initialize() function in smsc9118.c).

 

By the way: the uClinux driver is also a generic 911x driver.

 

If anyone tells me how, I will gladly contribute this extension.

QuoteReplyEditDelete

 

 

2008-04-16 11:07:20     Re: smsc9118 to smsc911x

Mike Frysinger (UNITED STATES)

Message: 54350    just post the diff you made as an attachment and i'll see about merging it

 

upstream u-boot should be merging a newer/nicer smsc911x driver soon, so we'll probably switch to that in the future

QuoteReplyEditDelete

 

 

2008-04-17 07:53:38     Re: smsc9118 to smsc911x

Michiel Verschueren (BELGIUM)

Message: 54412    Hi Mike,

 

1) I've attached the driver files (to be added in the /drivers folder)

 

2) in /net/eth.c:

- below extern int smsc9118_initialize(bd_t *bis);, add extern int smsc911x_initialize(bd_t *bis);

- below

#if defined(CONFIG_DRIVER_SMSC9118)

    smsc9118_initialize(bis);

#endif

 

add

 

#if defined(CONFIG_DRIVER_SMSC911X)

    smsc911x_initialize(bis);

#endif

 

 

3) To compile, you will have to add "smsc911x.o" to the COBJS list in /drivers/Makefile

 

 

The smsc9118 references are only necessary for boards that define CONFIG_DRIVER_SMSC9118. Any such definition can be replaced by CONFIG_DRIVER_SMSC911X. After this, the smsc9118.[c|h] files can be removed, as well as the references to smsc9118 in /drivers/Makefile and /net/eth.c.

 

This driver works for my ezkit-based board with a lan9115 and, because I haven't changed anything in the implementation, will work with a lan9118 or lan9218. It should also work with the other devices in the family, but I have not tested this.

smsc911x.c

smsc911x.h

QuoteReplyEditDelete

Attachments

Outcomes