Received: from eggs.gnu.org ([2001:4830:134:3::10]:55930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsXYA-0006c5-M4 for qemu-devel@nongnu.org; Fri, 28 Jun 2013 08:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsXY6-0004hU-Nc for qemu-devel@nongnu.org; Fri, 28 Jun 2013 08:13:14 -0400 Received: from smtp181.iad.emailsrvr.com ([207.97.245.181]:50479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsXMF-0000Ko-AB for qemu-devel@nongnu.org; Fri, 28 Jun 2013 08:00:55 -0400 From: Andre Przywara Date: Fri, 28 Jun 2013 13:59:58 +0200 Message-Id: <1372420798-4790-1-git-send-email-andre.przywara@calxeda.com> Subject: [Qemu-devel] [PATCH] highbank: add initial Calxeda Midway A15 support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, aliguori@us.ibm.com Cc: Andre Przywara , qemu-devel@nongnu.org, Rob Herring From: Rob Herring While the Calxeda Midway part is actually a bit more than a "Highbank with A15s", for QEMU's purposes this view is sufficient. So to allow both emulation with that chip as well as KVM guests using that model add an A15 CPU and it's peripherals as an option. The use of: "-M highbank -cpu cortex-a15" simply gives the new chip without the need for a new model. Signed-off-by: Rob Herring Signed-off-by: Andre Przywara --- hw/arm/highbank.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 4405dbd..ed864c6 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -196,6 +196,7 @@ static void highbank_init(QEMUMachineInitArgs *args) const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; + CPUARMState *env = NULL; DeviceState *dev; SysBusDevice *busdev; qemu_irq *irqp; @@ -223,6 +224,8 @@ static void highbank_init(QEMUMachineInitArgs *args) cpu->reset_cbar = GIC_BASE_ADDR; irqp = arm_pic_init_cpu(cpu); cpu_irq[n] = irqp[ARM_PIC_CPU_IRQ]; + + env = &cpu->env; } sysmem = get_system_memory(); @@ -246,7 +249,16 @@ static void highbank_init(QEMUMachineInitArgs *args) } } - dev = qdev_create(NULL, "a9mpcore_priv"); + if (arm_feature(env, ARM_FEATURE_LPAE)) { + dev = qdev_create(NULL, "a15mpcore_priv"); + } else { + dev = qdev_create(NULL, "l2x0"); + qdev_init_nofail(dev); + busdev = SYS_BUS_DEVICE(dev); + sysbus_mmio_map(busdev, 0, 0xfff12000); + + dev = qdev_create(NULL, "a9mpcore_priv"); + } qdev_prop_set_uint32(dev, "num-cpu", smp_cpus); qdev_prop_set_uint32(dev, "num-irq", NIRQ_GIC); qdev_init_nofail(dev); @@ -260,11 +272,6 @@ static void highbank_init(QEMUMachineInitArgs *args) pic[n] = qdev_get_gpio_in(dev, n); } - dev = qdev_create(NULL, "l2x0"); - qdev_init_nofail(dev); - busdev = SYS_BUS_DEVICE(dev); - sysbus_mmio_map(busdev, 0, 0xfff12000); - dev = qdev_create(NULL, "sp804"); qdev_prop_set_uint32(dev, "freq0", 150000000); qdev_prop_set_uint32(dev, "freq1", 150000000); -- 1.7.12.1