Skip to contentSkip to conversation

hw/arm/sbsa-ref : small fixes to smmuv3 initialisation

PATCH Superseded Graeme Gregory 2 participants 4 messages Sep 29, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover hw/arm/sbsa-ref : small fixes to smmuv3 initialisation

Fix two issues with the smmuv3 initialisation, first where a previous patch had transposed an i to a 1. The second an assumption that the IRQs allocated were meant to be unique and not 0 based.

Graeme Gregory (2):
hw/arm/sbsa-ref : Fix SMMUv3 Initialisation
hw/arm/sbsa-ref : allocate IRQs for SMMUv3

 hw/arm/sbsa-ref.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 hw/arm/sbsa-ref : Fix SMMUv3 Initialisation

SMMUv3 has an error in previous patch where a i was transposed to a 1 meaning interrupts would not have been correctly assigned to the SMMUv3 instance.

Fixes 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/sbsa-ref.c +1 -1
index 257ada9425..47e83252c1 100644
@@ -530,7 +530,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     for (i = 0; i < NUM_SMMU_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
     }
 }
 
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 hw/arm/sbsa-ref : allocate IRQs for SMMUv3

In reply to Graeme Gregory

Original commit did not allocate IRQs for the SMMUv3 in the irqmap effectively using irq 0->3 (shared with other devices). Assuming original intent was to allocate unique IRQs then add an allocation to the irqmap.

Fixes e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part")
---
 hw/arm/sbsa-ref.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/sbsa-ref.c +1 -0
index 47e83252c1..9109fb58be 100644
@@ -138,6 +138,7 @@ static const int sbsa_ref_irqmap[] = {
     [SBSA_SECURE_UART_MM] = 9,
     [SBSA_AHCI] = 10,
     [SBSA_EHCI] = 11,
+    [SBSA_SMMU] = 12, /* ... to 15 */
 };
 
 static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] hw/arm/sbsa-ref : allocate IRQs for SMMUv3

Quoted 7 lines · Graeme Gregory

Original commit did not allocate IRQs for the SMMUv3 in the irqmap effectively using irq 0->3 (shared with other devices). Assuming original intent was to allocate unique IRQs then add an allocation to the irqmap.

Fixes e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part")
Quoted 17 lines
---
 hw/arm/sbsa-ref.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/sbsa-ref.c +1 -0
index 47e83252c1..9109fb58be 100644
@@ -138,6 +138,7 @@ static const int sbsa_ref_irqmap[] = {
     [SBSA_SECURE_UART_MM] = 9,
     [SBSA_AHCI] = 10,
     [SBSA_EHCI] = 11,
+    [SBSA_SMMU] = 12, /* ... to 15 */
 };
 
 static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)