diff options
author | Bernhard Kaindl <bernhard.kaindl@gmx.net> | 2011-10-20 10:56:59 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-12-08 22:22:03 +0100 |
commit | d0201692988adc5d8cdbbf5e0cbf47e1a09708aa (patch) | |
tree | f810c8116edb270df1ab12435c7c68ebd8f88be3 /board | |
parent | d82a27bc5c404da907f71960a3ed2e148ac73fd0 (diff) |
ne2000: Convert to new net-multi model, fixes build of three boards
This fixes the build of the two sh boards shmin and r7780mp and qemu-mips
which currently fail to build due to dropped pre-CONFIG_NET_MULTI code.
This v2 patch minimizes the number of lines in the diff for easy review
and to eliminate any possible accidential changes resulting from moving
lines of code in the file. This also makes the register function very easy.
Any cleanups and improvements are intentionally deferred to follow-up patches
to keep this patch as simple and as easy to review as possible.
A new driver register function, ne2k_register() calls the existing
one-time setup part of the old init function and calls eth_register().
Changes to shmin, r7780mp and qemu-mips:
- Call the new ne2k_register() from board_eth_init() of the boards.
- Tested using qemu-mips board,
- Tested the two renesas / sh boards r7780mp and shmin to compile again,
and should work.
checkpatch-clean when "--ignore VOLATILE" is added to .checkpatch.conf,
and no warnings introduced in none of the three boards using this driver.
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@gmx.net>
Diffstat (limited to 'board')
-rw-r--r-- | board/qemu-mips/qemu-mips.c | 6 | ||||
-rw-r--r-- | board/renesas/r7780mp/r7780mp.c | 3 | ||||
-rw-r--r-- | board/shmin/shmin.c | 6 |
3 files changed, 14 insertions, 1 deletions
diff --git a/board/qemu-mips/qemu-mips.c b/board/qemu-mips/qemu-mips.c index 7a69a00f99a..2b3a1d6b099 100644 --- a/board/qemu-mips/qemu-mips.c +++ b/board/qemu-mips/qemu-mips.c @@ -25,6 +25,7 @@ #include <command.h> #include <asm/mipsregs.h> #include <asm/io.h> +#include <netdev.h> phys_size_t initdram(int board_type) { @@ -87,3 +88,8 @@ int misc_init_r(void) set_io_port_base(0); return 0; } + +int board_eth_init(bd_t *bis) +{ + return ne2k_register(); +} diff --git a/board/renesas/r7780mp/r7780mp.c b/board/renesas/r7780mp/r7780mp.c index 0b800990479..82cef025ade 100644 --- a/board/renesas/r7780mp/r7780mp.c +++ b/board/renesas/r7780mp/r7780mp.c @@ -81,5 +81,6 @@ void pci_init_board(void) int board_eth_init(bd_t *bis) { - return pci_eth_init(bis); + /* return >= 0 if a chip is found, the board's AX88796L is n2k-based */ + return ne2k_register() + pci_eth_init(bis); } diff --git a/board/shmin/shmin.c b/board/shmin/shmin.c index 8742f102182..7348f52aa62 100644 --- a/board/shmin/shmin.c +++ b/board/shmin/shmin.c @@ -28,6 +28,7 @@ #include <common.h> #include <asm/io.h> #include <asm/processor.h> +#include <netdev.h> int checkboard(void) { @@ -55,6 +56,11 @@ int dram_init(void) return 0; } +int board_eth_init(bd_t *bis) +{ + return ne2k_register(); +} + void led_set_state(unsigned short value) { |