From 1f4f6bf645b5caf5301a2d1e4489763caceaf555 Mon Sep 17 00:00:00 2001
From: Jiri Kubias <jiri.kubias@addat.cz>
Date: Wed, 9 Feb 2011 11:51:44 +0100
Subject: [PATCH] lpc17cmsis - fixed IRQ vectors in crt0_lpc17xx.c

---
 arch/arm/mach-lpc17cmsis/libs/boot/crt0_17xx.c |  211 +++++++++++++-----------
 1 files changed, 117 insertions(+), 94 deletions(-)

diff --git a/arch/arm/mach-lpc17cmsis/libs/boot/crt0_17xx.c b/arch/arm/mach-lpc17cmsis/libs/boot/crt0_17xx.c
index 6b859d0..933acd9 100644
--- a/arch/arm/mach-lpc17cmsis/libs/boot/crt0_17xx.c
+++ b/arch/arm/mach-lpc17cmsis/libs/boot/crt0_17xx.c
@@ -35,24 +35,45 @@ void WEAK 		PendSV_Handler();            /* PendSV Handler */
 void WEAK 		SysTick_Handler();           /* SysTick Handler */
 
 /* External interrupt vector handler */
-void WEAK  WAKEUP_IRQHandler();
-void WEAK  I2C_IRQHandler();
-void WEAK  TIMER16_0_IRQHandler();
-void WEAK  TIMER16_1_IRQHandler();
-void WEAK  TIMER32_0_IRQHandler();
-void WEAK  TIMER32_1_IRQHandler();
-void WEAK  SSP_IRQHandler();
-void WEAK  UART_IRQHandler();
-void WEAK  USB_IRQHandler();
-void WEAK  USB_FIQHandler();
-void WEAK  ADC_IRQHandler();
-void WEAK  WDT_IRQHandler();
-void WEAK  BOD_IRQHandler();
-void WEAK  FMC_IRQHandler();
-void WEAK  PIOINT3_IRQHandler();
-void WEAK  PIOINT2_IRQHandler();
-void WEAK  PIOINT1_IRQHandler();
-void WEAK  PIOINT0_IRQHandler();
+
+   void WEAK   WDT_IRQHandler();              /* 16: Watchdog Timer               */
+    void WEAK   TIMER0_IRQHandler();           /* 17: Timer0                       */
+    void WEAK   TIMER1_IRQHandler();           /* 18: Timer1                       */
+    void WEAK   TIMER2_IRQHandler();           /* 19: Timer2                       */
+    void WEAK   TIMER3_IRQHandler();           /* 20: Timer3                       */
+    void WEAK   UART0_IRQHandler();            /* 21: UART0                        */
+    void WEAK   UART1_IRQHandler();            /* 22: UART1                        */
+    void WEAK   UART2_IRQHandler();            /* 23: UART2                        */
+    void WEAK   UART3_IRQHandler();            /* 24: UART3                        */
+    void WEAK   PWM1_IRQHandler();             /* 25: PWM1                         */
+    void WEAK   I2C0_IRQHandler();             /* 26: I2C0                         */
+    void WEAK   I2C1_IRQHandler();             /* 27: I2C1                         */
+    void WEAK   I2C2_IRQHandler();             /* 28: I2C2                         */
+    void WEAK   SPI_IRQHandler();              /* 29: SPI                          */
+    void WEAK   SSP0_IRQHandler();             /* 30: SSP0                         */
+    void WEAK   SSP1_IRQHandler();             /* 31: SSP1                         */
+    void WEAK   PLL0_IRQHandler();             /* 32: PLL0 Lock (Main PLL)         */
+    void WEAK   RTC_IRQHandler();              /* 33: Real Time Clock              */
+    void WEAK   EINT0_IRQHandler();            /* 34: External Interrupt 0         */
+    void WEAK   EINT1_IRQHandler();            /* 35: External Interrupt 1         */
+    void WEAK   EINT2_IRQHandler();            /* 36: External Interrupt 2         */
+    void WEAK   EINT3_IRQHandler();            /* 37: External Interrupt 3         */
+    void WEAK   ADC_IRQHandler();              /* 38: A/D Converter                */
+    void WEAK   BOD_IRQHandler();              /* 39: Brown-Out Detect             */
+    void WEAK   USB_IRQHandler();              /* 40: USB                          */
+    void WEAK   CAN_IRQHandler();              /* 41: CAN                          */
+    void WEAK   DMA_IRQHandler();              /* 42: General Purpose DMA          */
+    void WEAK   I2S_IRQHandler();              /* 43: I2S                          */
+    void WEAK   ENET_IRQHandler();             /* 44: Ethernet                     */
+    void WEAK   RIT_IRQHandler();              /* 45: Repetitive Interrupt Timer   */
+    void WEAK   MCPWM_IRQHandler();            /* 46: Motor Control PWM            */
+    void WEAK   QEI_IRQHandler();              /* 47: Quadrature Encoder Interface */
+    void WEAK   PLL1_IRQHandler();             /* 48: PLL1 Lock (USB PLL)          */
+    void WEAK	USBActivity_IRQHandler();		/* 49: USB Activity 				*/
+    void WEAK 	CANActivity_IRQHandler();		/* 50: CAN Activity					*/
+
+
+
 
 /** memory map pointers (defined in ldscript) **/
 extern uint32_t _data, _edata, _datainit;
