
Qemu emulates a PCNET PCI card for the Malta CoreLV board. Enable the pcnet driver and add board specific ethernet initialization function to bring it up. Also enable the CONFIG_CMD_NET and CONFIG_CMD_PING options.
Signed-off-by: Gabor Juhos juhosg@openwrt.org Cc: Daniel Schwierzeck daniel.schwierzeck@googlemail.com --- Changes since v2: - rebased against the master branch of git.denx.de/u-boot.git
Changes since v1: - rebased against mips/testing
Changes since RFC: ---
Screenshot:
U-Boot 2013.04-00244-g99710fc (May 22 2013 - 13:27:18)
Board: MIPS Malta CoreLV (Qemu) DRAM: 256 MiB pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0) Flash: 4 MiB Using default environment
In: serial Out: serial Err: serial Net: pcnet#0 qemu-malta # setenv ethaddr 00:11:22:33:44:55 qemu-malta # setenv serverip 10.0.2.2 qemu-malta # setenv ipaddr 10.0.2.1 qemu-malta # ping 10.0.2.2 Using pcnet#0 device host 10.0.2.2 is alive qemu-malta # --- board/qemu-malta/qemu-malta.c | 6 ++++++ include/configs/qemu-malta.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/board/qemu-malta/qemu-malta.c b/board/qemu-malta/qemu-malta.c index e3a733f..4cbd736 100644 --- a/board/qemu-malta/qemu-malta.c +++ b/board/qemu-malta/qemu-malta.c @@ -7,6 +7,7 @@ */
#include <common.h> +#include <netdev.h>
#include <asm/addrspace.h> #include <asm/io.h> @@ -24,6 +25,11 @@ int checkboard(void) return 0; }
+int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} + void _machine_restart(void) { void __iomem *reset_base; diff --git a/include/configs/qemu-malta.h b/include/configs/qemu-malta.h index ef44d3d..c79c911 100644 --- a/include/configs/qemu-malta.h +++ b/include/configs/qemu-malta.h @@ -20,6 +20,7 @@ #define CONFIG_PCI #define CONFIG_PCI_GT64120 #define CONFIG_PCI_PNP +#define CONFIG_PCNET
/* * CPU Configuration @@ -105,10 +106,10 @@ #undef CONFIG_CMD_FPGA #undef CONFIG_CMD_LOADB #undef CONFIG_CMD_LOADS -#undef CONFIG_CMD_NET #undef CONFIG_CMD_NFS
#define CONFIG_CMD_PCI +#define CONFIG_CMD_PING
#define CONFIG_SYS_LONGHELP /* verbose help, undef to save memory */