diff options
author | Corey Tabaka <corey.tabaka@gmail.com> | 2013-07-15 23:07:54 -0700 |
---|---|---|
committer | Corey Tabaka <corey.tabaka@gmail.com> | 2013-07-18 02:30:42 -0700 |
commit | b02705bfa3944046a2125fc288ba30c8852410d9 (patch) | |
tree | 7c9af89d0dbc45521fd755b53000dddfdcb64c6b | |
parent | 565dacabc6fc9da8b30734798139f00beb311b58 (diff) | |
download | lk-b02705bfa3944046a2125fc288ba30c8852410d9.tar.gz |
[target][pc-x86] Configure and init PCNET device.
-rw-r--r-- | target/pc-x86/config.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/target/pc-x86/config.c b/target/pc-x86/config.c index 2bd6ecd9..7c5d57f9 100644 --- a/target/pc-x86/config.c +++ b/target/pc-x86/config.c @@ -23,14 +23,18 @@ #include <dev/driver.h> #include <dev/class/block.h> +#include <dev/class/netif.h> #include <platform/uart.h> #include <platform/ide.h> +#include <platform/pcnet.h> #include <platform.h> #include <malloc.h> #include <string.h> #include <debug.h> #include <ffs.h> +#include <lwip/tcpip.h> + #define LOCAL_TRACE 1 static const struct platform_uart_config uart0_config = { @@ -48,11 +52,23 @@ static const struct platform_ide_config ide0_config = { DEVICE_INSTANCE(ide, ide0, &ide0_config); +static const struct platform_pcnet_config pcnet0_config = { + .vendor_id = 0x1022, + .device_id = 0x2000, + .index = 0, +}; + +DEVICE_INSTANCE(netif, pcnet0, &pcnet0_config); + void target_init(void) { //device_init_all(); device_init(device_get_by_name(ide, ide0)); ffs_mount(0, device_get_by_name(ide, ide0)); + tcpip_init(NULL, NULL); + + device_init(device_get_by_name(netif, pcnet0)); + class_netif_add(device_get_by_name(netif, pcnet0)); } |