[COMMIT osv master] arm on firecracker: recognize GIC v2 on arm and skip parcing PCI if count 0

3 views
Skip to first unread message

Commit Bot

unread,
Jun 27, 2020, 11:33:14 AM6/27/20
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

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

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
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");
}

Reply all
Reply to author
Forward
0 new messages