From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEfXr-0003UV-VN for qemu-devel@nongnu.org; Thu, 11 Jun 2009 04:22:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEfXl-0003O5-5J for qemu-devel@nongnu.org; Thu, 11 Jun 2009 04:21:57 -0400 Received: from [199.232.76.173] (port=34908 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEfXk-0003Np-VW for qemu-devel@nongnu.org; Thu, 11 Jun 2009 04:21:53 -0400 Received: from mail-bw0-f223.google.com ([209.85.218.223]:44876) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEfXi-0003OP-Sb for qemu-devel@nongnu.org; Thu, 11 Jun 2009 04:21:52 -0400 Received: by bwz23 with SMTP id 23so1155955bwz.34 for ; Thu, 11 Jun 2009 01:21:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090610173829.4674.2315.stgit@wren.home> References: <20090610173803.4674.82538.stgit@wren.home> <20090610173829.4674.2315.stgit@wren.home> Date: Thu, 11 Jun 2009 09:21:49 +0100 Message-ID: Subject: Re: [Qemu-devel] [PATCH 3/4] Stellaris machine config From: M P Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org I've been following the tree, and the qdev bits in general since I have my own stack of patches against a few things. I'm sure it's been discussed to death already, but I just recently joined so sorry to add another layer on top. I don't understand how replacing things with a non-source code file helps anything in this case. The original stellaris code was rather bad already compared to some other CPUs/SoC: + Not a single #define constant, all encoded in good old HEX. + No constants for /anything/ in fact, down to the number of GPIO ports hard coded to 7 in many places. + No way to create a derivative board with /just/ the SoC, and add custom I= Os. So now, with qdev, it's all official, /every value, constant, and bitfield/ is hard coded, in hex, into a different non-code file, with no way of derivating or overloading from. I've seen (well I even done a few) projects that tought that using a super-duper 'meta file' (xml etc) was a fantastic idea, it turns out it's never really a fantastic idea, and you spend your time looking at code that is busy recovering properties from deep down an abstract (and unreadable) runtime tree to do /anything/. If you look at your diff here and count lines, it's exactly whats happening, You replaced about 2 page-worth of straightforward readable code with countless new pages of entirely unrelated non-code. In fact, the stellaris share /a lot/ between themselves, and there is not a single shared line between your two stellaris boards definition file. When I started hacking at qemu to add my own board supports some month ago, I tought it was the neatest, meanest, "no frill" approach that made it so cool. You could actualy /follow code thru!/ -- how refreshing! Now there are a bunch of arcane and ugly /macros/ to convert blindly struct into others, with no type checking, no overloading, no methods. It's like even-worse-c++. Sorry for the rant, I'll go back to idling. Michel On Wed, Jun 10, 2009 at 6:38 PM, Paul Brook wrote: > Replace hardcoded stellaris boards with machine configs > > Signed-off-by: Paul Brook > --- > > =A0Makefile =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 - > =A0Makefile.hw =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/arm-cpu.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A03 > =A0hw/armv7m.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 61 +++++++++ > =A0hw/gpio-buttons.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0124 ++++++++++++++++= ++ > =A0hw/pl011.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 > =A0hw/pl061.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 25 +++- > =A0hw/stellaris.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0272 +++++++++-----= -------------------------- > =A0hw/stellaris_enet.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 > =A0hw/stellaris_input.c =A0 =A0 =A0 =A0 =A0 | =A0 91 ------------- > =A0pc-bios/boards/lm3s6965evb.dts | =A0212 ++++++++++++++++++++++++++++++= + > =A0pc-bios/boards/lm3s811evb.dts =A0| =A0155 +++++++++++++++++++++++ > =A012 files changed, 645 insertions(+), 308 deletions(-) > =A0create mode 100644 hw/gpio-buttons.c > =A0delete mode 100644 hw/stellaris_input.c > =A0create mode 100644 pc-bios/boards/lm3s6965evb.dts > =A0create mode 100644 pc-bios/boards/lm3s811evb.dts > > diff --git a/Makefile b/Makefile > index 6d15c44..48a3ec3 100644 > --- a/Makefile > +++ b/Makefile > @@ -46,7 +46,7 @@ endif > =A0######################################################################= # > =A0# Board descriptions > > -BOARDS =3D syborg > +BOARDS =3D syborg lm3s811evb lm3s6965evb > > =A0ifdef DTC > =A0BOARDS_BIN =3D $(BOARDS:%=3Dpc-bios/boards/%.dtb) > @@ -115,7 +115,7 @@ OBJS+=3Dreadline.o console.o > > =A0OBJS+=3Dirq.o ptimer.o > =A0OBJS+=3Di2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o > -OBJS+=3Dssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o > +OBJS+=3Dssd0303.o ssd0323.o ads7846.o twl92230.o > =A0OBJS+=3Dtmp105.o lm832x.o eeprom93xx.o tsc2005.o > =A0OBJS+=3Dscsi-disk.o cdrom.o > =A0OBJS+=3Dscsi-generic.o > diff --git a/Makefile.hw b/Makefile.hw > index 6accb3b..1953b85 100644 > --- a/Makefile.hw > +++ b/Makefile.hw > @@ -28,6 +28,8 @@ OBJS+=3D lsi53c895a.o esp.o > > =A0OBJS+=3D dma-helpers.o sysbus.o > > +OBJS+=3D gpio-buttons.o > + > =A0all: $(HWLIB) > =A0# Dummy command so that make thinks it has done something > =A0 =A0 =A0 =A0@true > diff --git a/hw/arm-cpu.c b/hw/arm-cpu.c > index c15eb12..4c128d1 100644 > --- a/hw/arm-cpu.c > +++ b/hw/arm-cpu.c > @@ -17,7 +17,8 @@ static const struct { > =A0 =A0 const char *cpuname; > =A0} cpu_device_name_map[] =3D { > =A0 =A0 {"ARM,ARM926EJ-S", "arm926"}, > - =A0 =A0{"ARM,Cortex-A8", "cortex-a8"} > + =A0 =A0{"ARM,Cortex-A8", "cortex-a8"}, > + =A0 =A0{"ARM,Cortex-M3", "cortex-m3"} > =A0}; > > =A0typedef struct { > diff --git a/hw/armv7m.c b/hw/armv7m.c > index c3c5b9e..d74a2fb 100644 > --- a/hw/armv7m.c > +++ b/hw/armv7m.c > @@ -10,6 +10,7 @@ > =A0#include "sysbus.h" > =A0#include "arm-misc.h" > =A0#include "sysemu.h" > +#include "boards.h" > > =A0/* Bitbanded IO. =A0Each word corresponds to a single bit. =A0*/ > > @@ -149,6 +150,47 @@ static void armv7m_bitband_init(void) > =A0} > > =A0/* Board init. =A0*/ > +/* Reset initialization and iage loading for ARMv7-M cores. =A0*/ > +static void armv7m_bootstrap(ram_addr_t ram_size, const char *boot_devic= e, > + =A0 =A0const char *kernel_filename, const char *kernel_cmdline, > + =A0 =A0const char *initrd_filename) > +{ > + =A0 =A0CPUState *env =3D first_cpu; > + =A0 =A0uint32_t pc; > + =A0 =A0int image_size; > + =A0 =A0uint64_t entry; > + =A0 =A0uint64_t lowaddr; > + > + =A0 =A0image_size =3D load_elf(kernel_filename, 0, &entry, &lowaddr, NU= LL); > + =A0 =A0if (image_size < 0) { > + =A0 =A0 =A0 =A0image_size =3D load_image_targphys(kernel_filename, 0, r= am_size); > + =A0 =A0 =A0 lowaddr =3D 0; > + =A0 =A0} > + =A0 =A0if (image_size < 0) { > + =A0 =A0 =A0 =A0fprintf(stderr, "qemu: could not load kernel '%s'\n", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0kernel_filename); > + =A0 =A0 =A0 =A0exit(1); > + =A0 =A0} > + > + =A0 =A0/* If the image was loaded at address zero then assume it is a > + =A0 =A0 =A0 regular ROM image and perform the normal CPU reset sequence= . > + =A0 =A0 =A0 Otherwise jump directly to the entry point. =A0*/ > + =A0 =A0if (lowaddr =3D=3D 0) { > + =A0 =A0 =A0 env->regs[13] =3D ldl_phys(0); > + =A0 =A0 =A0 pc =3D ldl_phys(4); > + =A0 =A0} else { > + =A0 =A0 =A0 pc =3D entry; > + =A0 =A0} > + =A0 =A0env->thumb =3D pc & 1; > + =A0 =A0env->regs[15] =3D pc & ~1; > + > + =A0 =A0/* Hack to map an additional page of ram at the top of the addre= ss > + =A0 =A0 =A0 space. =A0This stops qemu complaining about executing code = outside RAM > + =A0 =A0 =A0 when returning from an exception. =A0*/ > + =A0 =A0cpu_register_physical_memory(0xfffff000, 0x1000, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 qemu_ra= m_alloc(0x1000) | IO_MEM_RAM); > +} > + > =A0/* Init CPU and memory for a v7-M based board. > =A0 =A0flash_size and sram_size are in kb. > =A0 =A0Returns the NVIC array. =A0*/ > @@ -238,10 +280,25 @@ qemu_irq *armv7m_init(int flash_size, int sram_size= , > =A0 =A0 return pic; > =A0} > > +static SysBusDeviceInfo bitband_info =3D { > + =A0 =A0.init =3D bitband_init, > + =A0 =A0.qdev.props =3D (DevicePropList[]) { > + =A0 =A0 =A0 =A0{.name =3D "base", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D NULL} > + =A0 =A0} > +}; > + > =A0static void armv7m_register_devices(void) > =A0{ > - =A0 =A0sysbus_register_dev("ARM,bitband-memory", sizeof(BitBandState), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bitband_init); > + =A0 =A0sysbus_register_withprop("ARM,bitband-memory", sizeof(BitBandSta= te), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &bitband_info); > =A0} > > =A0device_init(armv7m_register_devices) > + > +static void armv7m_boot_register(void) > +{ > + =A0 =A0register_machine_bootstrap("ARMv7-M", armv7m_bootstrap); > +} > + > +machine_init(armv7m_boot_register); > diff --git a/hw/gpio-buttons.c b/hw/gpio-buttons.c > new file mode 100644 > index 0000000..0627818 > --- /dev/null > +++ b/hw/gpio-buttons.c > @@ -0,0 +1,124 @@ > +/* > + * Buttons connected directly to GPIO pins. > + * > + * Copyright (c) 2009 CodeSourcery. > + * Written by Paul Brook > + * > + * This code is licenced under the GNU GPL v2. > + */ > +#include "sysbus.h" > +#include "console.h" > + > +#define KEY_INVERT =A0 =A0 =A00x80000000u > +#define KEY_CODE_MASK =A0 0x0000ffffu > + > +typedef struct { > + =A0 =A0SysBusDevice busdev; > + =A0 =A0qemu_irq *irq; > + =A0 =A0const uint32_t *keys; > + =A0 =A0int *pressed; > + =A0 =A0int num_buttons; > + =A0 =A0int extension; > +} GPIOButtonsState; > + > +static void gpio_buttons_put_key(void *opaque, int keycode) > +{ > + =A0 =A0GPIOButtonsState *s =3D (GPIOButtonsState *)opaque; > + =A0 =A0int i; > + =A0 =A0int down; > + > + =A0 =A0if (keycode =3D=3D 0xe0 && !s->extension) { > + =A0 =A0 =A0 =A0s->extension =3D 0x80; > + =A0 =A0 =A0 =A0return; > + =A0 =A0} > + > + =A0 =A0down =3D (keycode & 0x80) =3D=3D 0; > + =A0 =A0keycode =3D (keycode & 0x7f) | s->extension; > + > + =A0 =A0for (i =3D 0; i < s->num_buttons; i++) { > + =A0 =A0 =A0 =A0if ((s->keys[i] & KEY_CODE_MASK) =3D=3D keycode > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&& s->pressed[i] !=3D down) { > + =A0 =A0 =A0 =A0 =A0 =A0s->pressed[i] =3D down; > + =A0 =A0 =A0 =A0 =A0 =A0if (s->keys[i] & KEY_INVERT) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qemu_set_irq(s->irq[i], !down); > + =A0 =A0 =A0 =A0 =A0 =A0} else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qemu_set_irq(s->irq[i], down); > + =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0} > + =A0 =A0} > + > + =A0 =A0s->extension =3D 0; > +} > + > +static void gpio_buttons_save(QEMUFile *f, void *opaque) > +{ > + =A0 =A0GPIOButtonsState *s =3D (GPIOButtonsState *)opaque; > + =A0 =A0int i; > + > + =A0 =A0qemu_put_be32(f, s->extension); > + =A0 =A0for (i =3D 0; i < s->num_buttons; i++) > + =A0 =A0 =A0 =A0qemu_put_byte(f, s->pressed[i]); > +} > + > +static int gpio_buttons_load(QEMUFile *f, void *opaque, int version_id) > +{ > + =A0 =A0GPIOButtonsState *s =3D (GPIOButtonsState *)opaque; > + =A0 =A0int i; > + > + =A0 =A0if (version_id !=3D 1) > + =A0 =A0 =A0 =A0return -EINVAL; > + > + =A0 =A0s->extension =3D qemu_get_be32(f); > + =A0 =A0for (i =3D 0; i < s->num_buttons; i++) > + =A0 =A0 =A0 =A0s->pressed[i] =3D qemu_get_byte(f); > + > + =A0 =A0return 0; > +} > + > +static void gpio_buttons_late_init(DeviceState *dev) > +{ > + =A0 =A0GPIOButtonsState *s =3D FROM_SYSBUS(GPIOButtonsState, sysbus_fro= m_qdev(dev)); > + =A0 =A0int i; > + > + =A0 =A0for (i =3D 0; i < s->num_buttons; i++) { > + =A0 =A0 =A0 =A0if (s->keys[i] & KEY_INVERT) { > + =A0 =A0 =A0 =A0 =A0 =A0qemu_irq_raise(s->irq[i]); > + =A0 =A0 =A0 =A0} > + =A0 =A0} > +} > + > +static void gpio_buttons_init(SysBusDevice *dev) > +{ > + =A0 =A0GPIOButtonsState *s =3D FROM_SYSBUS(GPIOButtonsState, dev); > + > + =A0 =A0s->num_buttons =3D qdev_get_prop_array(&dev->qdev, "keys", &s->k= eys); > + =A0 =A0if (s->num_buttons <=3D 0) { > + =A0 =A0 =A0 =A0hw_error("gpio-buttons: Missing keys property"); > + =A0 =A0} > + > + =A0 =A0s->irq =3D qemu_mallocz(sizeof(qemu_irq) * s->num_buttons); > + =A0 =A0qdev_init_gpio_out(&dev->qdev, s->irq, s->num_buttons); > + =A0 =A0s->pressed =3D qemu_mallocz(sizeof(int) * s->num_buttons); > + =A0 =A0qemu_add_kbd_event_handler(gpio_buttons_put_key, s); > + =A0 =A0register_savevm("gpio-buttons", -1, 1, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gpio_buttons_save, gpio_buttons_= load, s); > +} > + > +static SysBusDeviceInfo gpio_buttons_info =3D { > + =A0 =A0.init =3D gpio_buttons_init, > + =A0 =A0.qdev.late_init =3D gpio_buttons_late_init, > + =A0 =A0.qdev.props =3D (DevicePropList[]) { > + =A0 =A0 =A0 =A0{.name =3D "keys", .type =3D PROP_TYPE_ARRAY}, > + =A0 =A0 =A0 =A0{.name =3D NULL} > + =A0 =A0} > +}; > + > +static void gpio_buttons_register_devices(void) > +{ > + =A0 =A0/* ??? This isn't really attached to the system bus, but it's as= good > + =A0 =A0 =A0 a place as any to put it. =A0*/ > + =A0 =A0sysbus_register_withprop("qemu,gpio-buttons", sizeof(GPIOButtons= State), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &gpio_buttons_i= nfo); > +} > + > +device_init(gpio_buttons_register_devices) > diff --git a/hw/pl011.c b/hw/pl011.c > index 3a1a4cb..f167bec 100644 > --- a/hw/pl011.c > +++ b/hw/pl011.c > @@ -323,7 +323,7 @@ static void pl011_register_devices(void) > =A0{ > =A0 =A0 sysbus_register_dev("pl011", sizeof(pl011_state), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pl011_init_arm); > - =A0 =A0sysbus_register_dev("pl011_luminary", sizeof(pl011_state), > + =A0 =A0sysbus_register_dev("luminary,pl011", sizeof(pl011_state), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pl011_init_luminary); > =A0} > > diff --git a/hw/pl061.c b/hw/pl061.c > index aa0a322..8e38bd6 100644 > --- a/hw/pl061.c > +++ b/hw/pl061.c > @@ -291,6 +291,18 @@ static int pl061_load(QEMUFile *f, void *opaque, int= version_id) > =A0 =A0 return 0; > =A0} > > +static void pl061_late_init(DeviceState *dev) > +{ > + =A0 =A0pl061_state *s =3D FROM_SYSBUS(pl061_state, sysbus_from_qdev(dev= )); > + =A0 =A0int i; > + > + =A0 =A0for (i =3D 0; i < 8; i++) { > + =A0 =A0 =A0 =A0if (s->float_high & (1 << i)) { > + =A0 =A0 =A0 =A0 =A0 =A0qemu_irq_raise(s->out[i]); > + =A0 =A0 =A0 =A0} > + =A0 =A0} > +} > + > =A0static void pl061_init(SysBusDevice *dev) > =A0{ > =A0 =A0 int iomemtype; > @@ -302,14 +314,23 @@ static void pl061_init(SysBusDevice *dev) > =A0 =A0 sysbus_init_irq(dev, &s->irq); > =A0 =A0 qdev_init_gpio_in(&dev->qdev, pl061_set_irq, 8); > =A0 =A0 qdev_init_gpio_out(&dev->qdev, s->out, 8); > + =A0 =A0s->float_high =3D qdev_get_prop_int(&dev->qdev, "float-high", 0)= ; > =A0 =A0 pl061_reset(s); > =A0 =A0 register_savevm("pl061_gpio", -1, 1, pl061_save, pl061_load, s); > =A0} > > +static SysBusDeviceInfo pl061_info =3D { > + =A0 =A0.init =3D pl061_init, > + =A0 =A0.qdev.late_init =3D pl061_late_init, > + =A0 =A0.qdev.props =3D (DevicePropList[]) { > + =A0 =A0 =A0 =A0{.name =3D "float-high", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D NULL} > + =A0 =A0} > +}; > =A0static void pl061_register_devices(void) > =A0{ > - =A0 =A0sysbus_register_dev("pl061", sizeof(pl061_state), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pl061_init); > + =A0 =A0sysbus_register_withprop("pl061", sizeof(pl061_state), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &pl061_info); > =A0} > > =A0device_init(pl061_register_devices) > diff --git a/hw/stellaris.c b/hw/stellaris.c > index 38b9830..ba5b11f 100644 > --- a/hw/stellaris.c > +++ b/hw/stellaris.c > @@ -361,6 +361,7 @@ static void stellaris_gptm_init(SysBusDevice *dev) > =A0/* System controller. =A0*/ > > =A0typedef struct { > + =A0 =A0SysBusDevice busdev; > =A0 =A0 uint32_t pborctl; > =A0 =A0 uint32_t ldopctl; > =A0 =A0 uint32_t int_status; > @@ -374,8 +375,12 @@ typedef struct { > =A0 =A0 uint32_t ldoarst; > =A0 =A0 uint32_t user0; > =A0 =A0 uint32_t user1; > + =A0 =A0uint32_t did0; > + =A0 =A0uint32_t did1; > + =A0 =A0uint32_t dc[4]; > =A0 =A0 qemu_irq irq; > - =A0 =A0stellaris_board_info *board; > + =A0 =A0int got_mac; > + =A0 =A0DeviceState *netdev; > =A0} ssys_state; > > =A0static void ssys_update(ssys_state *s) > @@ -421,25 +426,38 @@ static uint32_t pllcfg_fury[16] =3D { > =A0 =A0 0xb11c /* 8.192 Mhz */ > =A0}; > > +static void ssys_get_mac(ssys_state *s) > +{ > + =A0 =A0uint8_t macaddr[6]; > + > + =A0 =A0s->got_mac =3D 1; > + =A0 =A0if (!s->netdev) { > + =A0 =A0 =A0 =A0return; > + =A0 =A0} > + =A0 =A0qdev_get_macaddr(s->netdev, macaddr); > + =A0 =A0s->user0 =3D macaddr[0] | (macaddr[1] << 8) | (macaddr[2] << 16)= ; > + =A0 =A0s->user1 =3D macaddr[3] | (macaddr[4] << 8) | (macaddr[5] << 16)= ; > +} > + > =A0static uint32_t ssys_read(void *opaque, target_phys_addr_t offset) > =A0{ > =A0 =A0 ssys_state *s =3D (ssys_state *)opaque; > > =A0 =A0 switch (offset) { > =A0 =A0 case 0x000: /* DID0 */ > - =A0 =A0 =A0 =A0return s->board->did0; > + =A0 =A0 =A0 =A0return s->did0; > =A0 =A0 case 0x004: /* DID1 */ > - =A0 =A0 =A0 =A0return s->board->did1; > + =A0 =A0 =A0 =A0return s->did1; > =A0 =A0 case 0x008: /* DC0 */ > - =A0 =A0 =A0 =A0return s->board->dc0; > + =A0 =A0 =A0 =A0return s->dc[0]; > =A0 =A0 case 0x010: /* DC1 */ > - =A0 =A0 =A0 =A0return s->board->dc1; > + =A0 =A0 =A0 =A0return s->dc[1]; > =A0 =A0 case 0x014: /* DC2 */ > - =A0 =A0 =A0 =A0return s->board->dc2; > + =A0 =A0 =A0 =A0return s->dc[2]; > =A0 =A0 case 0x018: /* DC3 */ > - =A0 =A0 =A0 =A0return s->board->dc3; > + =A0 =A0 =A0 =A0return s->dc[3]; > =A0 =A0 case 0x01c: /* DC4 */ > - =A0 =A0 =A0 =A0return s->board->dc4; > + =A0 =A0 =A0 =A0return s->dc[4]; > =A0 =A0 case 0x030: /* PBORCTL */ > =A0 =A0 =A0 =A0 return s->pborctl; > =A0 =A0 case 0x034: /* LDOPCTL */ > @@ -464,7 +482,7 @@ static uint32_t ssys_read(void *opaque, target_phys_a= ddr_t offset) > =A0 =A0 =A0 =A0 { > =A0 =A0 =A0 =A0 =A0 =A0 int xtal; > =A0 =A0 =A0 =A0 =A0 =A0 xtal =3D (s->rcc >> 6) & 0xf; > - =A0 =A0 =A0 =A0 =A0 =A0if (s->board->did0 & (1 << 16)) { > + =A0 =A0 =A0 =A0 =A0 =A0if (s->did0 & (1 << 16)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return pllcfg_fury[xtal]; > =A0 =A0 =A0 =A0 =A0 =A0 } else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return pllcfg_sandstorm[xtal]; > @@ -493,8 +511,14 @@ static uint32_t ssys_read(void *opaque, target_phys_= addr_t offset) > =A0 =A0 case 0x160: /* LDOARST */ > =A0 =A0 =A0 =A0 return s->ldoarst; > =A0 =A0 case 0x1e0: /* USER0 */ > + =A0 =A0 =A0 =A0if (!s->got_mac) { > + =A0 =A0 =A0 =A0 =A0 =A0ssys_get_mac(s); > + =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 return s->user0; > =A0 =A0 case 0x1e4: /* USER1 */ > + =A0 =A0 =A0 =A0if (!s->got_mac) { > + =A0 =A0 =A0 =A0 =A0 =A0ssys_get_mac(s); > + =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 return s->user1; > =A0 =A0 default: > =A0 =A0 =A0 =A0 hw_error("ssys_read: Bad offset 0x%x\n", (int)offset); > @@ -654,23 +678,25 @@ static int ssys_load(QEMUFile *f, void *opaque, int= version_id) > =A0 =A0 return 0; > =A0} > > -static void stellaris_sys_init(uint32_t base, qemu_irq irq, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stellaris_b= oard_info * board, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 uint8_t *ma= caddr) > +static void stellaris_sysctl_init(SysBusDevice *dev) > =A0{ > =A0 =A0 int iomemtype; > - =A0 =A0ssys_state *s; > - > - =A0 =A0s =3D (ssys_state *)qemu_mallocz(sizeof(ssys_state)); > - =A0 =A0s->irq =3D irq; > - =A0 =A0s->board =3D board; > - =A0 =A0/* Most devices come preprogrammed with a MAC address in the use= r data. */ > - =A0 =A0s->user0 =3D macaddr[0] | (macaddr[1] << 8) | (macaddr[2] << 16)= ; > - =A0 =A0s->user1 =3D macaddr[3] | (macaddr[4] << 8) | (macaddr[5] << 16)= ; > + =A0 =A0ssys_state *s =3D FROM_SYSBUS(ssys_state, dev); > > =A0 =A0 iomemtype =3D cpu_register_io_memory(0, ssys_readfn, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0ssys_writefn, s); > - =A0 =A0cpu_register_physical_memory(base, 0x00001000, iomemtype); > + =A0 =A0sysbus_init_mmio(dev, 0x1000, iomemtype); > + =A0 =A0sysbus_init_irq(dev, &s->irq); > + =A0 =A0s->netdev =3D qdev_get_prop_dev(&dev->qdev, "enet"); > + =A0 =A0s->got_mac =3D 0; > + =A0 =A0s->did0 =3D qdev_get_prop_int(&dev->qdev, "did0", 0); > + =A0 =A0s->did1 =3D qdev_get_prop_int(&dev->qdev, "did1", 0); > + =A0 =A0s->dc[0] =3D qdev_get_prop_int(&dev->qdev, "dc0", 0); > + =A0 =A0s->dc[1] =3D qdev_get_prop_int(&dev->qdev, "dc1", 0); > + =A0 =A0s->dc[2] =3D qdev_get_prop_int(&dev->qdev, "dc2", 0); > + =A0 =A0s->dc[3] =3D qdev_get_prop_int(&dev->qdev, "dc3", 0); > + =A0 =A0s->dc[4] =3D qdev_get_prop_int(&dev->qdev, "dc4", 0); > + > =A0 =A0 ssys_reset(s); > =A0 =A0 register_savevm("stellaris_sys", -1, 1, ssys_save, ssys_load, s); > =A0} > @@ -1256,200 +1282,30 @@ static void stellaris_ssi_bus_init(SSISlave *dev= ) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stellaris_ssi_bus_save, stellaris= _ssi_bus_load, s); > =A0} > > -/* Board init. =A0*/ > -static stellaris_board_info stellaris_boards[] =3D { > - =A0{ "LM3S811EVB", > - =A0 =A00, > - =A0 =A00x0032000e, > - =A0 =A00x001f001f, /* dc0 */ > - =A0 =A00x001132bf, > - =A0 =A00x01071013, > - =A0 =A00x3f0f01ff, > - =A0 =A00x0000001f, > - =A0 =A0BP_OLED_I2C > - =A0}, > - =A0{ "LM3S6965EVB", > - =A0 =A00x10010002, > - =A0 =A00x1073402e, > - =A0 =A00x00ff007f, /* dc0 */ > - =A0 =A00x001133ff, > - =A0 =A00x030f5317, > - =A0 =A00x0f0f87ff, > - =A0 =A00x5000007f, > - =A0 =A0BP_OLED_SSI | BP_GAMEPAD > - =A0} > -}; > - > -static void stellaris_init(const char *kernel_filename, const char *cpu_= model, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stellaris_board_inf= o *board) > -{ > - =A0 =A0static const int uart_irq[] =3D {5, 6, 33, 34}; > - =A0 =A0static const int timer_irq[] =3D {19, 21, 23, 35}; > - =A0 =A0static const uint32_t gpio_addr[7] =3D > - =A0 =A0 =A0{ 0x40004000, 0x40005000, 0x40006000, 0x40007000, > - =A0 =A0 =A0 =A00x40024000, 0x40025000, 0x40026000}; > - =A0 =A0static const int gpio_irq[7] =3D {0, 1, 2, 3, 4, 30, 31}; > - > - =A0 =A0qemu_irq *pic; > - =A0 =A0DeviceState *gpio_dev[7]; > - =A0 =A0qemu_irq gpio_in[7][8]; > - =A0 =A0qemu_irq gpio_out[7][8]; > - =A0 =A0qemu_irq adc; > - =A0 =A0int sram_size; > - =A0 =A0int flash_size; > - =A0 =A0i2c_bus *i2c; > - =A0 =A0DeviceState *dev; > - =A0 =A0int i; > - =A0 =A0int j; > - > - =A0 =A0flash_size =3D ((board->dc0 & 0xffff) + 1) << 1; > - =A0 =A0sram_size =3D (board->dc0 >> 18) + 1; > - =A0 =A0pic =3D armv7m_init(flash_size, sram_size, kernel_filename, cpu_= model); > - > - =A0 =A0if (board->dc1 & (1 << 16)) { > - =A0 =A0 =A0 =A0dev =3D sysbus_create_varargs("stellaris-adc", 0x4003800= 0, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= pic[14], pic[15], pic[16], pic[17], NULL); > - =A0 =A0 =A0 =A0adc =3D qdev_get_gpio_in(dev, 0); > - =A0 =A0} else { > - =A0 =A0 =A0 =A0adc =3D NULL; > - =A0 =A0} > - =A0 =A0for (i =3D 0; i < 4; i++) { > - =A0 =A0 =A0 =A0if (board->dc2 & (0x10000 << i)) { > - =A0 =A0 =A0 =A0 =A0 =A0dev =3D sysbus_create_simple("stellaris-gptm", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 0x40030000 + i * 0x1000, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 pic[timer_irq[i]]); > - =A0 =A0 =A0 =A0 =A0 =A0/* TODO: This is incorrect, but we get away with= it because > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 the ADC output is only ever pulsed. =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0qdev_connect_gpio_out(dev, 0, adc); > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - > - =A0 =A0stellaris_sys_init(0x400fe000, pic[28], board, nd_table[0].macad= dr); > - > - =A0 =A0for (i =3D 0; i < 7; i++) { > - =A0 =A0 =A0 =A0if (board->dc4 & (1 << i)) { > - =A0 =A0 =A0 =A0 =A0 =A0gpio_dev[i] =3D sysbus_create_simple("pl061", gp= io_addr[i], > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 pic[gpio_irq[i]]); > - =A0 =A0 =A0 =A0 =A0 =A0for (j =3D 0; j < 8; j++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gpio_in[i][j] =3D qdev_get_gpio_in(gpio_= dev[i], j); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gpio_out[i][j] =3D NULL; > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - > - =A0 =A0if (board->dc2 & (1 << 12)) { > - =A0 =A0 =A0 =A0dev =3D sysbus_create_simple("stellaris-i2c", 0x40020000= , pic[8]); > - =A0 =A0 =A0 =A0i2c =3D (i2c_bus *)qdev_get_child_bus(dev, "i2c"); > - =A0 =A0 =A0 =A0if (board->peripherals & BP_OLED_I2C) { > - =A0 =A0 =A0 =A0 =A0 =A0i2c_create_slave(i2c, "ssd0303", 0x3d); > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - > - =A0 =A0for (i =3D 0; i < 4; i++) { > - =A0 =A0 =A0 =A0if (board->dc2 & (1 << i)) { > - =A0 =A0 =A0 =A0 =A0 =A0sysbus_create_simple("pl011_luminary", 0x4000c00= 0 + i * 0x1000, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pic[uar= t_irq[i]]); > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - =A0 =A0if (board->dc2 & (1 << 4)) { > - =A0 =A0 =A0 =A0dev =3D sysbus_create_simple("pl022", 0x40008000, pic[7]= ); > - =A0 =A0 =A0 =A0if (board->peripherals & BP_OLED_SSI) { > - =A0 =A0 =A0 =A0 =A0 =A0DeviceState *mux; > - =A0 =A0 =A0 =A0 =A0 =A0void *bus; > - > - =A0 =A0 =A0 =A0 =A0 =A0bus =3D qdev_get_child_bus(dev, "ssi"); > - =A0 =A0 =A0 =A0 =A0 =A0mux =3D ssi_create_slave(bus, "evb6965-ssi"); > - =A0 =A0 =A0 =A0 =A0 =A0gpio_out[GPIO_D][0] =3D qdev_get_gpio_in(mux, 0)= ; > - > - =A0 =A0 =A0 =A0 =A0 =A0bus =3D qdev_get_child_bus(mux, "ssi0"); > - =A0 =A0 =A0 =A0 =A0 =A0dev =3D ssi_create_slave(bus, "ssi-sd"); > - > - =A0 =A0 =A0 =A0 =A0 =A0bus =3D qdev_get_child_bus(mux, "ssi1"); > - =A0 =A0 =A0 =A0 =A0 =A0dev =3D ssi_create_slave(bus, "ssd0323"); > - =A0 =A0 =A0 =A0 =A0 =A0gpio_out[GPIO_C][7] =3D qdev_get_gpio_in(dev, 0)= ; > - > - =A0 =A0 =A0 =A0 =A0 =A0/* Make sure the select pin is high. =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0qemu_irq_raise(gpio_out[GPIO_D][0]); > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - =A0 =A0if (board->dc4 & (1 << 28)) { > - =A0 =A0 =A0 =A0DeviceState *enet; > - > - =A0 =A0 =A0 =A0qemu_check_nic_model(&nd_table[0], "stellaris"); > - > - =A0 =A0 =A0 =A0enet =3D qdev_create(NULL, "stellaris_enet"); > - =A0 =A0 =A0 =A0qdev_set_netdev(enet, &nd_table[0]); > - =A0 =A0 =A0 =A0qdev_init(enet); > - =A0 =A0 =A0 =A0sysbus_mmio_map(sysbus_from_qdev(enet), 0, 0x40048000); > - =A0 =A0 =A0 =A0sysbus_connect_irq(sysbus_from_qdev(enet), 0, pic[42]); > - =A0 =A0} > - =A0 =A0if (board->peripherals & BP_GAMEPAD) { > - =A0 =A0 =A0 =A0qemu_irq gpad_irq[5]; > - =A0 =A0 =A0 =A0static const int gpad_keycode[5] =3D { 0xc8, 0xd0, 0xcb,= 0xcd, 0x1d }; > - > - =A0 =A0 =A0 =A0gpad_irq[0] =3D qemu_irq_invert(gpio_in[GPIO_E][0]); /* = up */ > - =A0 =A0 =A0 =A0gpad_irq[1] =3D qemu_irq_invert(gpio_in[GPIO_E][1]); /* = down */ > - =A0 =A0 =A0 =A0gpad_irq[2] =3D qemu_irq_invert(gpio_in[GPIO_E][2]); /* = left */ > - =A0 =A0 =A0 =A0gpad_irq[3] =3D qemu_irq_invert(gpio_in[GPIO_E][3]); /* = right */ > - =A0 =A0 =A0 =A0gpad_irq[4] =3D qemu_irq_invert(gpio_in[GPIO_F][1]); /* = select */ > - > - =A0 =A0 =A0 =A0stellaris_gamepad_init(5, gpad_irq, gpad_keycode); > - =A0 =A0} > - =A0 =A0for (i =3D 0; i < 7; i++) { > - =A0 =A0 =A0 =A0if (board->dc4 & (1 << i)) { > - =A0 =A0 =A0 =A0 =A0 =A0for (j =3D 0; j < 8; j++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (gpio_out[i][j]) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qdev_connect_gpio_out(gpio_dev[i= ], j, gpio_out[i][j]); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0} > - =A0 =A0} > -} > - > -/* FIXME: Figure out how to generate these from stellaris_boards. =A0*/ > -static void lm3s811evb_init(ram_addr_t ram_size, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *boot_device, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *kernel_filename, co= nst char *kernel_cmdline, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *initrd_filename, co= nst char *cpu_model) > -{ > - =A0 =A0stellaris_init(kernel_filename, cpu_model, &stellaris_boards[0])= ; > -} > - > -static void lm3s6965evb_init(ram_addr_t ram_size, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *boot_device, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *kernel_filename, co= nst char *kernel_cmdline, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *initrd_filename, co= nst char *cpu_model) > -{ > - =A0 =A0stellaris_init(kernel_filename, cpu_model, &stellaris_boards[1])= ; > -} > - > -static QEMUMachine lm3s811evb_machine =3D { > - =A0 =A0.name =3D "lm3s811evb", > - =A0 =A0.desc =3D "Stellaris LM3S811EVB", > - =A0 =A0.init =3D lm3s811evb_init, > -}; > - > -static QEMUMachine lm3s6965evb_machine =3D { > - =A0 =A0.name =3D "lm3s6965evb", > - =A0 =A0.desc =3D "Stellaris LM3S6965EVB", > - =A0 =A0.init =3D lm3s6965evb_init, > -}; > - > -static void stellaris_machine_init(void) > -{ > - =A0 =A0qemu_register_machine(&lm3s811evb_machine); > - =A0 =A0qemu_register_machine(&lm3s6965evb_machine); > -} > - > -machine_init(stellaris_machine_init); > - > =A0static SSISlaveInfo stellaris_ssi_bus_info =3D { > =A0 =A0 .init =3D stellaris_ssi_bus_init, > =A0 =A0 .transfer =3D stellaris_ssi_bus_transfer > =A0}; > > +static SysBusDeviceInfo ssys_info =3D { > + =A0 =A0.init =3D stellaris_sysctl_init, > + =A0 =A0.qdev.props =3D (DevicePropList[]) { > + =A0 =A0 =A0 =A0{.name =3D "enet", .type =3D PROP_TYPE_DEV}, > + =A0 =A0 =A0 =A0{.name =3D "did0", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D "did1", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D "dc0", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D "dc1", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D "dc2", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D "dc3", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D "dc4", .type =3D PROP_TYPE_INT}, > + =A0 =A0 =A0 =A0{.name =3D NULL} > + =A0 =A0} > +}; > + > =A0static void stellaris_register_devices(void) > =A0{ > + =A0 =A0sysbus_register_withprop("stellaris-sysctl", sizeof(ssys_state), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &ssys_info); > =A0 =A0 sysbus_register_dev("stellaris-i2c", sizeof(stellaris_i2c_state), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stellaris_i2c_init); > =A0 =A0 sysbus_register_dev("stellaris-gptm", sizeof(gptm_state), > diff --git a/hw/stellaris_enet.c b/hw/stellaris_enet.c > index 36fabd3..86df231 100644 > --- a/hw/stellaris_enet.c > +++ b/hw/stellaris_enet.c > @@ -417,7 +417,7 @@ static void stellaris_enet_init(SysBusDevice *dev) > > =A0static void stellaris_enet_register_devices(void) > =A0{ > - =A0 =A0sysbus_register_dev("stellaris_enet", sizeof(stellaris_enet_stat= e), > + =A0 =A0sysbus_register_dev("stellaris-enet", sizeof(stellaris_enet_stat= e), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 stellaris_enet_init); > =A0} > > diff --git a/hw/stellaris_input.c b/hw/stellaris_input.c > deleted file mode 100644 > index 33395a4..0000000 > --- a/hw/stellaris_input.c > +++ /dev/null > @@ -1,91 +0,0 @@ > -/* > - * Gamepad style buttons connected to IRQ/GPIO lines > - * > - * Copyright (c) 2007 CodeSourcery. > - * Written by Paul Brook > - * > - * This code is licenced under the GPL. > - */ > -#include "hw.h" > -#include "devices.h" > -#include "console.h" > - > -typedef struct { > - =A0 =A0qemu_irq irq; > - =A0 =A0int keycode; > - =A0 =A0int pressed; > -} gamepad_button; > - > -typedef struct { > - =A0 =A0gamepad_button *buttons; > - =A0 =A0int num_buttons; > - =A0 =A0int extension; > -} gamepad_state; > - > -static void stellaris_gamepad_put_key(void * opaque, int keycode) > -{ > - =A0 =A0gamepad_state *s =3D (gamepad_state *)opaque; > - =A0 =A0int i; > - =A0 =A0int down; > - > - =A0 =A0if (keycode =3D=3D 0xe0 && !s->extension) { > - =A0 =A0 =A0 =A0s->extension =3D 0x80; > - =A0 =A0 =A0 =A0return; > - =A0 =A0} > - > - =A0 =A0down =3D (keycode & 0x80) =3D=3D 0; > - =A0 =A0keycode =3D (keycode & 0x7f) | s->extension; > - > - =A0 =A0for (i =3D 0; i < s->num_buttons; i++) { > - =A0 =A0 =A0 =A0if (s->buttons[i].keycode =3D=3D keycode > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&& s->buttons[i].pressed !=3D down) { > - =A0 =A0 =A0 =A0 =A0 =A0s->buttons[i].pressed =3D down; > - =A0 =A0 =A0 =A0 =A0 =A0qemu_set_irq(s->buttons[i].irq, down); > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - > - =A0 =A0s->extension =3D 0; > -} > - > -static void stellaris_gamepad_save(QEMUFile *f, void *opaque) > -{ > - =A0 =A0gamepad_state *s =3D (gamepad_state *)opaque; > - =A0 =A0int i; > - > - =A0 =A0qemu_put_be32(f, s->extension); > - =A0 =A0for (i =3D 0; i < s->num_buttons; i++) > - =A0 =A0 =A0 =A0qemu_put_byte(f, s->buttons[i].pressed); > -} > - > -static int stellaris_gamepad_load(QEMUFile *f, void *opaque, int version= _id) > -{ > - =A0 =A0gamepad_state *s =3D (gamepad_state *)opaque; > - =A0 =A0int i; > - > - =A0 =A0if (version_id !=3D 1) > - =A0 =A0 =A0 =A0return -EINVAL; > - > - =A0 =A0s->extension =3D qemu_get_be32(f); > - =A0 =A0for (i =3D 0; i < s->num_buttons; i++) > - =A0 =A0 =A0 =A0s->buttons[i].pressed =3D qemu_get_byte(f); > - > - =A0 =A0return 0; > -} > - > -/* Returns an array 5 ouput slots. =A0*/ > -void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode) > -{ > - =A0 =A0gamepad_state *s; > - =A0 =A0int i; > - > - =A0 =A0s =3D (gamepad_state *)qemu_mallocz(sizeof (gamepad_state)); > - =A0 =A0s->buttons =3D (gamepad_button *)qemu_mallocz(n * sizeof (gamepa= d_button)); > - =A0 =A0for (i =3D 0; i < n; i++) { > - =A0 =A0 =A0 =A0s->buttons[i].irq =3D irq[i]; > - =A0 =A0 =A0 =A0s->buttons[i].keycode =3D keycode[i]; > - =A0 =A0} > - =A0 =A0s->num_buttons =3D n; > - =A0 =A0qemu_add_kbd_event_handler(stellaris_gamepad_put_key, s); > - =A0 =A0register_savevm("stellaris_gamepad", -1, 1, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stellaris_gamepad_save, stellari= s_gamepad_load, s); > -} > diff --git a/pc-bios/boards/lm3s6965evb.dts b/pc-bios/boards/lm3s6965evb.= dts > new file mode 100644 > index 0000000..9bc0128 > --- /dev/null > +++ b/pc-bios/boards/lm3s6965evb.dts > @@ -0,0 +1,212 @@ > +/ { > + =A0 =A0#address-cells =3D <1>; > + =A0 =A0#size-cells =A0=3D <1>; > + > + =A0 =A0cpus { > + =A0 =A0 =A0 =A0#address-cells =3D <1>; > + =A0 =A0 =A0 =A0#size-cells =3D <0>; > + =A0 =A0 =A0 =A0cpu0: ARM,Cortex-M3@0 { > + =A0 =A0 =A0 =A0 =A0 =A0device_type =3D "cpu"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0>; > + =A0 =A0 =A0 =A0 =A0 =A0#interrupt-cells =3D <1>; > + =A0 =A0 =A0 =A0 =A0 =A0nvic =3D <&nvic>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0}; > + =A0 =A0flash@0 { > + =A0 =A0 =A0 =A0device_type =3D "rom"; > + =A0 =A0 =A0 =A0reg =3D <00000000 00040000>; > + =A0 =A0}; > + =A0 =A0memory@0 { > + =A0 =A0 =A0 =A0device_type =3D "memory"; > + =A0 =A0 =A0 =A0reg =3D <20000000 00010000>; > + =A0 =A0}; > + =A0 =A0bitband@0 { > + =A0 =A0 =A0 =A0model =3D "ARM,bitband-memory"; > + =A0 =A0 =A0 =A0reg =3D <22000000 02000000>; > + =A0 =A0 =A0 =A0base =3D <20000000>; > + =A0 =A0}; > + =A0 =A0bitband@1 { > + =A0 =A0 =A0 =A0model =3D "ARM,bitband-memory"; > + =A0 =A0 =A0 =A0reg =3D <42000000 02000000>; > + =A0 =A0 =A0 =A0base =3D <40000000>; > + =A0 =A0}; > + =A0 =A0nvic: nvic@0 { > + =A0 =A0 =A0 =A0model =3D "armv7m_nvic"; > + =A0 =A0 =A0 =A0interrupt-parent =3D <&cpu0>; > + =A0 =A0 =A0 =A0interrupts =3D <0>; > + =A0 =A0 =A0 =A0interrupt-controller; > + =A0 =A0 =A0 =A0#interrupt-cells =3D <1>; > + =A0 =A0}; > + =A0 =A0lm3s6965@0 { > + =A0 =A0 =A0 =A0#address-cells =3D <1>; > + =A0 =A0 =A0 =A0#size-cells =3D <0>; > + =A0 =A0 =A0 =A0qemu,fold-bus; > + =A0 =A0 =A0 =A0// TODO Watchdog at 0x40000000 > + =A0 =A0 =A0 =A0gpioA: gpio@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40004000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <0>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioB: gpio@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40005000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <1>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioC: gpio@2 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40006000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <2>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 &oled= 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioD: gpio@3 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40007000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <3>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&ssimux 0 0 0 0 0 0 0 0 0 0 0 0 0= 0 0>; > + =A0 =A0 =A0 =A0 =A0 =A0float-high =3D <01>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0ssi@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl022"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40008000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <7>; > + =A0 =A0 =A0 =A0 =A0 =A0ssimux: mux@0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0model =3D "evb6965-ssi"; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sd@0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0model =3D "ssi-sd"; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qemu,parent-bus =3D "ssi0"; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0oled: oled@1 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0model =3D "ssd0323"; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qemu,parent-bus =3D "ssi1"; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0uart@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "luminary,pl011"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <4000c000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <5>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0uart@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "luminary,pl011"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <4000d000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <6>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0uart@2 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "luminary,pl011"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <4000e000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0i2c@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-i2c"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40020000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <8>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0i2c@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-i2c"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40021000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioE: gpio@4 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40024000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <4>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioF: gpio@5 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40025000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioG: gpio@6 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40026000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0// TODO PWM at 0x40028000 > + =A0 =A0 =A0 =A0// TODO QEI0 at 0x4002c000 > + =A0 =A0 =A0 =A0// TODO QEI1 at 0x4002d000 > + =A0 =A0 =A0 =A0gptm@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40030000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gptm@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40031000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gptm@2 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40032000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gptm@3 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40033000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0adc0: adc@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-adc"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40038000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0// TODO Comparator at 0x4003c000 > + =A0 =A0 =A0 =A0enet: enet@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-enet"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40048000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0// TODO Hybernation module at 0x400fc000 > + =A0 =A0 =A0 =A0sysctl@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-sysctl"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <400fe000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0did0 =3D <10010002>; > + =A0 =A0 =A0 =A0 =A0 =A0did1 =3D <1073402e>; > + =A0 =A0 =A0 =A0 =A0 =A0dc0 =3D <00ff007f>; > + =A0 =A0 =A0 =A0 =A0 =A0dc1 =3D <001133ff>; > + =A0 =A0 =A0 =A0 =A0 =A0dc2 =3D <030f5317>; > + =A0 =A0 =A0 =A0 =A0 =A0dc3 =3D <0f0f87ff>; > + =A0 =A0 =A0 =A0 =A0 =A0dc4 =3D <5000007f>; > + =A0 =A0 =A0 =A0 =A0 =A0enet =3D <&enet>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0buttons@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "qemu,gpio-buttons"; > + =A0 =A0 =A0 =A0 =A0 =A0keys =3D <800000c8 800000d0 800000cb 800000cd 80= 00001d>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&gpioE 0 &gpioE 1 &gpioE 2 &gpioE= 3 &gpioF 1>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0}; > + =A0 =A0chosen { > + =A0 =A0 =A0 =A0qemu { > + =A0 =A0 =A0 =A0 =A0 =A0bootstrap =3D "ARMv7-M"; > + =A0 =A0 =A0 =A0}; > + =A0 =A0}; > +}; > diff --git a/pc-bios/boards/lm3s811evb.dts b/pc-bios/boards/lm3s811evb.dt= s > new file mode 100644 > index 0000000..977d080 > --- /dev/null > +++ b/pc-bios/boards/lm3s811evb.dts > @@ -0,0 +1,155 @@ > +/ { > + =A0 =A0#address-cells =3D <1>; > + =A0 =A0#size-cells =A0=3D <1>; > + > + =A0 =A0cpus { > + =A0 =A0 =A0 =A0#address-cells =3D <1>; > + =A0 =A0 =A0 =A0#size-cells =3D <0>; > + =A0 =A0 =A0 =A0cpu0: ARM,Cortex-M3@0 { > + =A0 =A0 =A0 =A0 =A0 =A0device_type =3D "cpu"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0>; > + =A0 =A0 =A0 =A0 =A0 =A0#interrupt-cells =3D <1>; > + =A0 =A0 =A0 =A0 =A0 =A0nvic =3D <&nvic>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0}; > + =A0 =A0flash@0 { > + =A0 =A0 =A0 =A0device_type =3D "rom"; > + =A0 =A0 =A0 =A0reg =3D <00000000 00010000>; > + =A0 =A0}; > + =A0 =A0memory@0 { > + =A0 =A0 =A0 =A0device_type =3D "memory"; > + =A0 =A0 =A0 =A0reg =3D <20000000 00002000>; > + =A0 =A0}; > + =A0 =A0bitband@0 { > + =A0 =A0 =A0 =A0model =3D "ARM,bitband-memory"; > + =A0 =A0 =A0 =A0reg =3D <22000000 02000000>; > + =A0 =A0 =A0 =A0base =3D <20000000>; > + =A0 =A0}; > + =A0 =A0bitband@1 { > + =A0 =A0 =A0 =A0model =3D "ARM,bitband-memory"; > + =A0 =A0 =A0 =A0reg =3D <42000000 02000000>; > + =A0 =A0 =A0 =A0base =3D <40000000>; > + =A0 =A0}; > + =A0 =A0nvic: nvic@0 { > + =A0 =A0 =A0 =A0model =3D "armv7m_nvic"; > + =A0 =A0 =A0 =A0interrupt-parent =3D <&cpu0>; > + =A0 =A0 =A0 =A0interrupts =3D <0>; > + =A0 =A0 =A0 =A0interrupt-controller; > + =A0 =A0 =A0 =A0#interrupt-cells =3D <1>; > + =A0 =A0}; > + =A0 =A0lm3s811@0 { > + =A0 =A0 =A0 =A0#address-cells =3D <1>; > + =A0 =A0 =A0 =A0#size-cells =3D <0>; > + =A0 =A0 =A0 =A0qemu,fold-bus; > + =A0 =A0 =A0 =A0// TODO Watchdog at 0x40000000 > + =A0 =A0 =A0 =A0gpioA: gpio@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40004000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <0>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioB: gpio@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40005000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <1>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioC: gpio@2 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40006000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <2>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioD: gpio@3 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40007000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <3>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0ssi@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl022"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40008000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <7>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0uart@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "luminary,pl011"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <4000c000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <5>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0uart@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "luminary,pl011"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <4000d000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <6>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0i2c@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-i2c"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40020000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <8>; > + =A0 =A0 =A0 =A0 =A0 =A0oled@0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0model =3D "ssd0303"; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0address =3D <3d>; > + =A0 =A0 =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gpioE: gpio@4 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "pl061"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40024000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <4>; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0// TODO PWM at 0x40028000 > + =A0 =A0 =A0 =A0gptm@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40030000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gptm@1 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40031000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0gptm@2 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-gptm"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40032000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0qemu,gpio =3D <&adc0 0>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0adc0: adc@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-adc"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <40038000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0}; > + =A0 =A0 =A0 =A0sysctl@0 { > + =A0 =A0 =A0 =A0 =A0 =A0model =3D "stellaris-sysctl"; > + =A0 =A0 =A0 =A0 =A0 =A0reg =3D <400fe000>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <&nvic>; > + =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D ; > + =A0 =A0 =A0 =A0 =A0 =A0did0 =3D <00000000>; > + =A0 =A0 =A0 =A0 =A0 =A0did1 =3D <0032000e>; > + =A0 =A0 =A0 =A0 =A0 =A0dc0 =3D <001f001f>; > + =A0 =A0 =A0 =A0 =A0 =A0dc1 =3D <001132bf>; > + =A0 =A0 =A0 =A0 =A0 =A0dc2 =3D <01071013>; > + =A0 =A0 =A0 =A0 =A0 =A0dc3 =3D <3f0f01ff>; > + =A0 =A0 =A0 =A0 =A0 =A0dc4 =3D <0000001f>; > + =A0 =A0 =A0 =A0}; > + =A0 =A0}; > + =A0 =A0chosen { > + =A0 =A0 =A0 =A0qemu { > + =A0 =A0 =A0 =A0 =A0 =A0bootstrap =3D "ARMv7-M"; > + =A0 =A0 =A0 =A0}; > + =A0 =A0}; > +}; > > > >