aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/cpu
diff options
context:
space:
mode:
authorSimon Glass2020-02-06 09:54:58 -0700
committerBin Meng2020-02-07 22:45:35 +0800
commit69c2dc937a53f4f35688c1289720625e002f3791 (patch)
tree30fc725691a932988bcfe1258ea49e86e56a84e6 /arch/x86/cpu
parentba876079714db52887cab9f068ea1136de4cc107 (diff)
x86: Give each driver an IRQ type
Add an IRQ type to each driver and use irq_first_device_type() to find and probe the correct one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r--arch/x86/cpu/apollolake/fsp_s.c4
-rw-r--r--arch/x86/cpu/i386/interrupt.c3
-rw-r--r--arch/x86/cpu/intel_common/itss.c2
-rw-r--r--arch/x86/cpu/irq.c3
4 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/cpu/apollolake/fsp_s.c b/arch/x86/cpu/apollolake/fsp_s.c
index f8fa4dec8f7..b2d91308411 100644
--- a/arch/x86/cpu/apollolake/fsp_s.c
+++ b/arch/x86/cpu/apollolake/fsp_s.c
@@ -535,7 +535,7 @@ int arch_fsps_preinit(void)
struct udevice *itss;
int ret;
- ret = uclass_first_device_err(UCLASS_IRQ, &itss);
+ ret = irq_first_device_type(X86_IRQT_ITSS, &itss);
if (ret)
return log_msg_ret("no itss", ret);
/*
@@ -576,7 +576,7 @@ int arch_fsp_init_r(void)
if (ret)
return ret;
- ret = uclass_first_device_err(UCLASS_IRQ, &itss);
+ ret = irq_first_device_type(X86_IRQT_ITSS, &itss);
if (ret)
return log_msg_ret("no itss", ret);
/* Restore GPIO IRQ polarities back to previous settings */
diff --git a/arch/x86/cpu/i386/interrupt.c b/arch/x86/cpu/i386/interrupt.c
index 70edbe06e4c..4c7e9ea2151 100644
--- a/arch/x86/cpu/i386/interrupt.c
+++ b/arch/x86/cpu/i386/interrupt.c
@@ -15,6 +15,7 @@
#include <efi_loader.h>
#include <hang.h>
#include <init.h>
+#include <irq.h>
#include <irq_func.h>
#include <asm/control_regs.h>
#include <asm/i8259.h>
@@ -264,7 +265,7 @@ int interrupt_init(void)
int ret;
/* Try to set up the interrupt router, but don't require one */
- ret = uclass_first_device_err(UCLASS_IRQ, &dev);
+ ret = irq_first_device_type(X86_IRQT_BASE, &dev);
if (ret && ret != -ENODEV)
return ret;
diff --git a/arch/x86/cpu/intel_common/itss.c b/arch/x86/cpu/intel_common/itss.c
index 9df51adecc1..33962cb9a0e 100644
--- a/arch/x86/cpu/intel_common/itss.c
+++ b/arch/x86/cpu/intel_common/itss.c
@@ -199,7 +199,7 @@ static const struct irq_ops itss_ops = {
};
static const struct udevice_id itss_ids[] = {
- { .compatible = "intel,itss"},
+ { .compatible = "intel,itss", .data = X86_IRQT_ITSS },
{ }
};
diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
index ed9938f7f7f..bafa0310822 100644
--- a/arch/x86/cpu/irq.c
+++ b/arch/x86/cpu/irq.c
@@ -7,6 +7,7 @@
#include <dm.h>
#include <errno.h>
#include <fdtdec.h>
+#include <irq.h>
#include <malloc.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -351,7 +352,7 @@ int irq_router_probe(struct udevice *dev)
}
static const struct udevice_id irq_router_ids[] = {
- { .compatible = "intel,irq-router" },
+ { .compatible = "intel,irq-router", .data = X86_IRQT_BASE },
{ }
};