[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] Add device tree machine
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] Add device tree machine |
Date: |
Thu, 11 Jun 2009 15:22:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 |
+++ b/hw/arm-cpu.c
+/* FIXME: Remove this and make the CPU emulation use the right names. */
+static const struct {
+ const char *devname;
+ const char *cpuname;
+} cpu_device_name_map[] = {
+ {"ARM,ARM926EJ-S", "arm926"},
+ {"ARM,Cortex-A8", "cortex-a8"}
+};
+static void arm_cpu_register_devices(void)
+{
+ int i;
+ CPUInfo *info;
+
+ for (i = 0; i< ARRAY_SIZE(cpu_device_name_map); i++) {
+ info = qemu_mallocz(sizeof(*info));
+ info->sysbus.qdev.props = cpu_qdev_props;
+ info->sysbus.init = arm_cpu_dev_init;
+ info->cpuname = cpu_device_name_map[i].cpuname;
+ sysbus_register_withprop(cpu_device_name_map[i].devname,
+ sizeof(CPUDevice),
+&info->sysbus);
+ }
I would drop cpu_device_name_map[] and have static CPUInfo structs instead.
+++ b/hw/dt-machine.c
+void dt_fixup_sysbus_device(DeviceState *dev)
+{
That doesn't belong here, it should go to sysbus.c.
With the businfo patch
(http://git.et.redhat.com/?p=qemu-kraxel.git;a=commitdiff;h=c02134e1d986892df7e8cc1cd27cf340fcafec63)
posted yesterday it is easy, just add a fixup_device() callback to the
BusInfo struct. I'd name it configure() instead of fixup() though.
+ qdev_fixup_devices();
qdev_configure_devices() ?
+DeviceState *qdev_from_phandle(uint32_t phandle)
+{
+ if (!main_system_bus) {
+ return NULL;
+ }
+ return qdev_from_phandle1(main_system_bus, phandle);
+}
What this is good for? Seems to be unused in the existing board
descriptions ...
cheers,
Gerd
[Qemu-devel] [PATCH 2/4] Add device tree machine, Paul Brook, 2009/06/10
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