From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Pierrick Bouvier <pierrick.bouvier@linaro.org>
Subject: [PULL 03/10] hw/arm/aspeed_ast27x0: Use bsa.h for PPI definitions
Date: Mon, 4 Nov 2024 11:14:54 +0100 [thread overview]
Message-ID: <20241104101501.2487001-4-clg@redhat.com> (raw)
In-Reply-To: <20241104101501.2487001-1-clg@redhat.com>
From: Peter Maydell <peter.maydell@linaro.org>
Use the private peripheral interrupt definitions from bsa.h instead
of defining them locally.
Note that bsa.h defines these values as INTID values, which are all
16 greater than the PPI values that we were previously using. So we
refactor the code to use INTID-based values to match that.
This is the same thing we did in commit d40ab068c07d9 for sbsa-ref.
It removes the "same constant, different values" confusion where this
board code and bsa.h both define an ARCH_GIC_MAINT_IRQ, and allows us
to use symbolic names for the timer interrupt IDs.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/arm/aspeed_ast27x0.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index dca660eb6be2..5638a7a5781b 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -13,6 +13,7 @@
#include "qapi/error.h"
#include "hw/misc/unimp.h"
#include "hw/arm/aspeed_soc.h"
+#include "hw/arm/bsa.h"
#include "qemu/module.h"
#include "qemu/error-report.h"
#include "hw/i2c/aspeed_i2c.h"
@@ -416,28 +417,28 @@ static bool aspeed_soc_ast2700_gic_realize(DeviceState *dev, Error **errp)
for (i = 0; i < sc->num_cpus; i++) {
DeviceState *cpudev = DEVICE(&a->cpu[i]);
- int NUM_IRQS = 256, ARCH_GIC_MAINT_IRQ = 9, VIRTUAL_PMU_IRQ = 7;
- int ppibase = NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS;
+ int NUM_IRQS = 256;
+ int intidbase = NUM_IRQS + i * GIC_INTERNAL;
const int timer_irq[] = {
- [GTIMER_PHYS] = 14,
- [GTIMER_VIRT] = 11,
- [GTIMER_HYP] = 10,
- [GTIMER_SEC] = 13,
+ [GTIMER_PHYS] = ARCH_TIMER_NS_EL1_IRQ,
+ [GTIMER_VIRT] = ARCH_TIMER_VIRT_IRQ,
+ [GTIMER_HYP] = ARCH_TIMER_NS_EL2_IRQ,
+ [GTIMER_SEC] = ARCH_TIMER_S_EL1_IRQ,
};
int j;
for (j = 0; j < ARRAY_SIZE(timer_irq); j++) {
qdev_connect_gpio_out(cpudev, j,
- qdev_get_gpio_in(gicdev, ppibase + timer_irq[j]));
+ qdev_get_gpio_in(gicdev, intidbase + timer_irq[j]));
}
qemu_irq irq = qdev_get_gpio_in(gicdev,
- ppibase + ARCH_GIC_MAINT_IRQ);
+ intidbase + ARCH_GIC_MAINT_IRQ);
qdev_connect_gpio_out_named(cpudev, "gicv3-maintenance-interrupt",
0, irq);
qdev_connect_gpio_out_named(cpudev, "pmu-interrupt", 0,
- qdev_get_gpio_in(gicdev, ppibase + VIRTUAL_PMU_IRQ));
+ qdev_get_gpio_in(gicdev, intidbase + VIRTUAL_PMU_IRQ));
sysbus_connect_irq(gicbusdev, i, qdev_get_gpio_in(cpudev, ARM_CPU_IRQ));
sysbus_connect_irq(gicbusdev, i + sc->num_cpus,
--
2.47.0
next prev parent reply other threads:[~2024-11-04 10:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 10:14 [PULL 00/10] aspeed queue Cédric Le Goater
2024-11-04 10:14 ` [PULL 01/10] hw/arm: enable at24c with aspeed Cédric Le Goater
2024-11-04 10:14 ` [PULL 02/10] hw/sd/sdcard: Fix calculation of size when using eMMC boot partitions Cédric Le Goater
2024-11-04 10:14 ` Cédric Le Goater [this message]
2024-11-04 10:14 ` [PULL 04/10] hw/arm/aspeed_ast27x0: Avoid hardcoded '256' in IRQ calculation Cédric Le Goater
2024-11-04 10:14 ` [PULL 05/10] aspeed/soc: Support RTC for AST2700 Cédric Le Goater
2024-11-04 10:14 ` [PULL 06/10] hw/timer/aspeed: Fix coding style Cédric Le Goater
2024-11-04 10:14 ` [PULL 07/10] hw/timer/aspeed: Fix interrupt status does not be cleared for AST2600 Cédric Le Goater
2024-11-04 10:14 ` [PULL 08/10] hw/sd/aspeed_sdhci: Introduce Capabilities Register 2 for SD slot 0 and 1 Cédric Le Goater
2024-11-04 10:15 ` [PULL 09/10] aspeed: Support create flash devices via command line for AST1030 Cédric Le Goater
2024-11-04 10:15 ` [PULL 10/10] aspeed: Don't set always boot properties of the emmc device Cédric Le Goater
2024-11-04 10:38 ` [PULL 00/10] aspeed queue Cédric Le Goater
2024-11-05 14:22 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241104101501.2487001-4-clg@redhat.com \
--to=clg@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).