stellaris.c (ef475b5dd12684591e6264e517eaa5b3e90f7ffa) | stellaris.c (ba1ba5cca3962a9cc400c713c736b4fb8db1f38e) |
---|---|
1/* 2 * Luminary Micro Stellaris peripherals 3 * 4 * Copyright (c) 2006 CodeSourcery. 5 * Written by Paul Brook 6 * 7 * This code is licensed under the GPL. 8 */ --- 8 unchanged lines hidden (view full) --- 17#include "hw/i2c/i2c.h" 18#include "net/net.h" 19#include "hw/boards.h" 20#include "qemu/log.h" 21#include "exec/address-spaces.h" 22#include "sysemu/sysemu.h" 23#include "hw/char/pl011.h" 24#include "hw/misc/unimp.h" | 1/* 2 * Luminary Micro Stellaris peripherals 3 * 4 * Copyright (c) 2006 CodeSourcery. 5 * Written by Paul Brook 6 * 7 * This code is licensed under the GPL. 8 */ --- 8 unchanged lines hidden (view full) --- 17#include "hw/i2c/i2c.h" 18#include "net/net.h" 19#include "hw/boards.h" 20#include "qemu/log.h" 21#include "exec/address-spaces.h" 22#include "sysemu/sysemu.h" 23#include "hw/char/pl011.h" 24#include "hw/misc/unimp.h" |
25#include "cpu.h" |
|
25 26#define GPIO_A 0 27#define GPIO_B 1 28#define GPIO_C 2 29#define GPIO_D 3 30#define GPIO_E 4 31#define GPIO_F 5 32#define GPIO_G 6 --- 1187 unchanged lines hidden (view full) --- 1220 0x001133ff, 1221 0x030f5317, 1222 0x0f0f87ff, 1223 0x5000007f, 1224 BP_OLED_SSI | BP_GAMEPAD 1225 } 1226}; 1227 | 26 27#define GPIO_A 0 28#define GPIO_B 1 29#define GPIO_C 2 30#define GPIO_D 3 31#define GPIO_E 4 32#define GPIO_F 5 33#define GPIO_G 6 --- 1187 unchanged lines hidden (view full) --- 1221 0x001133ff, 1222 0x030f5317, 1223 0x0f0f87ff, 1224 0x5000007f, 1225 BP_OLED_SSI | BP_GAMEPAD 1226 } 1227}; 1228 |
1228static void stellaris_init(const char *kernel_filename, const char *cpu_model, 1229 stellaris_board_info *board) | 1229static void stellaris_init(MachineState *ms, stellaris_board_info *board) |
1230{ 1231 static const int uart_irq[] = {5, 6, 33, 34}; 1232 static const int timer_irq[] = {19, 21, 23, 35}; 1233 static const uint32_t gpio_addr[7] = 1234 { 0x40004000, 0x40005000, 0x40006000, 0x40007000, 1235 0x40024000, 0x40025000, 0x40026000}; 1236 static const int gpio_irq[7] = {0, 1, 2, 3, 4, 30, 31}; 1237 --- 55 unchanged lines hidden (view full) --- 1293 memory_region_set_readonly(flash, true); 1294 memory_region_add_subregion(system_memory, 0, flash); 1295 1296 memory_region_init_ram(sram, NULL, "stellaris.sram", sram_size, 1297 &error_fatal); 1298 memory_region_add_subregion(system_memory, 0x20000000, sram); 1299 1300 nvic = armv7m_init(system_memory, flash_size, NUM_IRQ_LINES, | 1230{ 1231 static const int uart_irq[] = {5, 6, 33, 34}; 1232 static const int timer_irq[] = {19, 21, 23, 35}; 1233 static const uint32_t gpio_addr[7] = 1234 { 0x40004000, 0x40005000, 0x40006000, 0x40007000, 1235 0x40024000, 0x40025000, 0x40026000}; 1236 static const int gpio_irq[7] = {0, 1, 2, 3, 4, 30, 31}; 1237 --- 55 unchanged lines hidden (view full) --- 1293 memory_region_set_readonly(flash, true); 1294 memory_region_add_subregion(system_memory, 0, flash); 1295 1296 memory_region_init_ram(sram, NULL, "stellaris.sram", sram_size, 1297 &error_fatal); 1298 memory_region_add_subregion(system_memory, 0x20000000, sram); 1299 1300 nvic = armv7m_init(system_memory, flash_size, NUM_IRQ_LINES, |
1301 kernel_filename, cpu_model); | 1301 ms->kernel_filename, ms->cpu_type); |
1302 1303 qdev_connect_gpio_out_named(nvic, "SYSRESETREQ", 0, 1304 qemu_allocate_irq(&do_sys_reset, NULL, 0)); 1305 1306 if (board->dc1 & (1 << 16)) { 1307 dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000, 1308 qdev_get_gpio_in(nvic, 14), 1309 qdev_get_gpio_in(nvic, 15), --- 120 unchanged lines hidden (view full) --- 1430 create_unimplemented_device("analogue-comparator", 0x4003c000, 0x1000); 1431 create_unimplemented_device("hibernation", 0x400fc000, 0x1000); 1432 create_unimplemented_device("flash-control", 0x400fd000, 0x1000); 1433} 1434 1435/* FIXME: Figure out how to generate these from stellaris_boards. */ 1436static void lm3s811evb_init(MachineState *machine) 1437{ | 1302 1303 qdev_connect_gpio_out_named(nvic, "SYSRESETREQ", 0, 1304 qemu_allocate_irq(&do_sys_reset, NULL, 0)); 1305 1306 if (board->dc1 & (1 << 16)) { 1307 dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000, 1308 qdev_get_gpio_in(nvic, 14), 1309 qdev_get_gpio_in(nvic, 15), --- 120 unchanged lines hidden (view full) --- 1430 create_unimplemented_device("analogue-comparator", 0x4003c000, 0x1000); 1431 create_unimplemented_device("hibernation", 0x400fc000, 0x1000); 1432 create_unimplemented_device("flash-control", 0x400fd000, 0x1000); 1433} 1434 1435/* FIXME: Figure out how to generate these from stellaris_boards. */ 1436static void lm3s811evb_init(MachineState *machine) 1437{ |
1438 const char *cpu_model = machine->cpu_model; 1439 const char *kernel_filename = machine->kernel_filename; 1440 stellaris_init(kernel_filename, cpu_model, &stellaris_boards[0]); | 1438 stellaris_init(machine, &stellaris_boards[0]); |
1441} 1442 1443static void lm3s6965evb_init(MachineState *machine) 1444{ | 1439} 1440 1441static void lm3s6965evb_init(MachineState *machine) 1442{ |
1445 const char *cpu_model = machine->cpu_model; 1446 const char *kernel_filename = machine->kernel_filename; 1447 stellaris_init(kernel_filename, cpu_model, &stellaris_boards[1]); | 1443 stellaris_init(machine, &stellaris_boards[1]); |
1448} 1449 1450static void lm3s811evb_class_init(ObjectClass *oc, void *data) 1451{ 1452 MachineClass *mc = MACHINE_CLASS(oc); 1453 1454 mc->desc = "Stellaris LM3S811EVB"; 1455 mc->init = lm3s811evb_init; 1456 mc->ignore_memory_transaction_failures = true; | 1444} 1445 1446static void lm3s811evb_class_init(ObjectClass *oc, void *data) 1447{ 1448 MachineClass *mc = MACHINE_CLASS(oc); 1449 1450 mc->desc = "Stellaris LM3S811EVB"; 1451 mc->init = lm3s811evb_init; 1452 mc->ignore_memory_transaction_failures = true; |
1453 mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m3"); |
|
1457} 1458 1459static const TypeInfo lm3s811evb_type = { 1460 .name = MACHINE_TYPE_NAME("lm3s811evb"), 1461 .parent = TYPE_MACHINE, 1462 .class_init = lm3s811evb_class_init, 1463}; 1464 1465static void lm3s6965evb_class_init(ObjectClass *oc, void *data) 1466{ 1467 MachineClass *mc = MACHINE_CLASS(oc); 1468 1469 mc->desc = "Stellaris LM3S6965EVB"; 1470 mc->init = lm3s6965evb_init; 1471 mc->ignore_memory_transaction_failures = true; | 1454} 1455 1456static const TypeInfo lm3s811evb_type = { 1457 .name = MACHINE_TYPE_NAME("lm3s811evb"), 1458 .parent = TYPE_MACHINE, 1459 .class_init = lm3s811evb_class_init, 1460}; 1461 1462static void lm3s6965evb_class_init(ObjectClass *oc, void *data) 1463{ 1464 MachineClass *mc = MACHINE_CLASS(oc); 1465 1466 mc->desc = "Stellaris LM3S6965EVB"; 1467 mc->init = lm3s6965evb_init; 1468 mc->ignore_memory_transaction_failures = true; |
1469 mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m3"); |
|
1472} 1473 1474static const TypeInfo lm3s6965evb_type = { 1475 .name = MACHINE_TYPE_NAME("lm3s6965evb"), 1476 .parent = TYPE_MACHINE, 1477 .class_init = lm3s6965evb_class_init, 1478}; 1479 --- 61 unchanged lines hidden --- | 1470} 1471 1472static const TypeInfo lm3s6965evb_type = { 1473 .name = MACHINE_TYPE_NAME("lm3s6965evb"), 1474 .parent = TYPE_MACHINE, 1475 .class_init = lm3s6965evb_class_init, 1476}; 1477 --- 61 unchanged lines hidden --- |