[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/8] hw/cpu/arm_mpcore: Remove default values for GIC external IR
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 8/8] hw/cpu/arm_mpcore: Remove default values for GIC external IRQs |
Date: |
Thu, 30 Jan 2025 19:24:41 +0100 |
Implicit default values are often hard to figure out, better
be explicit. Now that all boards explicitly set the number of
GIC external IRQs, remove the default values (displaying an
error message if it is not set).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/cpu/a15mpcore.c | 13 ++++++-------
hw/cpu/a9mpcore.c | 14 +++++++-------
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index 3b0897e54ee..372b615178f 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -58,6 +58,11 @@ static void a15mp_priv_realize(DeviceState *dev, Error
**errp)
bool has_el2 = false;
Object *cpuobj;
+ if (!s->num_irq) {
+ error_setg(errp, "Property 'num-irq' not set");
+ return;
+ }
+
gicdev = DEVICE(&s->gic);
qdev_prop_set_uint32(gicdev, "num-cpu", s->num_cpu);
qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq);
@@ -146,13 +151,7 @@ static void a15mp_priv_realize(DeviceState *dev, Error
**errp)
static const Property a15mp_priv_properties[] = {
DEFINE_PROP_UINT32("num-cpu", A15MPPrivState, num_cpu, 1),
- /* The Cortex-A15MP may have anything from 0 to 224 external interrupt
- * IRQ lines (with another 32 internal). We default to 128+32, which
- * is the number provided by the Cortex-A15MP test chip in the
- * Versatile Express A15 development board.
- * Other boards may differ and should set this property appropriately.
- */
- DEFINE_PROP_UINT32("num-irq", A15MPPrivState, num_irq, 160),
+ DEFINE_PROP_UINT32("num-irq", A15MPPrivState, num_irq, 0),
};
static void a15mp_priv_class_init(ObjectClass *klass, void *data)
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
index 9671585b5f9..c522f8d4b05 100644
--- a/hw/cpu/a9mpcore.c
+++ b/hw/cpu/a9mpcore.c
@@ -56,6 +56,12 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)
CPUState *cpu0;
Object *cpuobj;
+
+ if (!s->num_irq) {
+ error_setg(errp, "Property 'num-irq' not set");
+ return;
+ }
+
cpu0 = qemu_get_cpu(0);
cpuobj = OBJECT(cpu0);
if (strcmp(object_get_typename(cpuobj), ARM_CPU_TYPE_NAME("cortex-a9"))) {
@@ -160,13 +166,7 @@ static void a9mp_priv_realize(DeviceState *dev, Error
**errp)
static const Property a9mp_priv_properties[] = {
DEFINE_PROP_UINT32("num-cpu", A9MPPrivState, num_cpu, 1),
- /* The Cortex-A9MP may have anything from 0 to 224 external interrupt
- * IRQ lines (with another 32 internal). We default to 64+32, which
- * is the number provided by the Cortex-A9MP test chip in the
- * Realview PBX-A9 and Versatile Express A9 development boards.
- * Other boards may differ and should set this property appropriately.
- */
- DEFINE_PROP_UINT32("num-irq", A9MPPrivState, num_irq, 96),
+ DEFINE_PROP_UINT32("num-irq", A9MPPrivState, num_irq, 0),
};
static void a9mp_priv_class_init(ObjectClass *klass, void *data)
--
2.47.1
- [PATCH 0/8] hw/arm: Explicit number of GIC external IRQs for Cortex A9/A15 MPCore, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 1/8] hw/arm/exynos4210: Replace magic 32 by proper 'GIC_INTERNAL' definition, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 2/8] hw/arm/exynos4210: Explicit number of GIC external IRQs, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 3/8] hw/arm/realview: Explicit number of GIC external IRQs, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 4/8] hw/arm/xilinx_zynq: Replace IRQ_OFFSET -> GIC_INTERNAL, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 5/8] hw/arm/xilinx_zynq: Explicit number of GIC external IRQs, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 6/8] hw/arm/vexpress: Explicit number of GIC external IRQs, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 7/8] hw/arm/highbank: Explicit number of GIC external IRQs, Philippe Mathieu-Daudé, 2025/01/30
- [PATCH 8/8] hw/cpu/arm_mpcore: Remove default values for GIC external IRQs,
Philippe Mathieu-Daudé <=