x86: ivybridge: Do the SATA init before relocation
[oweals/u-boot.git] / arch / x86 / cpu / irq.c
index e2feba7b6178bcc113762369e0ab5c05596997a5..0b36ace0915565ab5795655408bca91c88d7ff2a 100644 (file)
@@ -83,12 +83,7 @@ static inline void fill_irq_info(struct irq_info *slot, int bus, int device,
        slot->irq[pin - 1].bitmap = irq_router.irq_mask;
 }
 
-__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 +97,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)
@@ -235,9 +222,7 @@ int irq_router_common_init(struct udevice *dev)
 {
        int ret;
 
-       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;