diff options
author | Simon Glass <sjg@chromium.org> | 2016-01-19 21:32:28 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2016-01-24 12:07:18 +0800 |
commit | b565d66d2ca1748c9b0520fa4ba46b4a5dfa5468 (patch) | |
tree | e86809b916cfdd34deb0596eb735427cbee8cfa4 /arch/x86/cpu/irq.c | |
parent | d3b884b294f1927d6599ddb243a7e6c7bb9aaef3 (diff) |
x86: Use the IRQ device when setting up the mptable
Instead of searching for the device tree node, use the IRQ device which has
a record of it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/irq.c')
-rw-r--r-- | arch/x86/cpu/irq.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c index e2feba7b617..d6151e085aa 100644 --- a/arch/x86/cpu/irq.c +++ b/arch/x86/cpu/irq.c @@ -88,7 +88,7 @@ __weak void cpu_irq_init(void) return; } -static int create_pirq_routing_table(void) +static int create_pirq_routing_table(struct udevice *dev) { const void *blob = gd->fdt_blob; struct fdt_pci_addr addr; @@ -102,16 +102,8 @@ static int create_pirq_routing_table(void) int i; int ret; - node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IRQ_ROUTER); - if (node < 0) { - debug("%s: Cannot find irq router node\n", __func__); - return -EINVAL; - } - - /* TODO(sjg@chromium.org): Drop this when PIRQ is a driver */ - parent = fdt_parent_offset(blob, node); - if (parent < 0) - return -EINVAL; + node = dev->of_offset; + parent = dev->parent->of_offset; ret = fdtdec_get_pci_addr(blob, parent, FDT_PCI_SPACE_CONFIG, "reg", &addr); if (ret) @@ -237,7 +229,7 @@ int irq_router_common_init(struct udevice *dev) cpu_irq_init(); - ret = create_pirq_routing_table(); + ret = create_pirq_routing_table(dev); if (ret) { debug("Failed to create pirq routing table\n"); return ret; |