dm: x86: Add a common PIRQ init function
authorSimon Glass <sjg@chromium.org>
Wed, 20 Jan 2016 04:32:27 +0000 (21:32 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 24 Jan 2016 04:07:18 +0000 (12:07 +0800)
Most x86 interrupt drivers will want to use the standard PIRQ routing and
table setup. Put this code in a common function so it can be used by those
drivers that want it.

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

index 8f59b2362828bde21c0c921452fcbb8dbac383d0..e2feba7b6178bcc113762369e0ab5c05596997a5 100644 (file)
@@ -231,7 +231,7 @@ static int create_pirq_routing_table(void)
        return 0;
 }
 
-int irq_router_probe(struct udevice *dev)
+int irq_router_common_init(struct udevice *dev)
 {
        int ret;
 
@@ -249,6 +249,11 @@ int irq_router_probe(struct udevice *dev)
        return 0;
 }
 
+int irq_router_probe(struct udevice *dev)
+{
+       return irq_router_common_init(dev);
+}
+
 u32 write_pirq_routing_table(u32 addr)
 {
        if (!pirq_routing_table)
index 74da66ea1266ec62ca40bef6022a05fbb50d5d3a..46e1c3119486a5b9497cbfa49e5f21363ffcd160 100644 (file)
@@ -65,4 +65,11 @@ struct pirq_routing {
  */
 void cpu_irq_init(void);
 
+/**
+ * irq_router_common_init() - Perform common x86 interrupt init
+ *
+ * This creates the PIRQ routing table and routes the IRQs
+ */
+int irq_router_common_init(struct udevice *dev);
+
 #endif /* _ARCH_IRQ_H_ */