x86: Allow interrupt to happen once
authorSimon Glass <sjg@chromium.org>
Sat, 7 Dec 2019 04:42:15 +0000 (21:42 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 15 Dec 2019 03:44:16 +0000 (11:44 +0800)
At present the interrupt table is included in all phases of U-Boot. Allow
it to be omitted, e.g. in TPL, to reduce size.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/Makefile
arch/x86/cpu/irq.c
arch/x86/lib/pirq_routing.c

index 6296b55ff8ad2d26928c4c4b2b4ccf47e6f36b59..b6a010ea320aa50ad925874305b55ee9f703d05a 100644 (file)
@@ -53,7 +53,7 @@ obj-$(CONFIG_INTEL_QUARK) += quark/
 obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/
 obj-$(CONFIG_INTEL_TANGIER) += tangier/
 obj-$(CONFIG_APIC) += lapic.o ioapic.o
-obj-y += irq.o
+obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += irq.o
 ifndef CONFIG_$(SPL_)X86_64
 obj-$(CONFIG_SMP) += mp_init.o
 endif
index cb183496b7a9cfeba89048c2c62131d545e12cb6..ed9938f7f7f547c7dd99b7a12cf486465f7f152e 100644 (file)
@@ -350,14 +350,6 @@ int irq_router_probe(struct udevice *dev)
        return 0;
 }
 
-ulong write_pirq_routing_table(ulong addr)
-{
-       if (!gd->arch.pirq_routing_table)
-               return addr;
-
-       return copy_pirq_routing_table(addr, gd->arch.pirq_routing_table);
-}
-
 static const struct udevice_id irq_router_ids[] = {
        { .compatible = "intel,irq-router" },
        { }
index e5f0e6142418930c65ec35b8f3064ec7f50fd3f5..17bd2fcb9b4e1bef8fab197b46c8c90487f7b53a 100644 (file)
@@ -10,6 +10,8 @@
 #include <asm/pci.h>
 #include <asm/pirq_routing.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static u8 pirq_get_next_free_irq(struct udevice *dev, u8 *pirq, u16 bitmap,
                                 bool irq_already_routed[])
 {
@@ -131,3 +133,11 @@ u32 copy_pirq_routing_table(u32 addr, struct irq_routing_table *rt)
 
        return addr + rt->size;
 }
+
+ulong write_pirq_routing_table(ulong addr)
+{
+       if (!gd->arch.pirq_routing_table)
+               return addr;
+
+       return copy_pirq_routing_table(addr, gd->arch.pirq_routing_table);
+}