diff options
author | Gregory Nutt <gnutt@linux-qpx1.site> | 2013-11-17 11:40:58 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@linux-qpx1.site> | 2013-11-17 11:40:58 -0600 |
commit | aecb26ec375c973784961bbf4416d2b068a4d06c (patch) | |
tree | cf03ae37592761112ea702a376a5d339af07e87e /nuttx/arch | |
parent | 5f5985291c77362be6398d5791ebc525a385aa40 (diff) | |
download | px4-nuttx-aecb26ec375c973784961bbf4416d2b068a4d06c.tar.gz px4-nuttx-aecb26ec375c973784961bbf4416d2b068a4d06c.tar.bz2 px4-nuttx-aecb26ec375c973784961bbf4416d2b068a4d06c.zip |
A10: Make sure that interrupts are disabled and cleared
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/arm/src/a1x/a1x_boot.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/a1x/a1x_irq.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/a1x/a1x_boot.c b/nuttx/arch/arm/src/a1x/a1x_boot.c index dca93a1a9..66bf43fb7 100644 --- a/nuttx/arch/arm/src/a1x/a1x_boot.c +++ b/nuttx/arch/arm/src/a1x/a1x_boot.c @@ -98,7 +98,7 @@ extern uint32_t _vector_end; /* End+1 of vector block */ #ifndef CONFIG_ARCH_ROMPGTABLE static const struct section_mapping_s section_mapping[] = { - { A1X_INTMEM_PSECTION, A1X_INTMEM_VSECTION, + { A1X_INTMEM_PSECTION, A1X_INTMEM_VSECTION, /* Includes vectors and page table */ A1X_INTMEM_MMUFLAGS, A1X_INTMEM_NSECTIONS }, { A1X_PERIPH_PSECTION, A1X_PERIPH_VSECTION, diff --git a/nuttx/arch/arm/src/a1x/a1x_irq.c b/nuttx/arch/arm/src/a1x/a1x_irq.c index 037e469e8..49361bd23 100644 --- a/nuttx/arch/arm/src/a1x/a1x_irq.c +++ b/nuttx/arch/arm/src/a1x/a1x_irq.c @@ -148,12 +148,22 @@ static void a1x_dumpintc(const char *msg, int irq) void up_irqinitialize(void) { + int i; /* The following operations need to be atomic, but since this function is * called early in the initialization sequence, we expect to have exclusive * access to the INTC. */ + /* Disable, mask, and clear all interrupts */ + + for (i = 0; i < A1X_IRQ_NINT; i += 32) + { + putreg32(0x00000000, A1X_INTC_EN(i)); /* 0 disables corresponding interrupt */ + putreg32(0xffffffff, A1X_INTC_MASK(i)); /* 1 masks corresponding interrupt */ + (void)getreg32(A1X_INTC_IRQ_PEND(i)); /* Reading status clears pending interrupts */ + } + /* Colorize the interrupt stack for debug purposes */ #if defined(CONFIG_DEBUG_STACK) && CONFIG_ARCH_INTERRUPTSTACK > 3 |