From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

arm on firecracker: recognize GIC v2 on arm and skip parcing PCI if count 0

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/arch/aarch64/arch-dtb.cc b/arch/aarch64/arch-dtb.cc
--- a/arch/aarch64/arch-dtb.cc
+++ b/arch/aarch64/arch-dtb.cc
@@ -255,9 +255,12 @@ bool dtb_get_gic_v2(u64 *dist, size_t *dist_len, u64 *cpu, 
size_t *cpu_len)
     if (!dtb)
         return false;
 
-    node = fdt_node_offset_by_compatible(dtb, -1, "arm,cortex-a15-gic");
-    if (node < 0)
-        return false;
+    node = fdt_node_offset_by_compatible(dtb, -1, "arm,gic-400");
+    if (node < 0) {
+        node = fdt_node_offset_by_compatible(dtb, -1, "arm,cortex-a15-gic");
+        if (node < 0)
+            return false;
+    }
 
     if (!dtb_get_reg_n(node, addr, len, 2))
         return false;
@@ -646,7 +649,7 @@ void  __attribute__((constructor(init_prio::dtb))) 
dtb_setup()
     dtb_timer_irq = dtb_parse_timer_irq();
     dtb_pci_irqmask = dtb_parse_pci_irqmask();
     dtb_pci_irqmap_count = dtb_parse_pci_irqmap_count();
-    if (!dtb_parse_pci_irqmap(dtb_pci_bdfs, dtb_pci_irq_ids, 
dtb_pci_irqmap_count)) {
+    if (dtb_pci_irqmap_count > 0 && !dtb_parse_pci_irqmap(dtb_pci_bdfs, 
dtb_pci_irq_ids, dtb_pci_irqmap_count)) {
         abort("dtb_setup: failed to parse pci_irq_map.\n");
     }
 

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/0000000000002d490205a9128b93%40google.com.

Reply via email to