[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/28] PPC: E500: Generate IRQ lines for many CPUs
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 10/28] PPC: E500: Generate IRQ lines for many CPUs |
Date: |
Sat, 23 Jul 2011 12:49:54 +0200 |
Now that we can generate multiple envs for all our virtual CPUs, we
also need to tell the MPIC that we have multiple CPUs connected and
connect them all to the respective virtual interrupt lines.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppce500_mpc8544ds.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index cefb415..7ce9bc7 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -237,7 +237,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,
target_long initrd_size=0;
int i=0;
unsigned int pci_irq_nrs[4] = {1, 2, 3, 4};
- qemu_irq *irqs, *mpic;
+ qemu_irq **irqs, *mpic;
DeviceState *dev;
struct boot_info *boot_info;
CPUState *firstenv = NULL;
@@ -247,6 +247,8 @@ static void mpc8544ds_init(ram_addr_t ram_size,
cpu_model = "e500v2_v30";
}
+ irqs = qemu_mallocz(smp_cpus * sizeof(qemu_irq *));
+ irqs[0] = qemu_mallocz(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
for (i = 0; i < smp_cpus; i++) {
qemu_irq *input;
env = cpu_ppc_init(cpu_model);
@@ -259,6 +261,10 @@ static void mpc8544ds_init(ram_addr_t ram_size,
firstenv = env;
}
+ irqs[i] = irqs[0] + (i * OPENPIC_OUTPUT_NB);
+ input = (qemu_irq *)env->irq_inputs;
+ irqs[i][OPENPIC_OUTPUT_INT] = input[PPCE500_INPUT_INT];
+ irqs[i][OPENPIC_OUTPUT_CINT] = input[PPCE500_INPUT_CINT];
env->spr[SPR_BOOKE_PIR] = env->cpu_index = i;
/* XXX register timer? */
@@ -283,10 +289,11 @@ static void mpc8544ds_init(ram_addr_t ram_size,
"mpc8544ds.ram", ram_size));
/* MPIC */
- irqs = qemu_mallocz(sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
- irqs[OPENPIC_OUTPUT_INT] = ((qemu_irq
*)env->irq_inputs)[PPCE500_INPUT_INT];
- irqs[OPENPIC_OUTPUT_CINT] = ((qemu_irq
*)env->irq_inputs)[PPCE500_INPUT_CINT];
- mpic = mpic_init(MPC8544_MPIC_REGS_BASE, 1, &irqs, NULL);
+ mpic = mpic_init(MPC8544_MPIC_REGS_BASE, smp_cpus, irqs, NULL);
+
+ if (!mpic) {
+ cpu_abort(env, "MPIC failed to initialize\n");
+ }
/* Serial */
if (serial_hds[0]) {
--
1.6.0.2
- [Qemu-devel] [PATCH 25/28] device tree: give dt more size, (continued)
- [Qemu-devel] [PATCH 25/28] device tree: give dt more size, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 03/28] PPC: Extend MPIC MMIO range, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 24/28] device tree: dont fail operations, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 04/28] PPC: Fix IPI support in MPIC, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 02/28] PPC: Add CPU local MMIO regions to MPIC, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 23/28] device tree: add add_subnode command, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 22/28] PPC: E500: Update cpu-release-addr property in cpu nodes, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 17/28] PPC: KVM: Remove kvmppc_read_host_property, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 07/28] PPC: MPIC: Fix CI bit definitions, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 27/28] MPC8544DS: Generate CPU nodes on init, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 10/28] PPC: E500: Generate IRQ lines for many CPUs,
Alexander Graf <=
- [Qemu-devel] [PATCH 16/28] PPC: bamboo: Use kvm api for freq and clock frequencies, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 15/28] PPC: E500: Remove mpc8544_copy_soc_cell, Alexander Graf, 2011/07/23
- [Qemu-devel] [PATCH 20/28] PPC: E500: Remove unneeded CPU nodes, Alexander Graf, 2011/07/23