diff --git a/arch/avr/include/at90usb/irq.h b/arch/avr/include/at90usb/irq.h index 4c621309908..9bc59e156f2 100644 --- a/arch/avr/include/at90usb/irq.h +++ b/arch/avr/include/at90usb/irq.h @@ -94,6 +94,7 @@ #define AT90USB_IRQ_SPMRDY 36 /* 0x004a Store Program Memory Ready */ #define NR_IRQS 37 +#define XCPTCONTEXT_REGS 37 /* Size of the register state save array (in bytes) */ /**************************************************************************** * Public Types diff --git a/arch/avr/include/atmega/irq.h b/arch/avr/include/atmega/irq.h index 037a8d25426..d131e86bee1 100644 --- a/arch/avr/include/atmega/irq.h +++ b/arch/avr/include/atmega/irq.h @@ -56,6 +56,7 @@ */ #if defined(CONFIG_ARCH_CHIP_ATMEGA128) + # define ATMEGA_IRQ_INT0 0 /* 0x0002 External Interrupt Request 0 */ # define ATMEGA_IRQ_INT1 1 /* 0x0004 External Interrupt Request 1 */ # define ATMEGA_IRQ_INT2 2 /* 0x0006 External Interrupt Request 2 */ @@ -90,7 +91,13 @@ # define ATMEGA_IRQ_U1TX 31 /* 0x0040 USART1 Tx Complete */ # define ATMEGA_IRQ_TWI 32 /* 0x0042 TWI Two-wire Serial Interface */ # define ATMEGA_IRQ_SPMRDY 33 /* 0x0044 Store Program Memory Ready */ + +# define NR_IRQS 34 +# define ATMEGA_PC_SIZE 16 +# define XCPTCONTEXT_REGS 37 /* Size of the register state save array (in bytes) */ + #elif defined(CONFIG_ARCH_CHIP_ATMEGA1284P) + # define ATMEGA_IRQ_INT0 0 /* 0x0002 External Interrupt Request 0 */ # define ATMEGA_IRQ_INT1 1 /* 0x0004 External Interrupt Request 1 */ # define ATMEGA_IRQ_INT2 2 /* 0x0006 External Interrupt Request 2 */ @@ -125,12 +132,78 @@ # define ATMEGA_IRQ_T3COMPA 31 /* 0x0040 TIMER3 COMPA Timer/Counter3 Compare Match A */ # define ATMEGA_IRQ_T3COMPB 32 /* 0x0042 TIMER3 COMPB Timer/Counter3 Compare Match B */ # define ATMEGA_IRQ_T3OVF 33 /* 0x0044 TIMER3 OVF Timer/Counter3 Overflow */ + +# define NR_IRQS 34 +# define ATMEGA_PC_SIZE 16 +# define XCPTCONTEXT_REGS 37 /* Size of the register state save array (in bytes) */ + +#elif defined(CONFIG_ARCH_CHIP_ATMEGA2560) + +# define ATMEGA_IRQ_INT0 2 /* 0x0002 INT0 External Interrupt Request 0 */ +# define ATMEGA_IRQ_INT1 3 /* 0x0004 INT1 External Interrupt Request 1 */ +# define ATMEGA_IRQ_INT2 4 /* 0x0006 INT2 External Interrupt Request 2 */ +# define ATMEGA_IRQ_INT3 5 /* 0x0008 INT3 External Interrupt Request 3 */ +# define ATMEGA_IRQ_INT4 6 /* 0x000A INT4 External Interrupt Request 4 */ +# define ATMEGA_IRQ_INT5 7 /* 0x000C INT5 External Interrupt Request 5 */ +# define ATMEGA_IRQ_INT6 8 /* 0x000E INT6 External Interrupt Request 6 */ +# define ATMEGA_IRQ_INT7 9 /* 0x0010 INT7 External Interrupt Request 7 */ +# define ATMEGA_IRQ_PCINT0 10 /* 0x0012 PCINT0 Pin Change Interrupt Req 0 */ +# define ATMEGA_IRQ_PCINT1 11 /* 0x0014 PCINT1 Pin Change Interrupt Req 1 */ +# define ATMEGA_IRQ_PCINT2 12 /* 0x0016 PCINT2 Pin Change Interrupt Req 2 */ +# define ATMEGA_IRQ_WDT 13 /* 0x0018 WDT Watchdog Time-out Interrupt */ +# define ATMEGA_IRQ_TIM2_COMPA 14 /* 0x001A TIMER2 COMPA Timer/Counter2 Compare Match A */ +# define ATMEGA_IRQ_TIM2_COMPB 15 /* 0x001C TIMER2 COMPB Timer/Counter2 Compare Match B */ +# define ATMEGA_IRQ_TIM2_OVF 16 /* 0x001E TIMER2 OVF Timer/Counter2 Overflow */ +# define ATMEGA_IRQ_TIM1_CAPT 17 /* 0x0020 TIMER1 CAPT Timer/Counter1 Capture Event */ +# define ATMEGA_IRQ_TIM1_COMPA 18 /* 0x0022 TIMER1 COMPA Timer/Counter1 Compare Match A */ +# define ATMEGA_IRQ_TIM1_COMPB 19 /* 0x0024 TIMER1 COMPB Timer/Counter1 Compare Match B */ +# define ATMEGA_IRQ_TIM1_COMPC 20 /* 0x0026 TIMER1 COMPC Timer/Counter1 Compare Match C */ +# define ATMEGA_IRQ_TIM1_OVF 21 /* 0x0028 TIMER1 OVF Timer/Counter1 Overflow */ +# define ATMEGA_IRQ_TIM0_COMPA 22 /* 0x002A TIMER0 COMPA Timer/Counter0 Compare Match A */ +# define ATMEGA_IRQ_TIM0_COMPB 23 /* 0x002C TIMER0 COMPB Timer/Counter0 Compare match B */ +# define ATMEGA_IRQ_TIM0_OVF 24 /* 0x002E TIMER0 OVF Timer/Counter0 Overflow */ +# define ATMEGA_IRQ_SPI_STC 25 /* 0x0030 SPI, STC SPI Serial Transfer Complete */ +# define ATMEGA_IRQ_USART0_RXC 26 /* 0x0032 USART0 RX USART0 Rx Complete */ +# define ATMEGA_IRQ_USART0_UDRE 27 /* 0x0034 USART0 UDRE USART0 Data Register Empty */ +# define ATMEGA_IRQ_USART0_TXC 28 /* 0x0036 USART0 TX USART0 Tx Complete */ +# define ATMEGA_IRQ_ANA_COMP 29 /* 0x0038 ANALOG COMP Analog Comparator */ +# define ATMEGA_IRQ_ADC 30 /* 0x003A ADC ADC Conversion Complete */ +# define ATMEGA_IRQ_EE_RDY 31 /* 0x003C EE READY EEPROM Ready */ +# define ATMEGA_IRQ_TIM3_CAPT 32 /* 0x003E TIMER3 CAPT Timer/Counter3 Capture Event */ +# define ATMEGA_IRQ_TIM3_COMPA 33 /* 0x0040 TIMER3 COMPA Timer/Counter3 Compare Match A */ +# define ATMEGA_IRQ_TIM3_COMPB 34 /* 0x0042 TIMER3 COMPB Timer/Counter3 Compare Match B */ +# define ATMEGA_IRQ_TIM3_COMPC 35 /* 0x0044 TIMER3 COMPC Timer/Counter3 Compare Match C */ +# define ATMEGA_IRQ_TIM3_OVF 36 /* 0x0046 TIMER3 OVF Timer/Counter3 Overflow */ +# define ATMEGA_IRQ_USART1_RXC 37 /* 0x0048 USART1 RX USART1 Rx Complete */ +# define ATMEGA_IRQ_USART1_UDRE 38 /* 0x004A USART1 UDRE USART1 Data Register Empty */ +# define ATMEGA_IRQ_USART1_TXC 39 /* 0x004C USART1 TX USART1 Tx Complete */ +# define ATMEGA_IRQ_TWI 40 /* 0x004E TWI 2-wire Serial Interface */ +# define ATMEGA_IRQ_SPM_RDY 41 /* 0x0050 SPM READY Store Program Memory Ready */ +# define ATMEGA_IRQ_TIM4_CAPT 42 /* 0x0052 TIMER4 CAPT Timer/Counter4 Capture Event */ +# define ATMEGA_IRQ_TIM4_COMPA 43 /* 0x0054 TIMER4 COMPA Timer/Counter4 Compare Match A */ +# define ATMEGA_IRQ_TIM4_COMPB 44 /* 0x0056 TIMER4 COMPB Timer/Counter4 Compare Match B */ +# define ATMEGA_IRQ_TIM4_COMPC 45 /* 0x0058 TIMER4 COMPC Timer/Counter4 Compare Match C */ +# define ATMEGA_IRQ_TIM4_OVF 46 /* 0x005A TIMER4 OVF Timer/Counter4 Overflow */ +# define ATMEGA_IRQ_TIM5_CAPT 47 /* 0x005C TIMER5 CAPT Timer/Counter5 Capture Event */ +# define ATMEGA_IRQ_TIM5_COMPA 48 /* 0x005E TIMER5 COMPA Timer/Counter5 Compare Match A */ +# define ATMEGA_IRQ_TIM5_COMPB 49 /* 0x0060 TIMER5 COMPB Timer/Counter5 Compare Match B */ +# define ATMEGA_IRQ_TIM5_COMPC 50 /* 0x0062 TIMER5 COMPC Timer/Counter5 Compare Match C */ +# define ATMEGA_IRQ_TIM5_OVF 51 /* 0x0064 TIMER5 OVF Timer/Counter5 Overflow */ +# define ATMEGA_IRQ_USART2_RXC 52 /* 0x0066 USART2 RX USART2 Rx Complete */ +# define ATMEGA_IRQ_USART2_UDRE 53 /* 0x0068 USART2 UDRE USART2 Data Register Empty */ +# define ATMEGA_IRQ_USART2_TXC 54 /* 0x006A USART2 TX USART2 Tx Complete */ +# define ATMEGA_IRQ_USART3_RXC 55 /* 0x006C USART3 RX USART3 Rx Complete */ +# define ATMEGA_IRQ_USART3_UDRE 56 /* 0x006E USART3 UDRE USART3 Data Register Empty */ +# define ATMEGA_IRQ_USART3_TXC 57 /* 0x0070 USART3 TX USART3 Tx Complete */ + +# define NR_IRQS 58 +# define ATMEGA_PC_SIZE 24 +# define XCPTCONTEXT_REGS 38 /* Size of the register state save array (in bytes) */ + #else #error "Unrecognized chip" #endif -#define NR_IRQS 34 - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/arch/avr/include/avr/irq.h b/arch/avr/include/avr/irq.h index 954d1e6d34f..b946be3ef56 100644 --- a/arch/avr/include/avr/irq.h +++ b/arch/avr/include/avr/irq.h @@ -94,10 +94,6 @@ #define REG_PCH 35 /* PC */ #define REG_PCL 36 -/* Size of the register state save array (in bytes) */ - -#define XCPTCONTEXT_REGS 37 - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/arch/avr/src/atmega/Kconfig b/arch/avr/src/atmega/Kconfig index b2ec28f1777..b2c67025f16 100644 --- a/arch/avr/src/atmega/Kconfig +++ b/arch/avr/src/atmega/Kconfig @@ -20,6 +20,11 @@ config ARCH_CHIP_ATMEGA1284P ---help--- Atmel ATMega1284P 8-bit AVR. +config ARCH_CHIP_ATMEGA2560 + bool "ATMega2560" + ---help--- + Atmel ATMega2560 8-bit AVR. + endchoice # ATMega Configuration Options menu "ATMega Peripheral Selections" diff --git a/arch/avr/src/atmega/atmega_exceptions.S b/arch/avr/src/atmega/atmega_exceptions.S index 3290c371431..d8a37271a91 100755 --- a/arch/avr/src/atmega/atmega_exceptions.S +++ b/arch/avr/src/atmega/atmega_exceptions.S @@ -131,6 +131,63 @@ HANDLER atmega_t3compa, ATMEGA_IRQ_T3COMPA, excpt_common /* TIMER3 COMPA timer/counter3 compare match a */ HANDLER atmega_t3compb, ATMEGA_IRQ_T3COMPB, excpt_common /* TIMER3 COMPB timer/counter3 compare match b */ HANDLER atmega_t3ovf, ATMEGA_IRQ_T3OVF, excpt_common /* TIMER3 OVF timer/counter3 overflow */ +#elif defined(CONFIG_ARCH_CHIP_ATMEGA2560) + HANDLER atmega_int0, ATMEGA_IRQ_INT0, excpt_common /* 0x0002 INT0 External Interrupt Request 0 */ + HANDLER atmega_int1, ATMEGA_IRQ_INT1, excpt_common /* 0x0004 INT1 External Interrupt Request 1 */ + HANDLER atmega_int2, ATMEGA_IRQ_INT2, excpt_common /* 0x0006 INT2 External Interrupt Request 2 */ + HANDLER atmega_int3, ATMEGA_IRQ_INT3, excpt_common /* 0x0008 INT3 External Interrupt Request 3 */ + HANDLER atmega_int4, ATMEGA_IRQ_INT4, excpt_common /* 0x000A INT4 External Interrupt Request 4 */ + HANDLER atmega_int5, ATMEGA_IRQ_INT5, excpt_common /* 0x000C INT5 External Interrupt Request 5 */ + HANDLER atmega_int6, ATMEGA_IRQ_INT6, excpt_common /* 0x000E INT6 External Interrupt Request 6 */ + HANDLER atmega_int7, ATMEGA_IRQ_INT7, excpt_common /* 0x0010 INT7 External Interrupt Request 7 */ + HANDLER atmega_pcint0, ATMEGA_IRQ_PCINT0, excpt_common /* 0x0012 PCINT0 Pin Change Interrupt Req 0 */ + HANDLER atmega_pcint1, ATMEGA_IRQ_PCINT1, excpt_common /* 0x0014 PCINT1 Pin Change Interrupt Req 1 */ + HANDLER atmega_pcint2, ATMEGA_IRQ_PCINT2, excpt_common /* 0x0016 PCINT2 Pin Change Interrupt Req 2 */ + HANDLER atmega_wdt, ATMEGA_IRQ_WDT, excpt_common /* 0x0018 WDT Watchdog Time-out Interrupt */ + HANDLER atmega_tim2_compa, ATMEGA_IRQ_TIM2_COMPA, excpt_common /* 0x001A TIMER2 COMPA Timer/Counter2 Compare Match A */ + HANDLER atmega_tim2_compb, ATMEGA_IRQ_TIM2_COMPB, excpt_common /* 0x001C TIMER2 COMPB Timer/Counter2 Compare Match B */ + HANDLER atmega_tim2_ovf, ATMEGA_IRQ_TIM2_OVF, excpt_common /* 0x001E TIMER2 OVF Timer/Counter2 Overflow */ + HANDLER atmega_tim1_capt, ATMEGA_IRQ_TIM1_CAPT, excpt_common /* 0x0020 TIMER1 CAPT Timer/Counter1 Capture Event */ + HANDLER atmega_tim1_compa, ATMEGA_IRQ_TIM1_COMPA, excpt_common /* 0x0022 TIMER1 COMPA Timer/Counter1 Compare Match A */ + HANDLER atmega_tim1_compb, ATMEGA_IRQ_TIM1_COMPB, excpt_common /* 0x0024 TIMER1 COMPB Timer/Counter1 Compare Match B */ + HANDLER atmega_tim1_compc, ATMEGA_IRQ_TIM1_COMPC, excpt_common /* 0x0026 TIMER1 COMPC Timer/Counter1 Compare Match C */ + HANDLER atmega_tim1_ovf, ATMEGA_IRQ_TIM1_OVF, excpt_common /* 0x0028 TIMER1 OVF Timer/Counter1 Overflow */ + HANDLER atmega_tim0_compa, ATMEGA_IRQ_TIM0_COMPA, excpt_common /* 0x002A TIMER0 COMPA Timer/Counter0 Compare Match A */ + HANDLER atmega_tim0_compb, ATMEGA_IRQ_TIM0_COMPB, excpt_common /* 0x002C TIMER0 COMPB Timer/Counter0 Compare match B */ + HANDLER atmega_tim0_ovf, ATMEGA_IRQ_TIM0_OVF, excpt_common /* 0x002E TIMER0 OVF Timer/Counter0 Overflow */ + HANDLER atmega_spi_stc, ATMEGA_IRQ_SPI_STC, excpt_common /* 0x0030 SPI, STC SPI Serial Transfer Complete */ + HANDLER atmega_usart0_rxc, ATMEGA_IRQ_USART0_RXC, excpt_common /* 0x0032 USART0 RX USART0 Rx Complete */ + HANDLER atmega_usart0_udre, ATMEGA_IRQ_USART0_UDRE, excpt_common /* 0x0034 USART0 UDRE USART0 Data Register Empty */ + HANDLER atmega_usart0_txc, ATMEGA_IRQ_USART0_TXC, excpt_common /* 0x0036 USART0 TX USART0 Tx Complete */ + HANDLER atmega_ana_comp, ATMEGA_IRQ_ANA_COMP, excpt_common /* 0x0038 ANALOG COMP Analog Comparator */ + HANDLER atmega_adc, ATMEGA_IRQ_ADC, excpt_common /* 0x003A ADC ADC Conversion Complete */ + HANDLER atmega_ee_rdy, ATMEGA_IRQ_EE_RDY, excpt_common /* 0x003C EE READY EEPROM Ready */ + HANDLER atmega_tim3_capt, ATMEGA_IRQ_TIM3_CAPT, excpt_common /* 0x003E TIMER3 CAPT Timer/Counter3 Capture Event */ + HANDLER atmega_tim3_compa, ATMEGA_IRQ_TIM3_COMPA, excpt_common /* 0x0040 TIMER3 COMPA Timer/Counter3 Compare Match A */ + HANDLER atmega_tim3_compb, ATMEGA_IRQ_TIM3_COMPB, excpt_common /* 0x0042 TIMER3 COMPB Timer/Counter3 Compare Match B */ + HANDLER atmega_tim3_compc, ATMEGA_IRQ_TIM3_COMPC, excpt_common /* 0x0044 TIMER3 COMPC Timer/Counter3 Compare Match C */ + HANDLER atmega_tim3_ovf, ATMEGA_IRQ_TIM3_OVF, excpt_common /* 0x0046 TIMER3 OVF Timer/Counter3 Overflow */ + HANDLER atmega_usart1_rxc, ATMEGA_IRQ_USART1_RXC, excpt_common /* 0x0048 USART1 RX USART1 Rx Complete */ + HANDLER atmega_usart1_udre, ATMEGA_IRQ_USART1_UDRE, excpt_common /* 0x004A USART1 UDRE USART1 Data Register Empty */ + HANDLER atmega_usart1_txc, ATMEGA_IRQ_USART1_TXC, excpt_common /* 0x004C USART1 TX USART1 Tx Complete */ + HANDLER atmega_twi, ATMEGA_IRQ_TWI, excpt_common /* 0x004E TWI 2-wire Serial Interface */ + HANDLER atmega_spm_rdy, ATMEGA_IRQ_SPM_RDY, excpt_common /* 0x0050 SPM READY Store Program Memory Ready */ + HANDLER atmega_tim4_capt, ATMEGA_IRQ_TIM4_CAPT, excpt_common /* 0x0052 TIMER4 CAPT Timer/Counter4 Capture Event */ + HANDLER atmega_tim4_compa, ATMEGA_IRQ_TIM4_COMPA, excpt_common /* 0x0054 TIMER4 COMPA Timer/Counter4 Compare Match A */ + HANDLER atmega_tim4_compb, ATMEGA_IRQ_TIM4_COMPB, excpt_common /* 0x0056 TIMER4 COMPB Timer/Counter4 Compare Match B */ + HANDLER atmega_tim4_compc, ATMEGA_IRQ_TIM4_COMPC, excpt_common /* 0x0058 TIMER4 COMPC Timer/Counter4 Compare Match C */ + HANDLER atmega_tim4_ovf, ATMEGA_IRQ_TIM4_OVF, excpt_common /* 0x005A TIMER4 OVF Timer/Counter4 Overflow */ + HANDLER atmega_tim5_capt, ATMEGA_IRQ_TIM5_CAPT, excpt_common /* 0x005C TIMER5 CAPT Timer/Counter5 Capture Event */ + HANDLER atmega_tim5_compa, ATMEGA_IRQ_TIM5_COMPA, excpt_common /* 0x005E TIMER5 COMPA Timer/Counter5 Compare Match A */ + HANDLER atmega_tim5_compb, ATMEGA_IRQ_TIM5_COMPB, excpt_common /* 0x0060 TIMER5 COMPB Timer/Counter5 Compare Match B */ + HANDLER atmega_tim5_compc, ATMEGA_IRQ_TIM5_COMPC, excpt_common /* 0x0062 TIMER5 COMPC Timer/Counter5 Compare Match C */ + HANDLER atmega_tim5_ovf, ATMEGA_IRQ_TIM5_OVF, excpt_common /* 0x0064 TIMER5 OVF Timer/Counter5 Overflow */ + HANDLER atmega_usart2_rxc, ATMEGA_IRQ_USART2_RXC, excpt_common /* 0x0066 USART2 RX USART2 Rx Complete */ + HANDLER atmega_usart2_udre, ATMEGA_IRQ_USART2_UDRE, excpt_common /* 0x0068 USART2 UDRE USART2 Data Register Empty */ + HANDLER atmega_usart2_txc, ATMEGA_IRQ_USART2_TXC, excpt_common /* 0x006A USART2 TX USART2 Tx Complete */ + HANDLER atmega_usart3_rxc, ATMEGA_IRQ_USART3_RXC, excpt_common /* 0x006C USART3 RX USART3 Rx Complete */ + HANDLER atmega_usart3_udre, ATMEGA_IRQ_USART3_UDRE, excpt_common /* 0x006E USART3 UDRE USART3 Data Register Empty */ + HANDLER atmega_usart3_txc, ATMEGA_IRQ_USART3_TXC, excpt_common /* 0x0070 USART3 TX USART3 Tx Complete */ #else # error "Unrecognized chip" #endif diff --git a/arch/avr/src/atmega/atmega_head.S b/arch/avr/src/atmega/atmega_head.S index 8116f8c925d..e2bf17c9189 100755 --- a/arch/avr/src/atmega/atmega_head.S +++ b/arch/avr/src/atmega/atmega_head.S @@ -147,6 +147,63 @@ .global atmega_t3compa /* TIMER3 COMPA timer/counter3 compare match a */ .global atmega_t3compb /* TIMER3 COMPB timer/counter3 compare match b */ .global atmega_t3ovf /* TIMER3 OVF timer/counter3 overflow */ +#elif defined(CONFIG_ARCH_CHIP_ATMEGA2560) + .global atmega_int0 /* 0x0002 INT0 External Interrupt Request 0 */ + .global atmega_int1 /* 0x0004 INT1 External Interrupt Request 1 */ + .global atmega_int2 /* 0x0006 INT2 External Interrupt Request 2 */ + .global atmega_int3 /* 0x0008 INT3 External Interrupt Request 3 */ + .global atmega_int4 /* 0x000A INT4 External Interrupt Request 4 */ + .global atmega_int5 /* 0x000C INT5 External Interrupt Request 5 */ + .global atmega_int6 /* 0x000E INT6 External Interrupt Request 6 */ + .global atmega_int7 /* 0x0010 INT7 External Interrupt Request 7 */ + .global atmega_pcint0 /* 0x0012 PCINT0 Pin Change Interrupt Req 0 */ + .global atmega_pcint1 /* 0x0014 PCINT1 Pin Change Interrupt Req 1 */ + .global atmega_pcint2 /* 0x0016 PCINT2 Pin Change Interrupt Req 2 */ + .global atmega_wdt /* 0x0018 WDT Watchdog Time-out Interrupt */ + .global atmega_tim2_compa /* 0x001A TIMER2 COMPA Timer/Counter2 Compare Match A */ + .global atmega_tim2_compb /* 0x001C TIMER2 COMPB Timer/Counter2 Compare Match B */ + .global atmega_tim2_ovf /* 0x001E TIMER2 OVF Timer/Counter2 Overflow */ + .global atmega_tim1_capt /* 0x0020 TIMER1 CAPT Timer/Counter1 Capture Event */ + .global atmega_tim1_compa /* 0x0022 TIMER1 COMPA Timer/Counter1 Compare Match A */ + .global atmega_tim1_compb /* 0x0024 TIMER1 COMPB Timer/Counter1 Compare Match B */ + .global atmega_tim1_compc /* 0x0026 TIMER1 COMPC Timer/Counter1 Compare Match C */ + .global atmega_tim1_ovf /* 0x0028 TIMER1 OVF Timer/Counter1 Overflow */ + .global atmega_tim0_compa /* 0x002A TIMER0 COMPA Timer/Counter0 Compare Match A */ + .global atmega_tim0_compb /* 0x002C TIMER0 COMPB Timer/Counter0 Compare match B */ + .global atmega_tim0_ovf /* 0x002E TIMER0 OVF Timer/Counter0 Overflow */ + .global atmega_spi_stc /* 0x0030 SPI, STC SPI Serial Transfer Complete */ + .global atmega_usart0_rxc /* 0x0032 USART0 RX USART0 Rx Complete */ + .global atmega_usart0_udre /* 0x0034 USART0 UDRE USART0 Data Register Empty */ + .global atmega_usart0_txc /* 0x0036 USART0 TX USART0 Tx Complete */ + .global atmega_ana_comp /* 0x0038 ANALOG COMP Analog Comparator */ + .global atmega_adc /* 0x003A ADC ADC Conversion Complete */ + .global atmega_ee_rdy /* 0x003C EE READY EEPROM Ready */ + .global atmega_tim3_capt /* 0x003E TIMER3 CAPT Timer/Counter3 Capture Event */ + .global atmega_tim3_compa /* 0x0040 TIMER3 COMPA Timer/Counter3 Compare Match A */ + .global atmega_tim3_compb /* 0x0042 TIMER3 COMPB Timer/Counter3 Compare Match B */ + .global atmega_tim3_compc /* 0x0044 TIMER3 COMPC Timer/Counter3 Compare Match C */ + .global atmega_tim3_ovf /* 0x0046 TIMER3 OVF Timer/Counter3 Overflow */ + .global atmega_usart1_rxc /* 0x0048 USART1 RX USART1 Rx Complete */ + .global atmega_usart1_udre /* 0x004A USART1 UDRE USART1 Data Register Empty */ + .global atmega_usart1_txc /* 0x004C USART1 TX USART1 Tx Complete */ + .global atmega_twi /* 0x004E TWI 2-wire Serial Interface */ + .global atmega_spm_rdy /* 0x0050 SPM READY Store Program Memory Ready */ + .global atmega_tim4_capt /* 0x0052 TIMER4 CAPT Timer/Counter4 Capture Event */ + .global atmega_tim4_compa /* 0x0054 TIMER4 COMPA Timer/Counter4 Compare Match A */ + .global atmega_tim4_compb /* 0x0056 TIMER4 COMPB Timer/Counter4 Compare Match B */ + .global atmega_tim4_compc /* 0x0058 TIMER4 COMPC Timer/Counter4 Compare Match C */ + .global atmega_tim4_ovf /* 0x005A TIMER4 OVF Timer/Counter4 Overflow */ + .global atmega_tim5_capt /* 0x005C TIMER5 CAPT Timer/Counter5 Capture Event */ + .global atmega_tim5_compa /* 0x005E TIMER5 COMPA Timer/Counter5 Compare Match A */ + .global atmega_tim5_compb /* 0x0060 TIMER5 COMPB Timer/Counter5 Compare Match B */ + .global atmega_tim5_compc /* 0x0062 TIMER5 COMPC Timer/Counter5 Compare Match C */ + .global atmega_tim5_ovf /* 0x0064 TIMER5 OVF Timer/Counter5 Overflow */ + .global atmega_usart2_rxc /* 0x0066 USART2 RX USART2 Rx Complete */ + .global atmega_usart2_udre /* 0x0068 USART2 UDRE USART2 Data Register Empty */ + .global atmega_usart2_txc /* 0x006A USART2 TX USART2 Tx Complete */ + .global atmega_usart3_rxc /* 0x006C USART3 RX USART3 Rx Complete */ + .global atmega_usart3_udre /* 0x006E USART3 UDRE USART3 Data Register Empty */ + .global atmega_usart3_txc /* 0x0070 USART3 TX USART3 Tx Complete */ #else #error "Unrecognized chip" #endif @@ -241,6 +298,63 @@ vectortab: vector atmega_t3compa /* TIMER3 COMPA timer/counter3 compare match a */ vector atmega_t3compb /* TIMER3 COMPB timer/counter3 compare match b */ vector atmega_t3ovf /* TIMER3 OVF timer/counter3 overflow */ +#elif defined(CONFIG_ARCH_CHIP_ATMEGA2560) + vector atmega_int0 /* 0x0002 INT0 External Interrupt Request 0 */ + vector atmega_int1 /* 0x0004 INT1 External Interrupt Request 1 */ + vector atmega_int2 /* 0x0006 INT2 External Interrupt Request 2 */ + vector atmega_int3 /* 0x0008 INT3 External Interrupt Request 3 */ + vector atmega_int4 /* 0x000A INT4 External Interrupt Request 4 */ + vector atmega_int5 /* 0x000C INT5 External Interrupt Request 5 */ + vector atmega_int6 /* 0x000E INT6 External Interrupt Request 6 */ + vector atmega_int7 /* 0x0010 INT7 External Interrupt Request 7 */ + vector atmega_pcint0 /* 0x0012 PCINT0 Pin Change Interrupt Req 0 */ + vector atmega_pcint1 /* 0x0014 PCINT1 Pin Change Interrupt Req 1 */ + vector atmega_pcint2 /* 0x0016 PCINT2 Pin Change Interrupt Req 2 */ + vector atmega_wdt /* 0x0018 WDT Watchdog Time-out Interrupt */ + vector atmega_tim2_compa /* 0x001A TIMER2 COMPA Timer/Counter2 Compare Match A */ + vector atmega_tim2_compb /* 0x001C TIMER2 COMPB Timer/Counter2 Compare Match B */ + vector atmega_tim2_ovf /* 0x001E TIMER2 OVF Timer/Counter2 Overflow */ + vector atmega_tim1_capt /* 0x0020 TIMER1 CAPT Timer/Counter1 Capture Event */ + vector atmega_tim1_compa /* 0x0022 TIMER1 COMPA Timer/Counter1 Compare Match A */ + vector atmega_tim1_compb /* 0x0024 TIMER1 COMPB Timer/Counter1 Compare Match B */ + vector atmega_tim1_compc /* 0x0026 TIMER1 COMPC Timer/Counter1 Compare Match C */ + vector atmega_tim1_ovf /* 0x0028 TIMER1 OVF Timer/Counter1 Overflow */ + vector atmega_tim0_compa /* 0x002A TIMER0 COMPA Timer/Counter0 Compare Match A */ + vector atmega_tim0_compb /* 0x002C TIMER0 COMPB Timer/Counter0 Compare match B */ + vector atmega_tim0_ovf /* 0x002E TIMER0 OVF Timer/Counter0 Overflow */ + vector atmega_spi_stc /* 0x0030 SPI, STC SPI Serial Transfer Complete */ + vector atmega_usart0_rxc /* 0x0032 USART0 RX USART0 Rx Complete */ + vector atmega_usart0_udre /* 0x0034 USART0 UDRE USART0 Data Register Empty */ + vector atmega_usart0_txc /* 0x0036 USART0 TX USART0 Tx Complete */ + vector atmega_ana_comp /* 0x0038 ANALOG COMP Analog Comparator */ + vector atmega_adc /* 0x003A ADC ADC Conversion Complete */ + vector atmega_ee_rdy /* 0x003C EE READY EEPROM Ready */ + vector atmega_tim3_capt /* 0x003E TIMER3 CAPT Timer/Counter3 Capture Event */ + vector atmega_tim3_compa /* 0x0040 TIMER3 COMPA Timer/Counter3 Compare Match A */ + vector atmega_tim3_compb /* 0x0042 TIMER3 COMPB Timer/Counter3 Compare Match B */ + vector atmega_tim3_compc /* 0x0044 TIMER3 COMPC Timer/Counter3 Compare Match C */ + vector atmega_tim3_ovf /* 0x0046 TIMER3 OVF Timer/Counter3 Overflow */ + vector atmega_usart1_rxc /* 0x0048 USART1 RX USART1 Rx Complete */ + vector atmega_usart1_udre /* 0x004A USART1 UDRE USART1 Data Register Empty */ + vector atmega_usart1_txc /* 0x004C USART1 TX USART1 Tx Complete */ + vector atmega_twi /* 0x004E TWI 2-wire Serial Interface */ + vector atmega_spm_rdy /* 0x0050 SPM READY Store Program Memory Ready */ + vector atmega_tim4_capt /* 0x0052 TIMER4 CAPT Timer/Counter4 Capture Event */ + vector atmega_tim4_compa /* 0x0054 TIMER4 COMPA Timer/Counter4 Compare Match A */ + vector atmega_tim4_compb /* 0x0056 TIMER4 COMPB Timer/Counter4 Compare Match B */ + vector atmega_tim4_compc /* 0x0058 TIMER4 COMPC Timer/Counter4 Compare Match C */ + vector atmega_tim4_ovf /* 0x005A TIMER4 OVF Timer/Counter4 Overflow */ + vector atmega_tim5_capt /* 0x005C TIMER5 CAPT Timer/Counter5 Capture Event */ + vector atmega_tim5_compa /* 0x005E TIMER5 COMPA Timer/Counter5 Compare Match A */ + vector atmega_tim5_compb /* 0x0060 TIMER5 COMPB Timer/Counter5 Compare Match B */ + vector atmega_tim5_compc /* 0x0062 TIMER5 COMPC Timer/Counter5 Compare Match C */ + vector atmega_tim5_ovf /* 0x0064 TIMER5 OVF Timer/Counter5 Overflow */ + vector atmega_usart2_rxc /* 0x0066 USART2 RX USART2 Rx Complete */ + vector atmega_usart2_udre /* 0x0068 USART2 UDRE USART2 Data Register Empty */ + vector atmega_usart2_txc /* 0x006A USART2 TX USART2 Tx Complete */ + vector atmega_usart3_rxc /* 0x006C USART3 RX USART3 Rx Complete */ + vector atmega_usart3_udre /* 0x006E USART3 UDRE USART3 Data Register Empty */ + vector atmega_usart3_txc /* 0x0070 USART3 TX USART3 Tx Complete */ #else #error "Unrecognized chip" #endif diff --git a/arch/avr/src/avr/Toolchain.defs b/arch/avr/src/avr/Toolchain.defs index 138cc125436..363013e64d4 100644 --- a/arch/avr/src/avr/Toolchain.defs +++ b/arch/avr/src/avr/Toolchain.defs @@ -80,6 +80,8 @@ else ifeq ($(CONFIG_ARCH_CHIP_AT90USB1286),y) ARCHCPUFLAGS += -mmcu=at90usb1286 else ifeq ($(CONFIG_ARCH_CHIP_AT90USB1287),y) ARCHCPUFLAGS += -mmcu=at90usb1287 +else ifeq ($(CONFIG_ARCH_CHIP_ATMEGA2560),y) + ARCHCPUFLAGS += -mmcu=atmega2560 else $(error "No valid CONFIG_ARCH_CHIP_ set in the configuration") endif