@@ -92,64 +113,42 @@ __attribute__((section(".ivec")))
   PendSV_Handler,            /* PendSV Handler */
   SysTick_Handler,           /* SysTick Handler */
 
-  /* LPC13xx specific interrupts */
-  WAKEUP_IRQHandler,         /* 16  0 Wake-up on  pin  PIO0_0             */
-  WAKEUP_IRQHandler,         /* 17  1 Wake-up on  pin  PIO0_1             */
-  WAKEUP_IRQHandler,         /* 18  2 Wake-up on  pin  PIO0_2             */
-  WAKEUP_IRQHandler,         /* 19  3 Wake-up on  pin  PIO0_3             */
-  WAKEUP_IRQHandler,         /* 20  4 Wake-up on  pin  PIO0_4             */
-  WAKEUP_IRQHandler,         /* 21  5 Wake-up on  pin  PIO0_5             */
-  WAKEUP_IRQHandler,         /* 22  6 Wake-up on  pin  PIO0_6             */
-  WAKEUP_IRQHandler,         /* 23  7 Wake-up on  pin  PIO0_7             */
-  WAKEUP_IRQHandler,         /* 24  8 Wake-up on  pin  PIO0_8             */
-  WAKEUP_IRQHandler,         /* 25  9 Wake-up on  pin  PIO0_9             */
-  WAKEUP_IRQHandler,         /* 26 10 Wake-up on  pin  PIO0_10            */
-  WAKEUP_IRQHandler,         /* 27 11 Wake-up on  pin  PIO0_11            */
-  WAKEUP_IRQHandler,         /* 28 12 Wake-up on  pin  PIO1_0             */
-  WAKEUP_IRQHandler,         /* 29 13 Wake-up on  pin  PIO1_1             */
-  WAKEUP_IRQHandler,         /* 30 14 Wake-up on  pin  PIO1_2             */
-  WAKEUP_IRQHandler,         /* 31 15 Wake-up on  pin  PIO1_3             */
-  WAKEUP_IRQHandler,         /* 32 16 Wake-up on  pin  PIO1_4             */
-  WAKEUP_IRQHandler,         /* 33 17 Wake-up on  pin  PIO1_5             */
-  WAKEUP_IRQHandler,         /* 34 18 Wake-up on  pin  PIO1_6             */
-  WAKEUP_IRQHandler,         /* 35 19 Wake-up on  pin  PIO1_7             */
-  WAKEUP_IRQHandler,         /* 36 20 Wake-up on  pin  PIO1_8             */
-  WAKEUP_IRQHandler,         /* 37 21 Wake-up on  pin  PIO1_9             */
-  WAKEUP_IRQHandler,         /* 38 22 Wake-up on  pin  PIO1_10            */
-  WAKEUP_IRQHandler,         /* 39 23 Wake-up on  pin  PIO1_11            */
-  WAKEUP_IRQHandler,         /* 40 24 Wake-up on  pin  PIO2_0             */
-  WAKEUP_IRQHandler,         /* 41 25 Wake-up on  pin  PIO2_1             */
-  WAKEUP_IRQHandler,         /* 42 26 Wake-up on  pin  PIO2_2             */
-  WAKEUP_IRQHandler,         /* 43 27 Wake-up on  pin  PIO2_3             */
-  WAKEUP_IRQHandler,         /* 44 28 Wake-up on  pin  PIO2_4             */
-  WAKEUP_IRQHandler,         /* 45 29 Wake-up on  pin  PIO2_5             */
-  WAKEUP_IRQHandler,         /* 46 30 Wake-up on  pin  PIO2_6             */
-  WAKEUP_IRQHandler,         /* 47 31 Wake-up on  pin  PIO2_7             */
-  WAKEUP_IRQHandler,         /* 48 32 Wake-up on  pin  PIO2_8             */
-  WAKEUP_IRQHandler,         /* 49 33 Wake-up on  pin  PIO2_9             */
-  WAKEUP_IRQHandler,         /* 50 34 Wake-up on  pin  PIO2_10            */
-  WAKEUP_IRQHandler,         /* 51 35 Wake-up on  pin  PIO2_11            */
-  WAKEUP_IRQHandler,         /* 52 36 Wake-up on  pin  PIO3_0             */
-  WAKEUP_IRQHandler,         /* 53 37 Wake-up on  pin  PIO3_1             */
-  WAKEUP_IRQHandler,         /* 54 38 Wake-up on  pin  PIO3_2             */
-  WAKEUP_IRQHandler,         /* 55 39 Wake-up on  pin  PIO3_3             */
-  I2C_IRQHandler,            /* 56 40 I2C0 SI (state change)    */
-  TIMER16_0_IRQHandler,      /* 57 41 CT16B0 16 bit timer 0     */
-  TIMER16_1_IRQHandler,      /* 58 42 CT16B1 16 bit timer 1     */
-  TIMER32_0_IRQHandler,      /* 59 43 CT32B0 32 bit timer 0     */
-  TIMER32_1_IRQHandler,      /* 60 44 CT32B1 32 bit timer 1     */
-  SSP_IRQHandler,            /* 61 45 SSP                       */
-  UART_IRQHandler,           /* 62 46 UART                      */
-  USB_IRQHandler,            /* 63 47 USB IRQ low priority      */
-  USB_FIQHandler,            /* 64 48 USB FIQ high priority     */
-  ADC_IRQHandler,            /* 65 49 ADC end of conversion     */
-  WDT_IRQHandler,            /* 66 50 Watchdog interrupt (WDINT)          */
-  BOD_IRQHandler,            /* 67 51 BOD Brown-out detect                */
-  FMC_IRQHandler,            /* 68 52 Reserved also marked as IP2111 Flash Memory */
-  PIOINT3_IRQHandler,        /* 69 53 PIO_3  GPIO interrupt status of port 3 */
-  PIOINT2_IRQHandler,        /* 70 54 PIO_2  GPIO interrupt status of port 2 */
-  PIOINT1_IRQHandler,        /* 71 55 PIO_1  GPIO interrupt status of port 1 */
-  PIOINT0_IRQHandler,        /* 72 56 PIO_0  GPIO interrupt status of port 0 */
+  /* LPC17xx specific interrupts */
+     WDT_IRQHandler,              /* 16: Watchdog Timer               */
+     TIMER0_IRQHandler,           /* 17: Timer0                       */
+     TIMER1_IRQHandler,           /* 18: Timer1                       */
+     TIMER2_IRQHandler,           /* 19: Timer2                       */
+     TIMER3_IRQHandler,           /* 20: Timer3                       */
+     UART0_IRQHandler,            /* 21: UART0                        */
+     UART1_IRQHandler,            /* 22: UART1                        */
+     UART2_IRQHandler,            /* 23: UART2                        */
+     UART3_IRQHandler,            /* 24: UART3                        */
+     PWM1_IRQHandler,             /* 25: PWM1                         */
+     I2C0_IRQHandler,             /* 26: I2C0                         */
+     I2C1_IRQHandler,             /* 27: I2C1                         */
+     I2C2_IRQHandler,             /* 28: I2C2                         */
+     SPI_IRQHandler,              /* 29: SPI                          */
+     SSP0_IRQHandler,             /* 30: SSP0                         */
+     SSP1_IRQHandler,             /* 31: SSP1                         */
+     PLL0_IRQHandler,             /* 32: PLL0 Lock (Main PLL)         */
+     RTC_IRQHandler,              /* 33: Real Time Clock              */
+     EINT0_IRQHandler,            /* 34: External Interrupt 0         */
+     EINT1_IRQHandler,            /* 35: External Interrupt 1         */
+     EINT2_IRQHandler,            /* 36: External Interrupt 2         */
+     EINT3_IRQHandler,            /* 37: External Interrupt 3         */
+     ADC_IRQHandler,              /* 38: A/D Converter                */
+     BOD_IRQHandler,              /* 39: Brown-Out Detect             */
+     USB_IRQHandler,              /* 40: USB                          */
+     CAN_IRQHandler,              /* 41: CAN                          */
+     DMA_IRQHandler,              /* 42: General Purpose DMA          */
+     I2S_IRQHandler,              /* 43: I2S                          */
+     ENET_IRQHandler,             /* 44: Ethernet                     */
+     RIT_IRQHandler,              /* 45: Repetitive Interrupt Timer   */
+     MCPWM_IRQHandler,            /* 46: Motor Control PWM            */
+     QEI_IRQHandler,              /* 47: Quadrature Encoder Interface */
+     PLL1_IRQHandler,             /* 48: PLL1 Lock (USB PLL)          */
+     USBActivity_IRQHandler,		/* 49: USB Activity 				*/
+     CANActivity_IRQHandler,		/* 50: CAN Activity					*/
 };
 
 /*
@@ -221,21 +220,45 @@ void Default_Handler() {
 #pragma weak SysTick_Handler = Default_Handler            /* SysTick Handler */
 
 /* External interrupt vector handler */
