[U-Boot] Remove board specific code from ENC28J60 network driver?
Ben Warren
biggerbadderben at gmail.com
Sun Dec 20 20:54:56 CET 2009
Dirk,
On Sun, Dec 20, 2009 at 11:30 AM, Dirk Behme <dirk.behme at googlemail.com>wrote:
>
> 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?
>
> From my brief glimpse I would think these should be changed to use the SPI
framework. Then board code is only concerned with configuring SPI properly.
> Best regards
>
> Dirk
>
> regards,
Ben
More information about the U-Boot
mailing list