summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@linux-qpx1.site>2013-11-17 11:40:58 -0600
committerGregory Nutt <gnutt@linux-qpx1.site>2013-11-17 11:40:58 -0600
commitaecb26ec375c973784961bbf4416d2b068a4d06c (patch)
treecf03ae37592761112ea702a376a5d339af07e87e
parent5f5985291c77362be6398d5791ebc525a385aa40 (diff)
downloadnuttx-aecb26ec375c973784961bbf4416d2b068a4d06c.tar.gz
nuttx-aecb26ec375c973784961bbf4416d2b068a4d06c.tar.bz2
nuttx-aecb26ec375c973784961bbf4416d2b068a4d06c.zip
A10: Make sure that interrupts are disabled and cleared
-rw-r--r--nuttx/arch/arm/src/a1x/a1x_boot.c2
-rw-r--r--nuttx/arch/arm/src/a1x/a1x_irq.c10
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