-#pragma weak WAKEUP_IRQHandler = Default_Handler
-#pragma weak I2C_IRQHandler = Default_Handler
-#pragma weak TIMER16_0_IRQHandler = Default_Handler
-#pragma weak TIMER16_1_IRQHandler = Default_Handler
-#pragma weak TIMER32_0_IRQHandler = Default_Handler
-#pragma weak TIMER32_1_IRQHandler = Default_Handler
-#pragma weak SSP_IRQHandler = Default_Handler
-#pragma weak UART_IRQHandler = Default_Handler
-#pragma weak USB_IRQHandler = Default_Handler
-#pragma weak USB_FIQHandler = Default_Handler
-#pragma weak ADC_IRQHandler = Default_Handler
-#pragma weak WDT_IRQHandler = Default_Handler
-#pragma weak BOD_IRQHandler = Default_Handler
-#pragma weak FMC_IRQHandler = Default_Handler
-#pragma weak PIOINT3_IRQHandler = Default_Handler
-#pragma weak PIOINT2_IRQHandler = Default_Handler
-#pragma weak PIOINT1_IRQHandler = Default_Handler
-#pragma weak PIOINT0_IRQHandler = Default_Handler
+
+#pragma weak    WDT_IRQHandler = Default_Handler              /* 16: Watchdog Timer               */
+#pragma weak    TIMER0_IRQHandler = Default_Handler           /* 17: Timer0                       */
+#pragma weak    TIMER1_IRQHandler = Default_Handler           /* 18: Timer1                       */
+#pragma weak    TIMER2_IRQHandler = Default_Handler           /* 19: Timer2                       */
+#pragma weak    TIMER3_IRQHandler = Default_Handler           /* 20: Timer3                       */
+#pragma weak    UART0_IRQHandler = Default_Handler            /* 21: UART0                        */
+#pragma weak    UART1_IRQHandler = Default_Handler            /* 22: UART1                        */
+#pragma weak    UART2_IRQHandler = Default_Handler            /* 23: UART2                        */
+#pragma weak    UART3_IRQHandler = Default_Handler            /* 24: UART3                        */
+#pragma weak    PWM1_IRQHandler = Default_Handler             /* 25: PWM1                         */
+#pragma weak    I2C0_IRQHandler = Default_Handler             /* 26: I2C0                         */
+#pragma weak    I2C1_IRQHandler = Default_Handler             /* 27: I2C1                         */
+#pragma weak    I2C2_IRQHandler = Default_Handler             /* 28: I2C2                         */
+#pragma weak    SPI_IRQHandler = Default_Handler              /* 29: SPI                          */
+#pragma weak    SSP0_IRQHandler = Default_Handler             /* 30: SSP0                         */
+#pragma weak    SSP1_IRQHandler = Default_Handler             /* 31: SSP1                         */
+#pragma weak    PLL0_IRQHandler = Default_Handler             /* 32: PLL0 Lock (Main PLL)         */
+#pragma weak    RTC_IRQHandler = Default_Handler              /* 33: Real Time Clock              */
+#pragma weak    EINT0_IRQHandler = Default_Handler            /* 34: External Interrupt 0         */
+#pragma weak    EINT1_IRQHandler = Default_Handler            /* 35: External Interrupt 1         */
+#pragma weak    EINT2_IRQHandler = Default_Handler            /* 36: External Interrupt 2         */
+#pragma weak    EINT3_IRQHandler = Default_Handler            /* 37: External Interrupt 3         */
+#pragma weak    ADC_IRQHandler = Default_Handler              /* 38: A/D Converter                */
+#pragma weak    BOD_IRQHandler = Default_Handler              /* 39: Brown-Out Detect             */
+#pragma weak    USB_IRQHandler = Default_Handler              /* 40: USB                          */
+#pragma weak    CAN_IRQHandler = Default_Handler              /* 41: CAN                          */
+#pragma weak    DMA_IRQHandler = Default_Handler              /* 42: General Purpose DMA          */
+#pragma weak    I2S_IRQHandler = Default_Handler              /* 43: I2S                          */
+#pragma weak    ENET_IRQHandler = Default_Handler             /* 44: Ethernet                     */
+#pragma weak    RIT_IRQHandler = Default_Handler              /* 45: Repetitive Interrupt Timer   */
+#pragma weak    MCPWM_IRQHandler = Default_Handler            /* 46: Motor Control PWM            */
+#pragma weak    QEI_IRQHandler = Default_Handler              /* 47: Quadrature Encoder Interface */
+#pragma weak    PLL1_IRQHandler = Default_Handler             /* 48: PLL1 Lock (USB PLL)          */
+#pragma weak 	USBActivity_IRQHandler = Default_Handler		/* 49: USB Activity 				*/
+#pragma weak  	CANActivity_IRQHandler = Default_Handler		/* 50: CAN Activity					*/
+
+
+
+
+
+
-- 
1.7.3.4

