diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-24 03:13:04 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-24 03:13:04 +0000 |
commit | eea589cc221853688084a139c04fce50fc65745e (patch) | |
tree | a4f60f511c8b9618f192349e083e17bcd7be4dea /hw/stellaris.c | |
parent | e57ec0168ce21cdda48ddf45d77b76185667d9e6 (diff) |
Stellaris ethernet support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3728 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/stellaris.c')
-rw-r--r-- | hw/stellaris.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/hw/stellaris.c b/hw/stellaris.c index 7936e0cc2a..01ed374a8c 100644 --- a/hw/stellaris.c +++ b/hw/stellaris.c @@ -13,6 +13,7 @@ #include "devices.h" #include "qemu-timer.h" #include "i2c.h" +#include "net.h" #include "sysemu.h" #include "boards.h" @@ -319,6 +320,8 @@ typedef struct { uint32_t dcgc[3]; uint32_t clkvclr; uint32_t ldoarst; + uint32_t user0; + uint32_t user1; qemu_irq irq; stellaris_board_info *board; } ssys_state; @@ -438,6 +441,10 @@ static uint32_t ssys_read(void *opaque, target_phys_addr_t offset) return s->clkvclr; case 0x160: /* LDOARST */ return s->ldoarst; + case 0x1e0: /* USER0 */ + return s->user0; + case 0x1e4: /* USER1 */ + return s->user1; default: cpu_abort(cpu_single_env, "ssys_read: Bad offset 0x%x\n", (int)offset); return 0; @@ -541,7 +548,8 @@ static void ssys_reset(void *opaque) } static void stellaris_sys_init(uint32_t base, qemu_irq irq, - stellaris_board_info * board) + stellaris_board_info * board, + uint8_t *macaddr) { int iomemtype; ssys_state *s; @@ -550,6 +558,9 @@ static void stellaris_sys_init(uint32_t base, qemu_irq irq, s->base = base; s->irq = irq; s->board = board; + /* Most devices come preprogrammed with a MAC address in the user data. */ + s->user0 = macaddr[0] | (macaddr[1] << 8) | (macaddr[2] << 16); + s->user1 = macaddr[3] | (macaddr[4] << 8) | (macaddr[5] << 16); iomemtype = cpu_register_io_memory(0, ssys_readfn, ssys_writefn, s); @@ -1048,7 +1059,7 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model, } } - stellaris_sys_init(0x400fe000, pic[28], board); + stellaris_sys_init(0x400fe000, pic[28], board, nd_table[0].macaddr); for (i = 0; i < 7; i++) { if (board->dc4 & (1 << i)) { @@ -1081,6 +1092,10 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model, pl022_init(0x40008000, pic[7], NULL, NULL); } } + if (board->dc4 & (1 << 28)) { + /* FIXME: Obey network model. */ + stellaris_enet_init(&nd_table[0], 0x40048000, pic[42]); + } if (board->peripherals & BP_GAMEPAD) { qemu_irq gpad_irq[5]; static const int gpad_keycode[5] = { 0xc8, 0xd0, 0xcb, 0xcd, 0x1d }; |