summaryrefslogtreecommitdiffstats
path: root/hw/arm/realview.c
diff options
context:
space:
mode:
authorRichard Henderson2022-04-21 17:04:43 +0200
committerRichard Henderson2022-04-21 17:04:43 +0200
commit401d46789410e88e9e90d76a11f46e8e9f358d55 (patch)
tree5f3ef89b1459c99f8cd4c7d6554f3432aa2b28a2 /hw/arm/realview.c
parentMerge tag 'pull-ppc-20220420-2' of https://gitlab.com/danielhb/qemu into staging (diff)
parenthw/arm: Use bit fields for NPCM7XX PWRON STRAPs (diff)
downloadqemu-401d46789410e88e9e90d76a11f46e8e9f358d55.tar.gz
qemu-401d46789410e88e9e90d76a11f46e8e9f358d55.tar.xz
qemu-401d46789410e88e9e90d76a11f46e8e9f358d55.zip
Merge tag 'pull-target-arm-20220421' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
target-arm queue: * hw/arm/virt: Check for attempt to use TrustZone with KVM or HVF * versal: Add the Cortex-R5s in the Real-Time Processing Unit (RPU) subsystem * versal: model enough of the Clock/Reset Low-power domain (CRL) to allow control of the Cortex-R5s * xlnx-zynqmp: Connect 4 TTC timers * exynos4210: Refactor GIC/combiner code to stop using qemu_split_irq * realview: replace 'qemu_split_irq' with 'TYPE_SPLIT_IRQ' * stellaris: replace 'qemu_split_irq' with 'TYPE_SPLIT_IRQ' * hw/core/irq: remove unused 'qemu_irq_split' function * npcm7xx: use symbolic constants for PWRON STRAP bit fields * virt: document impact of gic-version on max CPUs # -----BEGIN PGP SIGNATURE----- # # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmJhPSUZHHBldGVyLm1h # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3hAsD/4qzZK6LFL4kFH6E4z3tWIn # ErHrfPGUt/SEfHLP+stQP/loFgkR1SNzcrIZ/HiDCB/W+IqQKuP+tHin2lMhO1tR # KM6suUO1In2hoxfzimVta4F4GVN8ifY69qUYhaRxcBYSUpRXDNFJGsRIeT5JeUMd # SArZUifRs7JUo25rIkg5Y+YZE37dmiA5gcuswtoLPa/UlDVqRxihLnItySmeutsc # /Y8d/iym/ydlhvtL1OUt1KKYeg4ykrPzJCfvopsT2xgkwwB0PYci8//fa5IrRVlp # Uw6yDssZrDIcXfVz88rdriILaszicCv8lOhTH6I74oXCatiyvi4BEzW8uGqVS8wt # ff+AaKvGqb5t4GKKhCdpL2NzDwKBGWZHuruACs9IfvMkz62HE12Vr99qAKdQ3s93 # QnFIyUKg90mGkvKy8336zX3hnWjPH8wTASOXbNrgnt6GVLkqwy9ibug5kS+n77eJ # BnkE5p3OfMVJ5a4o+iZbbDJKfzhNUHDSMIBbG1jRNzax1RgxOBtHFSqP5jmbpm+S # agyr8h+Md0Tx1dwZKxdCGyvcbSZiG2WxRnci3dyT4MqYY1t1GEpOfcs1EN+CYKwG # iuezZzJopjOFGaXQaB3OvbvCKxuroHKG61SmDmx+5OkfAxhrqe4ulwYij4jhsyhH # t8zGzDOKLakv3li90xCX/w== # =Rke9 # -----END PGP SIGNATURE----- # gpg: Signature made Thu 21 Apr 2022 04:16:53 AM PDT # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [full] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full] * tag 'pull-target-arm-20220421' of https://git.linaro.org/people/pmaydell/qemu-arm: (31 commits) hw/arm: Use bit fields for NPCM7XX PWRON STRAPs hw/misc: Add PWRON STRAP bit fields in GCR module hw/arm/virt: impact of gic-version on max CPUs hw/core/irq: remove unused 'qemu_irq_split' function hw/arm/stellaris: replace 'qemu_split_irq' with 'TYPE_SPLIT_IRQ' hw/arm/realview: replace 'qemu_split_irq' with 'TYPE_SPLIT_IRQ' hw/arm/exynos4210: Drop Exynos4210Irq struct hw/arm/exynos4210: Put combiners into state struct hw/arm/exynos4210: Fold combiner splits into exynos4210_init_board_irqs() hw/arm/exynos4210: Don't connect multiple lines to external GIC inputs hw/arm/exynos4210: Connect MCT_G0 and MCT_G1 to both combiners hw/arm/exynos4210: Fill in irq_table[] for internal-combiner-only IRQ lines hw/arm/exynos4210: Use TYPE_SPLIT_IRQ in exynos4210_init_board_irqs() hw/arm/exynos4210: Delete unused macro definitions hw/arm/exynos4210: Move exynos4210_combiner_get_gpioin() into exynos4210.c hw/arm/exynos4210: Drop ext_gic_irq[] from Exynos4210Irq struct hw/arm/exynos4210: Put external GIC into state struct hw/arm/exynos4210: Move exynos4210_init_board_irqs() into exynos4210.c hw/arm/exynos4210: Fix code style nit in combiner_grp_to_gic_id[] hw/arm/exynos4210: Coalesce board_irqs and irq_table ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/arm/realview.c')
-rw-r--r--hw/arm/realview.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 7b424e94a5..d2dc8a8952 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -13,9 +13,11 @@
#include "hw/sysbus.h"
#include "hw/arm/boot.h"
#include "hw/arm/primecell.h"
+#include "hw/core/split-irq.h"
#include "hw/net/lan9118.h"
#include "hw/net/smc91c111.h"
#include "hw/pci/pci.h"
+#include "hw/qdev-core.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
@@ -53,6 +55,20 @@ static const int realview_board_id[] = {
0x76d
};
+static void split_irq_from_named(DeviceState *src, const char* outname,
+ qemu_irq out1, qemu_irq out2) {
+ DeviceState *splitter = qdev_new(TYPE_SPLIT_IRQ);
+
+ qdev_prop_set_uint32(splitter, "num-lines", 2);
+
+ qdev_realize_and_unref(splitter, NULL, &error_fatal);
+
+ qdev_connect_gpio_out(splitter, 0, out1);
+ qdev_connect_gpio_out(splitter, 1, out2);
+ qdev_connect_gpio_out_named(src, outname, 0,
+ qdev_get_gpio_in(splitter, 0));
+}
+
static void realview_init(MachineState *machine,
enum realview_board_type board_type)
{
@@ -66,7 +82,6 @@ static void realview_init(MachineState *machine,
DeviceState *dev, *sysctl, *gpio2, *pl041;
SysBusDevice *busdev;
qemu_irq pic[64];
- qemu_irq mmc_irq[2];
PCIBus *pci_bus = NULL;
NICInfo *nd;
DriveInfo *dinfo;
@@ -229,14 +244,14 @@ static void realview_init(MachineState *machine,
* and the PL061 has them the other way about. Also the card
* detect line is inverted.
*/
- mmc_irq[0] = qemu_irq_split(
- qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_WPROT),
- qdev_get_gpio_in(gpio2, 1));
- mmc_irq[1] = qemu_irq_split(
- qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN),
- qemu_irq_invert(qdev_get_gpio_in(gpio2, 0)));
- qdev_connect_gpio_out_named(dev, "card-read-only", 0, mmc_irq[0]);
- qdev_connect_gpio_out_named(dev, "card-inserted", 0, mmc_irq[1]);
+ split_irq_from_named(dev, "card-read-only",
+ qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_WPROT),
+ qdev_get_gpio_in(gpio2, 1));
+
+ split_irq_from_named(dev, "card-inserted",
+ qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN),
+ qemu_irq_invert(qdev_get_gpio_in(gpio2, 0)));
+
dinfo = drive_get(IF_SD, 0, 0);
if (dinfo) {
DeviceState *card;