2 * Luminary Micro Stellaris preipherals
4 * Copyright (c) 2006 CodeSourcery.
5 * Written by Paul Brook
7 * This code is licenced under the GPL.
12 #include "primecell.h"
14 #include "qemu-timer.h"
28 #define BP_OLED_I2C 0x01
29 #define BP_OLED_SSI 0x02
30 #define BP_GAMEPAD 0x04
32 typedef const struct {
42 } stellaris_board_info;
44 /* General purpose timer module. */
46 typedef struct gptm_state {
55 uint32_t match_prescale[2];
58 struct gptm_state *opaque[2];
61 /* The timers have an alternate output used to trigger the ADC. */
66 static void gptm_update_irq(gptm_state *s)
69 level = (s->state & s->mask) != 0;
70 qemu_set_irq(s->irq, level);
73 static void gptm_stop(gptm_state *s, int n)
75 qemu_del_timer(s->timer[n]);
78 static void gptm_reload(gptm_state *s, int n, int reset)
82 tick = qemu_get_clock(vm_clock);
87 /* 32-bit CountDown. */
89 count = s->load[0] | (s->load[1] << 16);
90 tick += (int64_t)count * system_clock_scale;
91 } else if (s->config == 1) {
92 /* 32-bit RTC. 1Hz tick. */
93 tick += ticks_per_sec;
94 } else if (s->mode[n] == 0xa) {
95 /* PWM mode. Not implemented. */
97 cpu_abort(cpu_single_env, "TODO: 16-bit timer mode 0x%x\n",
101 qemu_mod_timer(s->timer[n], tick);
104 static void gptm_tick(void *opaque)
106 gptm_state **p = (gptm_state **)opaque;
112 if (s->config == 0) {
114 if ((s->control & 0x20)) {
115 /* Output trigger. */
116 qemu_irq_raise(s->trigger);
117 qemu_irq_lower(s->trigger);
119 if (s->mode[0] & 1) {
124 gptm_reload(s, 0, 0);
126 } else if (s->config == 1) {
130 match = s->match[0] | (s->match[1] << 16);
136 gptm_reload(s, 0, 0);
137 } else if (s->mode[n] == 0xa) {
138 /* PWM mode. Not implemented. */
140 cpu_abort(cpu_single_env, "TODO: 16-bit timer mode 0x%x\n",
146 static uint32_t gptm_read(void *opaque, target_phys_addr_t offset)
148 gptm_state *s = (gptm_state *)opaque;
154 case 0x04: /* TAMR */
156 case 0x08: /* TBMR */
165 return s->state & s->mask;
168 case 0x28: /* TAILR */
169 return s->load[0] | ((s->config < 4) ? (s->load[1] << 16) : 0);
170 case 0x2c: /* TBILR */
172 case 0x30: /* TAMARCHR */
173 return s->match[0] | ((s->config < 4) ? (s->match[1] << 16) : 0);
174 case 0x34: /* TBMATCHR */
176 case 0x38: /* TAPR */
177 return s->prescale[0];
178 case 0x3c: /* TBPR */
179 return s->prescale[1];
180 case 0x40: /* TAPMR */
181 return s->match_prescale[0];
182 case 0x44: /* TBPMR */
183 return s->match_prescale[1];
188 cpu_abort(cpu_single_env, "TODO: Timer value read\n");
190 cpu_abort(cpu_single_env, "gptm_read: Bad offset 0x%x\n", (int)offset);
195 static void gptm_write(void *opaque, target_phys_addr_t offset, uint32_t value)
197 gptm_state *s = (gptm_state *)opaque;
201 /* The timers should be disabled before changing the configuration.
202 We take advantage of this and defer everything until the timer
208 case 0x04: /* TAMR */
211 case 0x08: /* TBMR */
217 /* TODO: Implement pause. */
218 if ((oldval ^ value) & 1) {
220 gptm_reload(s, 0, 1);
225 if (((oldval ^ value) & 0x100) && s->config >= 4) {
227 gptm_reload(s, 1, 1);
234 s->mask = value & 0x77;
240 case 0x28: /* TAILR */
241 s->load[0] = value & 0xffff;
243 s->load[1] = value >> 16;
246 case 0x2c: /* TBILR */
247 s->load[1] = value & 0xffff;
249 case 0x30: /* TAMARCHR */
250 s->match[0] = value & 0xffff;
252 s->match[1] = value >> 16;
255 case 0x34: /* TBMATCHR */
256 s->match[1] = value >> 16;
258 case 0x38: /* TAPR */
259 s->prescale[0] = value;
261 case 0x3c: /* TBPR */
262 s->prescale[1] = value;
264 case 0x40: /* TAPMR */
265 s->match_prescale[0] = value;
267 case 0x44: /* TBPMR */
268 s->match_prescale[0] = value;
271 cpu_abort(cpu_single_env, "gptm_write: Bad offset 0x%x\n", (int)offset);
276 static CPUReadMemoryFunc *gptm_readfn[] = {
282 static CPUWriteMemoryFunc *gptm_writefn[] = {
288 static void stellaris_gptm_init(uint32_t base, qemu_irq irq, qemu_irq trigger)
293 s = (gptm_state *)qemu_mallocz(sizeof(gptm_state));
296 s->trigger = trigger;
297 s->opaque[0] = s->opaque[1] = s;
299 iomemtype = cpu_register_io_memory(0, gptm_readfn,
301 cpu_register_physical_memory(base, 0x00001000, iomemtype);
302 s->timer[0] = qemu_new_timer(vm_clock, gptm_tick, &s->opaque[0]);
303 s->timer[1] = qemu_new_timer(vm_clock, gptm_tick, &s->opaque[1]);
304 /* ??? Save/restore. */
308 /* System controller. */
326 stellaris_board_info *board;
329 static void ssys_update(ssys_state *s)
331 qemu_set_irq(s->irq, (s->int_status & s->int_mask) != 0);
334 static uint32_t pllcfg_sandstorm[16] = {
336 0x1ae0, /* 1.8432 Mhz */
338 0xd573, /* 2.4576 Mhz */
339 0x37a6, /* 3.57954 Mhz */
340 0x1ae2, /* 3.6864 Mhz */
342 0x98bc, /* 4.906 Mhz */
343 0x935b, /* 4.9152 Mhz */
345 0x4dee, /* 5.12 Mhz */
347 0x75db, /* 6.144 Mhz */
348 0x1ae6, /* 7.3728 Mhz */
350 0x585b /* 8.192 Mhz */
353 static uint32_t pllcfg_fury[16] = {
355 0x1b20, /* 1.8432 Mhz */
357 0xf42b, /* 2.4576 Mhz */
358 0x37e3, /* 3.57954 Mhz */
359 0x1b21, /* 3.6864 Mhz */
361 0x98ee, /* 4.906 Mhz */
362 0xd5b4, /* 4.9152 Mhz */
364 0x4e27, /* 5.12 Mhz */
366 0xec1c, /* 6.144 Mhz */
367 0x1b23, /* 7.3728 Mhz */
369 0xb11c /* 8.192 Mhz */
372 static uint32_t ssys_read(void *opaque, target_phys_addr_t offset)
374 ssys_state *s = (ssys_state *)opaque;
378 case 0x000: /* DID0 */
379 return s->board->did0;
380 case 0x004: /* DID1 */
381 return s->board->did1;
382 case 0x008: /* DC0 */
383 return s->board->dc0;
384 case 0x010: /* DC1 */
385 return s->board->dc1;
386 case 0x014: /* DC2 */
387 return s->board->dc2;
388 case 0x018: /* DC3 */
389 return s->board->dc3;
390 case 0x01c: /* DC4 */
391 return s->board->dc4;
392 case 0x030: /* PBORCTL */
394 case 0x034: /* LDOPCTL */
396 case 0x040: /* SRCR0 */
398 case 0x044: /* SRCR1 */
400 case 0x048: /* SRCR2 */
402 case 0x050: /* RIS */
403 return s->int_status;
404 case 0x054: /* IMC */
406 case 0x058: /* MISC */
407 return s->int_status & s->int_mask;
408 case 0x05c: /* RESC */
410 case 0x060: /* RCC */
412 case 0x064: /* PLLCFG */
415 xtal = (s->rcc >> 6) & 0xf;
416 if (s->board->did0 & (1 << 16)) {
417 return pllcfg_fury[xtal];
419 return pllcfg_sandstorm[xtal];
422 case 0x100: /* RCGC0 */
424 case 0x104: /* RCGC1 */
426 case 0x108: /* RCGC2 */
428 case 0x110: /* SCGC0 */
430 case 0x114: /* SCGC1 */
432 case 0x118: /* SCGC2 */
434 case 0x120: /* DCGC0 */
436 case 0x124: /* DCGC1 */
438 case 0x128: /* DCGC2 */
440 case 0x150: /* CLKVCLR */
442 case 0x160: /* LDOARST */
444 case 0x1e0: /* USER0 */
446 case 0x1e4: /* USER1 */
449 cpu_abort(cpu_single_env, "ssys_read: Bad offset 0x%x\n", (int)offset);
454 static void ssys_write(void *opaque, target_phys_addr_t offset, uint32_t value)
456 ssys_state *s = (ssys_state *)opaque;
460 case 0x030: /* PBORCTL */
461 s->pborctl = value & 0xffff;
463 case 0x034: /* LDOPCTL */
464 s->ldopctl = value & 0x1f;
466 case 0x040: /* SRCR0 */
467 case 0x044: /* SRCR1 */
468 case 0x048: /* SRCR2 */
469 fprintf(stderr, "Peripheral reset not implemented\n");
471 case 0x054: /* IMC */
472 s->int_mask = value & 0x7f;
474 case 0x058: /* MISC */
475 s->int_status &= ~value;
477 case 0x05c: /* RESC */
478 s->resc = value & 0x3f;
480 case 0x060: /* RCC */
481 if ((s->rcc & (1 << 13)) != 0 && (value & (1 << 13)) == 0) {
483 s->int_status |= (1 << 6);
486 system_clock_scale = 5 * (((s->rcc >> 23) & 0xf) + 1);
488 case 0x100: /* RCGC0 */
491 case 0x104: /* RCGC1 */
494 case 0x108: /* RCGC2 */
497 case 0x110: /* SCGC0 */
500 case 0x114: /* SCGC1 */
503 case 0x118: /* SCGC2 */
506 case 0x120: /* DCGC0 */
509 case 0x124: /* DCGC1 */
512 case 0x128: /* DCGC2 */
515 case 0x150: /* CLKVCLR */
518 case 0x160: /* LDOARST */
522 cpu_abort(cpu_single_env, "ssys_write: Bad offset 0x%x\n", (int)offset);
527 static CPUReadMemoryFunc *ssys_readfn[] = {
533 static CPUWriteMemoryFunc *ssys_writefn[] = {
539 static void ssys_reset(void *opaque)
541 ssys_state *s = (ssys_state *)opaque;
550 static void stellaris_sys_init(uint32_t base, qemu_irq irq,
551 stellaris_board_info * board,
557 s = (ssys_state *)qemu_mallocz(sizeof(ssys_state));
561 /* Most devices come preprogrammed with a MAC address in the user data. */
562 s->user0 = macaddr[0] | (macaddr[1] << 8) | (macaddr[2] << 16);
563 s->user1 = macaddr[3] | (macaddr[4] << 8) | (macaddr[5] << 16);
565 iomemtype = cpu_register_io_memory(0, ssys_readfn,
567 cpu_register_physical_memory(base, 0x00001000, iomemtype);
569 /* ??? Save/restore. */
573 /* I2C controller. */
586 } stellaris_i2c_state;
588 #define STELLARIS_I2C_MCS_BUSY 0x01
589 #define STELLARIS_I2C_MCS_ERROR 0x02
590 #define STELLARIS_I2C_MCS_ADRACK 0x04
591 #define STELLARIS_I2C_MCS_DATACK 0x08
592 #define STELLARIS_I2C_MCS_ARBLST 0x10
593 #define STELLARIS_I2C_MCS_IDLE 0x20
594 #define STELLARIS_I2C_MCS_BUSBSY 0x40
596 static uint32_t stellaris_i2c_read(void *opaque, target_phys_addr_t offset)
598 stellaris_i2c_state *s = (stellaris_i2c_state *)opaque;
605 /* We don't emulate timing, so the controller is never busy. */
606 return s->mcs | STELLARIS_I2C_MCS_IDLE;
609 case 0x0c: /* MTPR */
611 case 0x10: /* MIMR */
613 case 0x14: /* MRIS */
615 case 0x18: /* MMIS */
616 return s->mris & s->mimr;
620 cpu_abort(cpu_single_env, "strllaris_i2c_read: Bad offset 0x%x\n",
626 static void stellaris_i2c_update(stellaris_i2c_state *s)
630 level = (s->mris & s->mimr) != 0;
631 qemu_set_irq(s->irq, level);
634 static void stellaris_i2c_write(void *opaque, target_phys_addr_t offset,
637 stellaris_i2c_state *s = (stellaris_i2c_state *)opaque;
642 s->msa = value & 0xff;
645 if ((s->mcr & 0x10) == 0) {
646 /* Disabled. Do nothing. */
649 /* Grab the bus if this is starting a transfer. */
650 if ((value & 2) && (s->mcs & STELLARIS_I2C_MCS_BUSBSY) == 0) {
651 if (i2c_start_transfer(s->bus, s->msa >> 1, s->msa & 1)) {
652 s->mcs |= STELLARIS_I2C_MCS_ARBLST;
654 s->mcs &= ~STELLARIS_I2C_MCS_ARBLST;
655 s->mcs |= STELLARIS_I2C_MCS_BUSBSY;
658 /* If we don't have the bus then indicate an error. */
659 if (!i2c_bus_busy(s->bus)
660 || (s->mcs & STELLARIS_I2C_MCS_BUSBSY) == 0) {
661 s->mcs |= STELLARIS_I2C_MCS_ERROR;
664 s->mcs &= ~STELLARIS_I2C_MCS_ERROR;
666 /* Transfer a byte. */
667 /* TODO: Handle errors. */
670 s->mdr = i2c_recv(s->bus) & 0xff;
673 i2c_send(s->bus, s->mdr);
675 /* Raise an interrupt. */
679 /* Finish transfer. */
680 i2c_end_transfer(s->bus);
681 s->mcs &= ~STELLARIS_I2C_MCS_BUSBSY;
685 s->mdr = value & 0xff;
687 case 0x0c: /* MTPR */
688 s->mtpr = value & 0xff;
690 case 0x10: /* MIMR */
693 case 0x1c: /* MICR */
698 cpu_abort(cpu_single_env,
699 "stellaris_i2c_write: Loopback not implemented\n");
701 cpu_abort(cpu_single_env,
702 "stellaris_i2c_write: Slave mode not implemented\n");
703 s->mcr = value & 0x31;
706 cpu_abort(cpu_single_env, "stellaris_i2c_write: Bad offset 0x%x\n",
709 stellaris_i2c_update(s);
712 static void stellaris_i2c_reset(stellaris_i2c_state *s)
714 if (s->mcs & STELLARIS_I2C_MCS_BUSBSY)
715 i2c_end_transfer(s->bus);
724 stellaris_i2c_update(s);
727 static CPUReadMemoryFunc *stellaris_i2c_readfn[] = {
733 static CPUWriteMemoryFunc *stellaris_i2c_writefn[] = {
739 static void stellaris_i2c_init(uint32_t base, qemu_irq irq, i2c_bus *bus)
741 stellaris_i2c_state *s;
744 s = (stellaris_i2c_state *)qemu_mallocz(sizeof(stellaris_i2c_state));
749 iomemtype = cpu_register_io_memory(0, stellaris_i2c_readfn,
750 stellaris_i2c_writefn, s);
751 cpu_register_physical_memory(base, 0x00001000, iomemtype);
752 /* ??? For now we only implement the master interface. */
753 stellaris_i2c_reset(s);
756 /* Analogue to Digital Converter. This is only partially implemented,
757 enough for applications that use a combined ADC and timer tick. */
759 #define STELLARIS_ADC_EM_CONTROLLER 0
760 #define STELLARIS_ADC_EM_COMP 1
761 #define STELLARIS_ADC_EM_EXTERNAL 4
762 #define STELLARIS_ADC_EM_TIMER 5
763 #define STELLARIS_ADC_EM_PWM0 6
764 #define STELLARIS_ADC_EM_PWM1 7
765 #define STELLARIS_ADC_EM_PWM2 8
767 #define STELLARIS_ADC_FIFO_EMPTY 0x0100
768 #define STELLARIS_ADC_FIFO_FULL 0x1000
788 } stellaris_adc_state;
790 static uint32_t stellaris_adc_fifo_read(stellaris_adc_state *s, int n)
794 tail = s->fifo[n].state & 0xf;
795 if (s->fifo[n].state & STELLARIS_ADC_FIFO_EMPTY) {
798 s->fifo[n].state = (s->fifo[n].state & ~0xf) | ((tail + 1) & 0xf);
799 s->fifo[n].state &= ~STELLARIS_ADC_FIFO_FULL;
800 if (tail + 1 == ((s->fifo[n].state >> 4) & 0xf))
801 s->fifo[n].state |= STELLARIS_ADC_FIFO_EMPTY;
803 return s->fifo[n].data[tail];
806 static void stellaris_adc_fifo_write(stellaris_adc_state *s, int n,
811 head = (s->fifo[n].state >> 4) & 0xf;
812 if (s->fifo[n].state & STELLARIS_ADC_FIFO_FULL) {
816 s->fifo[n].data[head] = value;
817 head = (head + 1) & 0xf;
818 s->fifo[n].state &= ~STELLARIS_ADC_FIFO_EMPTY;
819 s->fifo[n].state = (s->fifo[n].state & ~0xf0) | (head << 4);
820 if ((s->fifo[n].state & 0xf) == head)
821 s->fifo[n].state |= STELLARIS_ADC_FIFO_FULL;
824 static void stellaris_adc_update(stellaris_adc_state *s)
828 level = (s->ris & s->im) != 0;
829 qemu_set_irq(s->irq, level);
832 static void stellaris_adc_trigger(void *opaque, int irq, int level)
834 stellaris_adc_state *s = (stellaris_adc_state *)opaque;
835 /* Some applications use the ADC as a random number source, so introduce
836 some variation into the signal. */
837 static uint32_t noise = 0;
839 if ((s->actss & 1) == 0) {
843 noise = noise * 314159 + 1;
844 /* ??? actual inputs not implemented. Return an arbitrary value. */
845 stellaris_adc_fifo_write(s, 0, 0x200 + ((noise >> 16) & 7));
847 stellaris_adc_update(s);
850 static void stellaris_adc_reset(stellaris_adc_state *s)
854 for (n = 0; n < 4; n++) {
857 s->fifo[n].state = STELLARIS_ADC_FIFO_EMPTY;
861 static uint32_t stellaris_adc_read(void *opaque, target_phys_addr_t offset)
863 stellaris_adc_state *s = (stellaris_adc_state *)opaque;
865 /* TODO: Implement this. */
867 if (offset >= 0x40 && offset < 0xc0) {
869 n = (offset - 0x40) >> 5;
870 switch (offset & 0x1f) {
871 case 0x00: /* SSMUX */
873 case 0x04: /* SSCTL */
875 case 0x08: /* SSFIFO */
876 return stellaris_adc_fifo_read(s, n);
877 case 0x0c: /* SSFSTAT */
878 return s->fifo[n].state;
884 case 0x00: /* ACTSS */
891 return s->ris & s->im;
892 case 0x10: /* OSTAT */
894 case 0x14: /* EMUX */
896 case 0x18: /* USTAT */
898 case 0x20: /* SSPRI */
903 cpu_abort(cpu_single_env, "strllaris_adc_read: Bad offset 0x%x\n",
909 static void stellaris_adc_write(void *opaque, target_phys_addr_t offset,
912 stellaris_adc_state *s = (stellaris_adc_state *)opaque;
914 /* TODO: Implement this. */
916 if (offset >= 0x40 && offset < 0xc0) {
918 n = (offset - 0x40) >> 5;
919 switch (offset & 0x1f) {
920 case 0x00: /* SSMUX */
921 s->ssmux[n] = value & 0x33333333;
923 case 0x04: /* SSCTL */
925 cpu_abort(cpu_single_env, "ADC: Unimplemented sequence %x\n",
935 case 0x00: /* ACTSS */
936 s->actss = value & 0xf;
938 cpu_abort(cpu_single_env,
939 "Not implemented: ADC sequencers 1-3\n");
948 case 0x10: /* OSTAT */
951 case 0x14: /* EMUX */
954 case 0x18: /* USTAT */
957 case 0x20: /* SSPRI */
960 case 0x28: /* PSSI */
961 cpu_abort(cpu_single_env, "Not implemented: ADC sample initiate\n");
967 cpu_abort(cpu_single_env, "stellaris_adc_write: Bad offset 0x%x\n",
970 stellaris_adc_update(s);
973 static CPUReadMemoryFunc *stellaris_adc_readfn[] = {
979 static CPUWriteMemoryFunc *stellaris_adc_writefn[] = {
985 static qemu_irq stellaris_adc_init(uint32_t base, qemu_irq irq)
987 stellaris_adc_state *s;
991 s = (stellaris_adc_state *)qemu_mallocz(sizeof(stellaris_adc_state));
995 iomemtype = cpu_register_io_memory(0, stellaris_adc_readfn,
996 stellaris_adc_writefn, s);
997 cpu_register_physical_memory(base, 0x00001000, iomemtype);
998 stellaris_adc_reset(s);
999 qi = qemu_allocate_irqs(stellaris_adc_trigger, s, 1);
1004 static stellaris_board_info stellaris_boards[] = {
1008 0x001f001f, /* dc0 */
1018 0x00ff007f, /* dc0 */
1023 BP_OLED_SSI | BP_GAMEPAD
1027 static void stellaris_init(const char *kernel_filename, const char *cpu_model,
1028 DisplayState *ds, stellaris_board_info *board)
1030 static const int uart_irq[] = {5, 6, 33, 34};
1031 static const int timer_irq[] = {19, 21, 23, 35};
1032 static const uint32_t gpio_addr[7] =
1033 { 0x40004000, 0x40005000, 0x40006000, 0x40007000,
1034 0x40024000, 0x40025000, 0x40026000};
1035 static const int gpio_irq[7] = {0, 1, 2, 3, 4, 30, 31};
1038 qemu_irq *gpio_in[5];
1039 qemu_irq *gpio_out[5];
1046 flash_size = ((board->dc0 & 0xffff) + 1) << 1;
1047 sram_size = (board->dc0 >> 18) + 1;
1048 pic = armv7m_init(flash_size, sram_size, kernel_filename, cpu_model);
1050 if (board->dc1 & (1 << 16)) {
1051 adc = stellaris_adc_init(0x40038000, pic[14]);
1055 for (i = 0; i < 4; i++) {
1056 if (board->dc2 & (0x10000 << i)) {
1057 stellaris_gptm_init(0x40030000 + i * 0x1000,
1058 pic[timer_irq[i]], adc);
1062 stellaris_sys_init(0x400fe000, pic[28], board, nd_table[0].macaddr);
1064 for (i = 0; i < 7; i++) {
1065 if (board->dc4 & (1 << i)) {
1066 gpio_in[i] = pl061_init(gpio_addr[i], pic[gpio_irq[i]],
1071 if (board->dc2 & (1 << 12)) {
1072 i2c = i2c_init_bus();
1073 stellaris_i2c_init(0x40020000, pic[8], i2c);
1074 if (board->peripherals & BP_OLED_I2C) {
1075 ssd0303_init(ds, i2c, 0x3d);
1079 for (i = 0; i < 4; i++) {
1080 if (board->dc2 & (1 << i)) {
1081 pl011_init(0x4000c000 + i * 0x1000, pic[uart_irq[i]],
1082 serial_hds[i], PL011_LUMINARY);
1085 if (board->dc2 & (1 << 4)) {
1086 if (board->peripherals & BP_OLED_SSI) {
1088 /* FIXME: Implement chip select for OLED/MMC. */
1089 oled = ssd0323_init(ds, &gpio_out[GPIO_C][7]);
1090 pl022_init(0x40008000, pic[7], ssd0323_xfer_ssi, oled);
1092 pl022_init(0x40008000, pic[7], NULL, NULL);
1095 if (board->dc4 & (1 << 28)) {
1096 /* FIXME: Obey network model. */
1097 stellaris_enet_init(&nd_table[0], 0x40048000, pic[42]);
1099 if (board->peripherals & BP_GAMEPAD) {
1100 qemu_irq gpad_irq[5];
1101 static const int gpad_keycode[5] = { 0xc8, 0xd0, 0xcb, 0xcd, 0x1d };
1103 gpad_irq[0] = qemu_irq_invert(gpio_in[GPIO_E][0]); /* up */
1104 gpad_irq[1] = qemu_irq_invert(gpio_in[GPIO_E][1]); /* down */
1105 gpad_irq[2] = qemu_irq_invert(gpio_in[GPIO_E][2]); /* left */
1106 gpad_irq[3] = qemu_irq_invert(gpio_in[GPIO_E][3]); /* right */
1107 gpad_irq[4] = qemu_irq_invert(gpio_in[GPIO_F][1]); /* select */
1109 stellaris_gamepad_init(5, gpad_irq, gpad_keycode);
1113 /* FIXME: Figure out how to generate these from stellaris_boards. */
1114 static void lm3s811evb_init(int ram_size, int vga_ram_size,
1115 const char *boot_device, DisplayState *ds,
1116 const char *kernel_filename, const char *kernel_cmdline,
1117 const char *initrd_filename, const char *cpu_model)
1119 stellaris_init(kernel_filename, cpu_model, ds, &stellaris_boards[0]);
1122 static void lm3s6965evb_init(int ram_size, int vga_ram_size,
1123 const char *boot_device, DisplayState *ds,
1124 const char *kernel_filename, const char *kernel_cmdline,
1125 const char *initrd_filename, const char *cpu_model)
1127 stellaris_init(kernel_filename, cpu_model, ds, &stellaris_boards[1]);
1130 QEMUMachine lm3s811evb_machine = {
1132 "Stellaris LM3S811EVB",
1136 QEMUMachine lm3s6965evb_machine = {
1138 "Stellaris LM3S6965EVB",