public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Remove board specific code from ENC28J60 network driver?
@ 2009-12-20 19:30 Dirk Behme
  2009-12-20 19:54 ` Ben Warren
  2009-12-20 20:05 ` Mike Frysinger
  0 siblings, 2 replies; 12+ messages in thread
From: Dirk Behme @ 2009-12-20 19:30 UTC (permalink / raw)
  To: u-boot


For TI OMAP3 Beagle based Zippy expansion board from TinCanTools [1] 
I'm currently looking into reusing spi based ENC28J60 network driver

drivers/net/enc28j60.c

It seems to me that it uses LPC2292 specific macros

IO1CLR, IO1SET and IO1DIR

These macros are defined in

asm-arm/arch-lpc2292/lpc2292_registers.h

 From enc28j60.c:

...
#define enc_enable() PUT32(IO1CLR, ENC_SPI_SLAVE_CS)
#define enc_disable() PUT32(IO1SET, ENC_SPI_SLAVE_CS)
...

...
/* configure GPIO */
(*((volatile unsigned long *) IO1DIR)) |= ENC_SPI_SLAVE_CS;
(*((volatile unsigned long *) IO1DIR)) |= ENC_RESET;

/* CS and RESET active low */
PUT32 (IO1SET, ENC_SPI_SLAVE_CS);
PUT32 (IO1SET, ENC_RESET);
...

Anybody with an idea how to move this code to some (LPC2292?) board 
specific files to make enc28j60.c more generic to be able to reuse it 
on other boards?

Best regards

Dirk

[1] 
http://www.tincantools.com/product.php?productid=16147&cat=0&page=1&featured

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

end of thread, other threads:[~2009-12-28 21:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-20 19:30 [U-Boot] Remove board specific code from ENC28J60 network driver? Dirk Behme
2009-12-20 19:54 ` Ben Warren
2009-12-20 20:05 ` Mike Frysinger
2009-12-21  8:26   ` Dirk Behme
2009-12-21 13:17     ` Mike Frysinger
2009-12-25 18:57   ` Dirk Behme
2009-12-26 18:40     ` Mike Frysinger
2009-12-27  7:59       ` Dirk Behme
2009-12-27 15:32         ` Ben Warren
2009-12-27 18:55           ` Dirk Behme
2009-12-28 18:33             ` Mike Frysinger
2009-12-28 21:29             ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox