[U-Boot] [PATCH 1/4] x86: Call cpu_init_interrupts() from interrupt_init()

Currently cpu_init_interrupts() is called from cpu_init_r() to setup the interrupt and exception of the cpu core, but at that time the i8259 has not been initialized to mask all the irqs and remap the master i8259 interrupt vector base, so the whole system is at risk of being interrupted, and if interrupted, wrong interrupt/exception message is shown.
Signed-off-by: Bin Meng bmeng.cn@gmail.com --- arch/x86/cpu/cpu.c | 2 -- arch/x86/lib/pcat_interrupts.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 97c77ba..cf0606e 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -321,8 +321,6 @@ int x86_cpu_init_f(void)
int x86_cpu_init_r(void) { - /* Initialize core interrupt and exception functionality of CPU */ - cpu_init_interrupts(); return 0; } int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r"))); diff --git a/arch/x86/lib/pcat_interrupts.c b/arch/x86/lib/pcat_interrupts.c index 4c86f7f..2ce371e 100644 --- a/arch/x86/lib/pcat_interrupts.c +++ b/arch/x86/lib/pcat_interrupts.c @@ -62,6 +62,9 @@ int interrupt_init(void) */ unmask_irq(2);
+ /* Initialize core interrupt and exception functionality of CPU */ + cpu_init_interrupts(); + enable_interrupts();
return 0;

On 20 November 2014 at 01:10, Bin Meng bmeng.cn@gmail.com wrote:
Currently cpu_init_interrupts() is called from cpu_init_r() to setup the interrupt and exception of the cpu core, but at that time the i8259 has not been initialized to mask all the irqs and remap the master i8259 interrupt vector base, so the whole system is at risk of being interrupted, and if interrupted, wrong interrupt/exception message is shown.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
arch/x86/cpu/cpu.c | 2 -- arch/x86/lib/pcat_interrupts.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-)
Acked-by: Simon Glass sjg@chromium.org
Tested on chromebook_link: Tested-by: Simon Glass sjg@chromium.org

On 24 November 2014 at 20:05, Simon Glass sjg@chromium.org wrote:
On 20 November 2014 at 01:10, Bin Meng bmeng.cn@gmail.com wrote:
Currently cpu_init_interrupts() is called from cpu_init_r() to setup the interrupt and exception of the cpu core, but at that time the i8259 has not been initialized to mask all the irqs and remap the master i8259 interrupt vector base, so the whole system is at risk of being interrupted, and if interrupted, wrong interrupt/exception message is shown.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
arch/x86/cpu/cpu.c | 2 -- arch/x86/lib/pcat_interrupts.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-)
Acked-by: Simon Glass sjg@chromium.org
Tested on chromebook_link: Tested-by: Simon Glass sjg@chromium.org
Applied to u-boot-x86, thanks!
participants (2)
-
Bin Meng
-
Simon Glass