aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEvgeny Voevodin <e.voevodin@samsung.com>2012-02-16 09:56:06 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-02-17 11:13:12 +0000
commit2c2c6496f83b1746a118dbcb2a0e4f8c0305c2a8 (patch)
tree5b6268dc1bb4a950b654b770cdf00be47e6ceea5 /hw
parent1248f8d4cbc3cd7b7956510f9d72188b5cd37287 (diff)
hw/exynos4210.c: Add LAN support for SMDKC210.
SMDKC210 uses lan9215 chip, but lan9118 in 16-bit mode seems to be enough. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/exynos4_boards.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/hw/exynos4_boards.c b/hw/exynos4_boards.c
index 767dc45a54..329efbeba4 100644
--- a/hw/exynos4_boards.c
+++ b/hw/exynos4_boards.c
@@ -23,6 +23,7 @@
#include "sysemu.h"
#include "sysbus.h"
+#include "net.h"
#include "arm-misc.h"
#include "exec-memory.h"
#include "exynos4210.h"
@@ -42,6 +43,8 @@
#define PRINT_DEBUG(fmt, args...) do {} while (0)
#endif
+#define SMDK_LAN9118_BASE_ADDR 0x05000000
+
typedef enum Exynos4BoardType {
EXYNOS4_BOARD_NURI,
EXYNOS4_BOARD_SMDKC210,
@@ -71,6 +74,24 @@ static struct arm_boot_info exynos4_board_binfo = {
static QEMUMachine exynos4_machines[EXYNOS4_NUM_OF_BOARDS];
+static void lan9215_init(uint32_t base, qemu_irq irq)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ /* This should be a 9215 but the 9118 is close enough */
+ if (nd_table[0].vlan) {
+ qemu_check_nic_model(&nd_table[0], "lan9118");
+ dev = qdev_create(NULL, "lan9118");
+ qdev_set_nic_properties(dev, &nd_table[0]);
+ qdev_prop_set_uint32(dev, "mode_16bit", 1);
+ qdev_init_nofail(dev);
+ s = sysbus_from_qdev(dev);
+ sysbus_mmio_map(s, 0, base);
+ sysbus_connect_irq(s, 0, irq);
+ }
+}
+
static Exynos4210State *exynos4_boards_init_common(
const char *kernel_filename,
const char *kernel_cmdline,
@@ -123,9 +144,11 @@ static void smdkc210_init(ram_addr_t ram_size,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
- exynos4_boards_init_common(kernel_filename, kernel_cmdline,
- initrd_filename, EXYNOS4_BOARD_SMDKC210);
+ Exynos4210State *s = exynos4_boards_init_common(kernel_filename,
+ kernel_cmdline, initrd_filename, EXYNOS4_BOARD_SMDKC210);
+ lan9215_init(SMDK_LAN9118_BASE_ADDR,
+ qemu_irq_invert(s->irq_table[exynos4210_get_irq(37, 1)]));
arm_load_kernel(first_cpu, &exynos4_board_binfo);
}