[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] Integrator machine config
From: |
Paul Brook |
Subject: |
[Qemu-devel] [PATCH 4/4] Integrator machine config |
Date: |
Wed, 10 Jun 2009 18:38:37 +0100 |
User-agent: |
StGIT/0.14.2 |
Replace integrator board with machine config
Signed-off-by: Paul Brook <address@hidden>
---
Makefile | 2 -
hw/arm_timer.c | 2 -
hw/integratorcp.c | 97 ++++------------------------------
pc-bios/boards/integrator-cp.dts | 110 ++++++++++++++++++++++++++++++++++++++
4 files changed, 124 insertions(+), 87 deletions(-)
create mode 100644 pc-bios/boards/integrator-cp.dts
diff --git a/Makefile b/Makefile
index 48a3ec3..5cc346e 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@ endif
#######################################################################
# Board descriptions
-BOARDS = syborg lm3s811evb lm3s6965evb
+BOARDS = syborg lm3s811evb lm3s6965evb integrator-cp
ifdef DTC
BOARDS_BIN = $(BOARDS:%=pc-bios/boards/%.dtb)
diff --git a/hw/arm_timer.c b/hw/arm_timer.c
index 226ecc4..6570929 100644
--- a/hw/arm_timer.c
+++ b/hw/arm_timer.c
@@ -347,7 +347,7 @@ static void icp_pit_init(SysBusDevice *dev)
static void arm_timer_register_devices(void)
{
- sysbus_register_dev("integrator_pit", sizeof(icp_pit_state), icp_pit_init);
+ sysbus_register_dev("integrator-pit", sizeof(icp_pit_state), icp_pit_init);
sysbus_register_dev("sp804", sizeof(sp804_state), sp804_init);
}
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index b6fbe15..849f0b4 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -429,104 +429,31 @@ static CPUWriteMemoryFunc *icp_control_writefn[] = {
icp_control_write
};
-static void icp_control_init(uint32_t base)
+static void icp_control_init(SysBusDevice *dev)
{
int iomemtype;
iomemtype = cpu_register_io_memory(0, icp_control_readfn,
icp_control_writefn, NULL);
- cpu_register_physical_memory(base, 0x00800000, iomemtype);
+ sysbus_init_mmio(dev, 0x00800000, iomemtype);
/* ??? Save/restore. */
}
-
-/* Board init. */
-
-static struct arm_boot_info integrator_binfo = {
- .loader_start = 0x0,
- .board_id = 0x113,
-};
-
-static void integratorcp_init(ram_addr_t ram_size,
- const char *boot_device,
- const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename, const char *cpu_model)
-{
- CPUState *env;
- ram_addr_t ram_offset;
- qemu_irq pic[32];
- qemu_irq *cpu_pic;
- DeviceState *dev;
- int i;
-
- if (!cpu_model)
- cpu_model = "arm926";
- env = cpu_init(cpu_model);
- if (!env) {
- fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
- }
- ram_offset = qemu_ram_alloc(ram_size);
- /* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash. */
- /* ??? RAM should repeat to fill physical memory space. */
- /* SDRAM at address zero*/
- cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
- /* And again at address 0x80000000 */
- cpu_register_physical_memory(0x80000000, ram_size, ram_offset |
IO_MEM_RAM);
-
- dev = qdev_create(NULL, "integrator_core");
- qdev_set_prop_int(dev, "memsz", ram_size >> 20);
- qdev_init(dev);
- sysbus_mmio_map((SysBusDevice *)dev, 0, 0x10000000);
-
- cpu_pic = arm_pic_init_cpu(env);
- dev = sysbus_create_varargs("integrator_pic", 0x14000000,
- cpu_pic[ARM_PIC_CPU_IRQ],
- cpu_pic[ARM_PIC_CPU_FIQ], NULL);
- for (i = 0; i < 32; i++) {
- pic[i] = qdev_get_gpio_in(dev, i);
+static SysBusDeviceInfo integratorcm_info = {
+ .init = integratorcm_init,
+ .qdev.props = (DevicePropList[]) {
+ {.name = "memsz", .type = PROP_TYPE_INT},
+ {.name = NULL}
}
- sysbus_create_simple("integrator_pic", 0xca000000, pic[26]);
- sysbus_create_varargs("integrator_pit", 0x13000000,
- pic[5], pic[6], pic[7], NULL);
- sysbus_create_simple("pl031", 0x15000000, pic[8]);
- sysbus_create_simple("pl011", 0x16000000, pic[1]);
- sysbus_create_simple("pl011", 0x17000000, pic[2]);
- icp_control_init(0xcb000000);
- sysbus_create_simple("pl050_keyboard", 0x18000000, pic[3]);
- sysbus_create_simple("pl050_mouse", 0x19000000, pic[4]);
- sysbus_create_varargs("pl181", 0x1c000000, pic[23], pic[24], NULL);
- if (nd_table[0].vlan)
- smc91c111_init(&nd_table[0], 0xc8000000, pic[27]);
-
- sysbus_create_simple("pl110", 0xc0000000, pic[22]);
-
- integrator_binfo.ram_size = ram_size;
- integrator_binfo.kernel_filename = kernel_filename;
- integrator_binfo.kernel_cmdline = kernel_cmdline;
- integrator_binfo.initrd_filename = initrd_filename;
- arm_load_kernel(env, &integrator_binfo);
-}
-
-static QEMUMachine integratorcp_machine = {
- .name = "integratorcp",
- .desc = "ARM Integrator/CP (ARM926EJ-S)",
- .init = integratorcp_init,
- .is_default = 1,
};
-static void integratorcp_machine_init(void)
-{
- qemu_register_machine(&integratorcp_machine);
-}
-
-machine_init(integratorcp_machine_init);
-
static void integratorcp_register_devices(void)
{
- sysbus_register_dev("integrator_pic", sizeof(icp_pic_state), icp_pic_init);
- sysbus_register_dev("integrator_core", sizeof(integratorcm_state),
- integratorcm_init);
+ sysbus_register_dev("integrator-pic", sizeof(icp_pic_state), icp_pic_init);
+ sysbus_register_dev("integrator-control", sizeof(SysBusDevice),
+ icp_control_init);
+ sysbus_register_withprop("integrator-core", sizeof(integratorcm_state),
+ &integratorcm_info);
}
device_init(integratorcp_register_devices)
diff --git a/pc-bios/boards/integrator-cp.dts b/pc-bios/boards/integrator-cp.dts
new file mode 100644
index 0000000..6ff27b4
--- /dev/null
+++ b/pc-bios/boards/integrator-cp.dts
@@ -0,0 +1,110 @@
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cpu0: ARM,address@hidden {
+ device_type = "cpu";
+ reg = <0>;
+ #interrupt-cells = <1>;
+ };
+ };
+ address@hidden {
+ device_type = "memory";
+ reg = <0 08000000>;
+ qemu,alias = <80000000>;
+ };
+ address@hidden {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ qemu,fold-bus;
+ address@hidden {
+ model = "integrator-core";
+ memsz = <d#128>;
+ reg = <10000000>;
+ };
+ pic: address@hidden {
+ model = "integrator-pic";
+ #interrupt-cells = <1>;
+ reg = <14000000>;
+ interrupt-controller;
+ interrupt-parent = <&cpu0>;
+ interrupts = <0 1>;
+ };
+ address@hidden {
+ model = "integrator-pic";
+ #interrupt-cells = <1>;
+ reg = <ca000000>;
+ interrupt-controller;
+ interrupt-parent = <&pic>;
+ interrupts = <d#26 ffffffff>;
+ };
+ address@hidden {
+ model = "integrator-pit";
+ reg = <13000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#5 d#6 d#7>;
+ };
+ address@hidden {
+ model = "pl031";
+ reg = <15000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#8>;
+ };
+ address@hidden {
+ model = "pl011";
+ reg = <16000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#1>;
+ };
+ address@hidden {
+ model = "pl011";
+ reg = <17000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#2>;
+ };
+ address@hidden {
+ model = "pl050_keyboard";
+ reg = <18000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#3>;
+ };
+ address@hidden {
+ model = "pl050_mouse";
+ reg = <19000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#4>;
+ };
+ address@hidden {
+ model = "pl181";
+ reg = <1c000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#23 d#24>;
+ };
+ address@hidden {
+ model = "pl110";
+ reg = <c0000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#22>;
+ };
+ address@hidden {
+ model = "smc91c111";
+ reg = <c8000000>;
+ interrupt-parent = <&pic>;
+ interrupts = <d#27>;
+ };
+ address@hidden {
+ model = "integrator-control";
+ reg = <cb000000>;
+ };
+ };
+ chosen {
+ qemu {
+ bootstrap = "arm-linux";
+ board-id = <113>;
+ };
+ };
+};
+
- Re: [Qemu-devel] [PATCH 2/4] Add device tree machine, (continued)
Re: [Qemu-devel] [PATCH 2/4] Add device tree machine, Markus Armbruster, 2009/06/12
[Qemu-devel] [PATCH 3/4] Stellaris machine config, Paul Brook, 2009/06/10
[Qemu-devel] [PATCH 4/4] Integrator machine config,
Paul Brook <=
Re: [Qemu-devel] [PATCH 0/4] Machine config files, Gerd Hoffmann, 2009/06/11
Re: [Qemu-devel] [PATCH 0/4] Machine config files, Gerd Hoffmann, 2009/06/11
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Paul Brook, 2009/06/11
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Gerd Hoffmann, 2009/06/11
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Kevin Wolf, 2009/06/12
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Markus Armbruster, 2009/06/12
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Kevin Wolf, 2009/06/12
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Markus Armbruster, 2009/06/12
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Anthony Liguori, 2009/06/12
- Re: [Qemu-devel] [PATCH 0/4] Machine config files, Kevin Wolf, 2009/06/12