[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/24] hw/arm/sbsa-ref: use bsa.h for PPI definitions
From: |
Peter Maydell |
Subject: |
[PULL 12/24] hw/arm/sbsa-ref: use bsa.h for PPI definitions |
Date: |
Thu, 19 Oct 2023 14:35:25 +0100 |
From: Leif Lindholm <quic_llindhol@quicinc.com>
Use the private peripheral interrupt definitions from bsa.h instead of
defining them locally. Refactor to use the INTIDs defined there instead
of the PPI# used previously.
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Message-id: 20230919090229.188092-4-quic_llindhol@quicinc.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/sbsa-ref.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 3c7dfcd6dc5..e8a82618f0a 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -2,6 +2,7 @@
* ARM SBSA Reference Platform emulation
*
* Copyright (c) 2018 Linaro Limited
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Written by Hongbo Zhang <hongbo.zhang@linaro.org>
*
* This program is free software; you can redistribute it and/or modify it
@@ -30,6 +31,7 @@
#include "exec/hwaddr.h"
#include "kvm_arm.h"
#include "hw/arm/boot.h"
+#include "hw/arm/bsa.h"
#include "hw/arm/fdt.h"
#include "hw/arm/smmuv3.h"
#include "hw/block/flash.h"
@@ -55,14 +57,6 @@
#define NUM_SMMU_IRQS 4
#define NUM_SATA_PORTS 6
-#define VIRTUAL_PMU_IRQ 7
-#define ARCH_GIC_MAINT_IRQ 9
-#define ARCH_TIMER_VIRT_IRQ 11
-#define ARCH_TIMER_S_EL1_IRQ 13
-#define ARCH_TIMER_NS_EL1_IRQ 14
-#define ARCH_TIMER_NS_EL2_IRQ 10
-#define ARCH_TIMER_NS_EL2_VIRT_IRQ 12
-
enum {
SBSA_FLASH,
SBSA_MEM,
@@ -479,7 +473,7 @@ static void create_gic(SBSAMachineState *sms, MemoryRegion
*mem)
*/
for (i = 0; i < smp_cpus; i++) {
DeviceState *cpudev = DEVICE(qemu_get_cpu(i));
- int ppibase = NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS;
+ int intidbase = NUM_IRQS + i * GIC_INTERNAL;
int irq;
/*
* Mapping from the output timer irq lines from the CPU to the
@@ -496,14 +490,17 @@ static void create_gic(SBSAMachineState *sms,
MemoryRegion *mem)
for (irq = 0; irq < ARRAY_SIZE(timer_irq); irq++) {
qdev_connect_gpio_out(cpudev, irq,
qdev_get_gpio_in(sms->gic,
- ppibase + timer_irq[irq]));
+ intidbase +
timer_irq[irq]));
}
qdev_connect_gpio_out_named(cpudev, "gicv3-maintenance-interrupt", 0,
- qdev_get_gpio_in(sms->gic, ppibase
+ qdev_get_gpio_in(sms->gic,
+ intidbase
+ ARCH_GIC_MAINT_IRQ));
+
qdev_connect_gpio_out_named(cpudev, "pmu-interrupt", 0,
- qdev_get_gpio_in(sms->gic, ppibase
+ qdev_get_gpio_in(sms->gic,
+ intidbase
+ VIRTUAL_PMU_IRQ));
sysbus_connect_irq(gicbusdev, i, qdev_get_gpio_in(cpudev,
ARM_CPU_IRQ));
--
2.34.1
- [PULL 00/24] target-arm queue, Peter Maydell, 2023/10/19
- [PULL 01/24] hw/arm: Move raspberrypi-fw-defs.h to the include/hw/arm/ folder, Peter Maydell, 2023/10/19
- [PULL 02/24] hw/arm/exynos4210: Get arm_boot_info declaration from 'hw/arm/boot.h', Peter Maydell, 2023/10/19
- [PULL 12/24] hw/arm/sbsa-ref: use bsa.h for PPI definitions,
Peter Maydell <=
- [PULL 14/24] arm/kvm: convert to kvm_get_one_reg, Peter Maydell, 2023/10/19
- [PULL 11/24] include/hw/arm: move BSA definitions to bsa.h, Peter Maydell, 2023/10/19
- [PULL 07/24] elf2dmp: limit print length for sign_rsds, Peter Maydell, 2023/10/19
- [PULL 09/24] target/arm: Fix CNTPCT_EL0 trapping from EL0 when HCR_EL2.E2H is 0, Peter Maydell, 2023/10/19
- [PULL 10/24] {include/}hw/arm: refactor virt PPI logic, Peter Maydell, 2023/10/19
- [PULL 13/24] arm/kvm: convert to kvm_set_one_reg, Peter Maydell, 2023/10/19
- [PULL 21/24] target/arm/common-semi-target.h: Remove unnecessary boot.h include, Peter Maydell, 2023/10/19
- [PULL 23/24] hw/timer/npcm7xx_timer: Prevent timer from counting down past zero, Peter Maydell, 2023/10/19
- [PULL 16/24] hw/arm/smmuv3: Update ID register bit field definitions, Peter Maydell, 2023/10/19
- [PULL 17/24] hw/arm/smmuv3: Sort ID register setting into field order, Peter Maydell, 2023/10/19