diff --git a/arch/arm/src/common/up_vectoraddrexcptn.S b/arch/arm/src/common/up_vectoraddrexcptn.S new file mode 100644 index 0000000000..09d7afc93e --- /dev/null +++ b/arch/arm/src/common/up_vectoraddrexcptn.S @@ -0,0 +1,83 @@ +/************************************************************************************ + * arch/arm/src/common/up_vectoraddrexceptn.S + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include +#include +#include "up_arch.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Global Data + ************************************************************************************/ + +/************************************************************************************ + * Assembly Macros + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + + .text + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + + .text + +/************************************************************************************ + * Name: up_vectoraddrexcption + * + * Description: + * Shouldn't happen. This exception handler is in a separate file from other + * vector handlers because some processors (e.g., lpc2148) do not support the + * the Address Exception vector. + * + ************************************************************************************/ + + .globl up_vectoraddrexcptn + .type up_vectoraddrexcptn, %function +up_vectoraddrexcptn: + b up_vectoraddrexcptn + .size up_vectoaddrexcptn, . - up_vectoraddrexcptn + .end diff --git a/arch/arm/src/common/up_vectors.S b/arch/arm/src/common/up_vectors.S index 44566b917a..ca8e12cf8d 100644 --- a/arch/arm/src/common/up_vectors.S +++ b/arch/arm/src/common/up_vectors.S @@ -1,7 +1,7 @@ -/******************************************************************** - * common/up_vectors.S +/************************************************************************************ + * arm/src/common/up_vectors.S * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,23 +31,23 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ********************************************************************/ + ************************************************************************************/ -/******************************************************************** +/************************************************************************************ * Included Files - ********************************************************************/ + ************************************************************************************/ #include #include #include "up_arch.h" -/******************************************************************** +/************************************************************************************ * Definitions - ********************************************************************/ + ************************************************************************************/ -/******************************************************************** +/************************************************************************************ * Global Data - ********************************************************************/ + ************************************************************************************/ .data g_irqtmp: @@ -60,29 +60,29 @@ g_aborttmp: .word 0 /* Saved lr */ .word 0 /* Saved spsr */ -/******************************************************************** +/************************************************************************************ * Assembly Macros - ********************************************************************/ + ************************************************************************************/ -/******************************************************************** +/************************************************************************************ * Private Functions - ********************************************************************/ + ************************************************************************************/ .text -/******************************************************************** +/************************************************************************************ * Public Functions - ********************************************************************/ + ************************************************************************************/ .text -/******************************************************************** +/************************************************************************************ * Name: up_vectorirq * * Description: * Interrupt excetpion. Entered in IRQ mode with spsr = SVC * CPSR, lr = SVC PC - ********************************************************************/ + ************************************************************************************/ .globl up_vectorirq .type up_vectorirq, %function @@ -142,12 +142,12 @@ up_vectorirq: .align 5 -/******************************************************************** +/************************************************************************************ * Function: up_vectorswi * * Description: * SWI interrupt. We enter the SWI in SVC mode - ********************************************************************/ + ************************************************************************************/ .globl up_vectorswi .type up_vectorswi, %function @@ -188,7 +188,7 @@ up_vectorswi: .align 5 -/******************************************************************** +/************************************************************************************ * Name: up_vectordata * * Description: @@ -196,7 +196,7 @@ up_vectorswi: * abort handler. This function is entered in ABORT mode * with spsr = SVC CPSR, lr = SVC PC * - ********************************************************************/ + ************************************************************************************/ .globl up_vectordata .type up_vectordata, %function @@ -257,13 +257,13 @@ up_vectordata: .align 5 -/******************************************************************** +/************************************************************************************ * Name: up_vectorprefetch * * Description: * Prefetch abort exception. Entered in ABT mode with * spsr = SVC CPSR, lr = SVC PC - ********************************************************************/ + ************************************************************************************/ .globl up_vectorprefetch .type up_vectorprefetch, %function @@ -324,14 +324,14 @@ up_vectorprefetch: .align 5 -/******************************************************************** +/************************************************************************************ * Name: up_vectorundefinsn * * Description: * Undefined instruction entry exception. Entered in * UND mode, spsr = SVC CPSR, lr = SVC PC * - ********************************************************************/ + ************************************************************************************/ .globl up_vectorundefinsn .type up_vectorundefinsn, %function @@ -391,12 +391,12 @@ up_vectorundefinsn: .align 5 -/******************************************************************** +/************************************************************************************ * Name: up_vectorfiq * * Description: * Shouldn't happen - ********************************************************************/ + ************************************************************************************/ .globl up_vectorfiq .type up_vectorfiq, %function @@ -405,18 +405,3 @@ up_vectorfiq: .size up_vectofiq, . - up_vectorfiq .align 5 - -/******************************************************************** - * Name: up_vectoraddrexcption - * - * Description: - * Shouldn't happen - * - ********************************************************************/ - - .globl up_vectoraddrexcptn - .type up_vectoraddrexcptn, %function -up_vectoraddrexcptn: - b up_vectoraddrexcptn - .size up_vectoaddrexcptn, . - up_vectoraddrexcptn - .end diff --git a/arch/arm/src/dm320/Make.defs b/arch/arm/src/dm320/Make.defs index 09a86be282..4875e01bb8 100644 --- a/arch/arm/src/dm320/Make.defs +++ b/arch/arm/src/dm320/Make.defs @@ -36,7 +36,7 @@ HEAD_ASRC = up_head.S CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S \ - up_vectors.S up_vectortab.S + up_vectors.S up_vectoraddrexcptn.S up_vectortab.S CMN_CSRCS = up_assert.c up_blocktask.c up_copystate.c up_createstack.c \ up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c \ up_initialize.c up_initialstate.c up_interruptcontext.c \ diff --git a/arch/arm/src/lpc214x/Make.defs b/arch/arm/src/lpc214x/Make.defs index 1211e3c122..40b0c44300 100644 --- a/arch/arm/src/lpc214x/Make.defs +++ b/arch/arm/src/lpc214x/Make.defs @@ -1,7 +1,7 @@ -############################################################################ +############################################################################## # lpc214x/Make.defs # -# Copyright (C) 2007 Gregory Nutt. All rights reserved. +# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. -# 3. Neither the name Gregory Nutt nor the names of its contributors may be +# 3. Neither the name NuttX nor the names of its contributors may be # used to endorse or promote products derived from this software # without specific prior written permission. # @@ -31,7 +31,7 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -############################################################################ +############################################################################## HEAD_ASRC = lpc214x_head.S diff --git a/arch/arm/src/lpc214x/chip.h b/arch/arm/src/lpc214x/chip.h index 56089cf1d3..d237b39ccb 100644 --- a/arch/arm/src/lpc214x/chip.h +++ b/arch/arm/src/lpc214x/chip.h @@ -1,7 +1,7 @@ /**************************************************************************************************** - * lpc214x/chip.h + * arch/arm/src/lpc214x/chip.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/arch/arm/src/lpc214x/lpc214x_decodeirq.c b/arch/arm/src/lpc214x/lpc214x_decodeirq.c index 88fc06499e..6ee78e68c1 100644 --- a/arch/arm/src/lpc214x/lpc214x_decodeirq.c +++ b/arch/arm/src/lpc214x/lpc214x_decodeirq.c @@ -1,7 +1,7 @@ /******************************************************************************** - * lpc214x/lpc214x_decodeirq.c + * arch/arm/src/lpc214x/lpc214x_decodeirq.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/arch/arm/src/lpc214x/lpc214x_head.S b/arch/arm/src/lpc214x/lpc214x_head.S index 8bae66ef27..15939a3ad1 100644 --- a/arch/arm/src/lpc214x/lpc214x_head.S +++ b/arch/arm/src/lpc214x/lpc214x_head.S @@ -1,7 +1,7 @@ -/******************************************************************** - * lpc214x/lpc214x_head.S +/***************************************************************************** + * arch/arm/src/lpc214x/lpc214x_head.S * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,19 +31,19 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ********************************************************************/ + *****************************************************************************/ -/******************************************************************** +/***************************************************************************** * Included Files - ********************************************************************/ + *****************************************************************************/ #include #include "up_internal.h" #include "up_arch.h" -/******************************************************************** +/***************************************************************************** * Definitions - ********************************************************************/ + *****************************************************************************/ /* This file holds the NuttX start logic that runs when the LPC2148 * is reset. This logic must be located at address 0x0000:0000 in @@ -199,9 +199,9 @@ # define CONFIG_PINSEL2_VALUE 0x0e6149e4 #endif -/******************************************************************** +/***************************************************************************** * Macros - ********************************************************************/ + *****************************************************************************/ /* Print a character on the UART to show boot status. This macro will * modify r0, r1, r2 and r14 @@ -332,13 +332,13 @@ #endif .endm -/******************************************************************** +/***************************************************************************** * Text - ********************************************************************/ + *****************************************************************************/ .text -/******************************************************************** +/***************************************************************************** * Name: _vector_table * * Description: @@ -347,7 +347,7 @@ * the vector table is the reset vector and this is the code that * will execute whn the processor is reset. * - ********************************************************************/ + *****************************************************************************/ .globl _vector_table .type _vector_table, %function @@ -357,7 +357,7 @@ _vector_table: ldr pc, .Lswihandler /* 0x08: Software interrupt */ ldr pc, .Lprefetchaborthandler /* 0x0c: Prefetch abort */ ldr pc, .Ldataaborthandler /* 0x10: Data abort */ - ldr pc, .Laddrexcptnhandler /* 0x14: Address exception */ + .long 0 /* 0x14: Vector checksum */ ldr pc, .Lirqhandler /* 0x18: IRQ */ ldr pc, .Lfiqhandler /* 0x1c: FIQ */ @@ -366,7 +366,6 @@ _vector_table: .globl up_vectorswi .globl up_vectorprefetch .globl up_vectordata - .globl up_vectoraddrexcptn .globl up_vectorirq .globl up_vectorfiq @@ -380,15 +379,13 @@ _vector_table: .long up_vectorprefetch .Ldataaborthandler: .long up_vectordata -.Laddrexcptnhandler: - .long up_vectoraddrexcptn .Lirqhandler: .long up_vectorirq .Lfiqhandler: .long up_vectorfiq .size _vector_table, . - _vector_table -/******************************************************************** +/***************************************************************************** * Name: __start * * Description: @@ -396,7 +393,7 @@ _vector_table: * the processor is reset. It initializes hardware and then gives * control to NuttX. * - ********************************************************************/ + *****************************************************************************/ .global __start .type __start, #function diff --git a/arch/arm/src/lpc214x/lpc214x_irq.c b/arch/arm/src/lpc214x/lpc214x_irq.c index 37609a6dd4..96a40b0e2a 100644 --- a/arch/arm/src/lpc214x/lpc214x_irq.c +++ b/arch/arm/src/lpc214x/lpc214x_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** - * lpc214x/lpc214x_irq.c + * arch/arm/src/lpc214x/lpc214x_irq.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/arch/arm/src/lpc214x/lpc214x_lowputc.S b/arch/arm/src/lpc214x/lpc214x_lowputc.S index 5e74e4a4b7..23258fce9c 100644 --- a/arch/arm/src/lpc214x/lpc214x_lowputc.S +++ b/arch/arm/src/lpc214x/lpc214x_lowputc.S @@ -1,5 +1,5 @@ /************************************************************************** - * lpc214x/lpc214X_lowputc.S + * arch/arm/src/lpc214x/lpc214X_lowputc.S * * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/arch/arm/src/lpc214x/lpc214x_timer.h b/arch/arm/src/lpc214x/lpc214x_timer.h index f9cb91c5fb..47adf97967 100644 --- a/arch/arm/src/lpc214x/lpc214x_timer.h +++ b/arch/arm/src/lpc214x/lpc214x_timer.h @@ -1,7 +1,7 @@ /************************************************************************************ - * lpc214x/lpc214x_timer.h + * arch/arm/src/lpc214x/lpc214x_timer.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/arch/arm/src/lpc214x/lpc214x_timerisr.c b/arch/arm/src/lpc214x/lpc214x_timerisr.c index 8308200ba3..618e9b15d0 100644 --- a/arch/arm/src/lpc214x/lpc214x_timerisr.c +++ b/arch/arm/src/lpc214x/lpc214x_timerisr.c @@ -1,7 +1,7 @@ -/************************************************************ - * lpc214x/lpc214x_timerisr.c +/**************************************************************************** + * arch/arm/src/lpc214x/lpc214x_timerisr.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include #include @@ -50,9 +50,9 @@ #include "lpc214x_timer.h" #include "lpc214x_vic.h" -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ #define PCLKFREQ (LPC214X_FOSC/4) /* PCLK must be FOSC/4 */ @@ -64,26 +64,26 @@ #define tmr_putreg16(o,v) putreg16((v), LPC214X_TMR0_BASE+(o)) #define tmr_putreg32(o,v) putreg32((v), LPC214X_TMR0_BASE+(o)) -/************************************************************ +/**************************************************************************** * Private Types - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Global Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Function: up_timerisr * * Description: * The timer ISR will perform a variety of services for * various portions of the systems. * - ************************************************************/ + ****************************************************************************/ #ifdef CONFIG_VECTORED_INTERRUPTS int up_timerisr(uint32 *regs) @@ -107,14 +107,14 @@ int up_timerisr(int irq, uint32 *regs) return 0; } -/************************************************************ +/**************************************************************************** * Function: up_timerinit * * Description: * This function is called during start-up to initialize * the timer interrupt. * - ************************************************************/ + ****************************************************************************/ void up_timerinit(void) { diff --git a/arch/arm/src/lpc214x/lpc214x_uart.h b/arch/arm/src/lpc214x/lpc214x_uart.h index 7e1533abe6..e87c7cb288 100755 --- a/arch/arm/src/lpc214x/lpc214x_uart.h +++ b/arch/arm/src/lpc214x/lpc214x_uart.h @@ -1,7 +1,7 @@ /************************************************************************************ - * lpc214x/uart.h + * arch/arm/src/lpc214x/uart.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/arch/arm/src/lpc214x/lpc214x_vic.h b/arch/arm/src/lpc214x/lpc214x_vic.h index 7fecd9a317..912019e280 100755 --- a/arch/arm/src/lpc214x/lpc214x_vic.h +++ b/arch/arm/src/lpc214x/lpc214x_vic.h @@ -1,7 +1,7 @@ /************************************************************************************ - * lpc214x/lpc214x_vic.h + * arch/arm/src/lpc214x/lpc214x_vic.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/configs/mcu123-lpc214x/Make.defs b/configs/mcu123-lpc214x/Make.defs index 70c1d8cc5e..c0124cba03 100644 --- a/configs/mcu123-lpc214x/Make.defs +++ b/configs/mcu123-lpc214x/Make.defs @@ -1,4 +1,4 @@ -############################################################################ +############################################################################## # configs/mcu123-lpc214x/Make.defs # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. @@ -14,7 +14,7 @@ # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. -# 3. Neither the name Gregory NuttX nor the names of its contributors may be +# 3. Neither the name NuttX nor the names of its contributors may be # used to endorse or promote products derived from this software # without specific prior written permission. # @@ -31,7 +31,7 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # -############################################################################ +############################################################################## include ${TOPDIR}/.config diff --git a/configs/mcu123-lpc214x/defconfig b/configs/mcu123-lpc214x/defconfig index ede614e1b0..1229ec525a 100644 --- a/configs/mcu123-lpc214x/defconfig +++ b/configs/mcu123-lpc214x/defconfig @@ -58,7 +58,7 @@ CONFIG_ARCH_LPC2148=y CONFIG_ARCH_BOARD=mcu123-lpc214x CONFIG_ARCH_BOARD_MCU123=y CONFIG_BOARD_LOOPSPERMSEC=1250 -CONFIG_ARCH_LEDS=n +CONFIG_ARCH_LEDS=y CONFIG_DRAM_SIZE=0x02000000 CONFIG_DRAM_START=0x40000000 CONFIG_DRAM_END=(CONFIG_DRAM_START+CONFIG_DRAM_SIZE) @@ -100,8 +100,8 @@ CONFIG_UART0_TXBUFSIZE=256 CONFIG_UART1_TXBUFSIZE=256 CONFIG_UART0_RXBUFSIZE=256 CONFIG_UART1_RXBUFSIZE=256 -CONFIG_UART0_BAUD=115200 -CONFIG_UART1_BAUD=115200 +CONFIG_UART0_BAUD=38400 +CONFIG_UART1_BAUD=38400 CONFIG_UART0_BITS=8 CONFIG_UART1_BITS=8 CONFIG_UART0_PARITY=0 diff --git a/configs/mcu123-lpc214x/include/board.h b/configs/mcu123-lpc214x/include/board.h index c6fb20e9aa..e9821b7336 100644 --- a/configs/mcu123-lpc214x/include/board.h +++ b/configs/mcu123-lpc214x/include/board.h @@ -1,7 +1,7 @@ -/************************************************************ - * board/board.h +/**************************************************************************** + * configs/mcu123-lpc214x/include/board.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,24 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ #ifndef __ARCH_BOARD_BOARD_H #define __ARCH_BOARD_BOARD_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ # include #endif -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************/ +/* Clocking *****************************************************************/ #define LPC214X_FOSC 12000000 #define LPC214X_PLL_M 5 @@ -68,10 +68,19 @@ #define LPC214X_PLL_FEED1 0xaa #define LPC214X_PLL_FEED2 0x55 -/* LED definitions ******************************************/ +/* LED definitions **********************************************************/ -/************************************************************ +#define LED_STARTED 0 +#define LED_HEAPALLOCATE 1 +#define LED_IRQSENABLED 2 +#define LED_STACKCREATED 3 +#define LED_INIRQ 4 +#define LED_SIGNAL 5 +#define LED_ASSERTION 6 +#define LED_PANIC 7 + +/**************************************************************************** * Inline Functions - ************************************************************/ + ****************************************************************************/ #endif /* __ARCH_BOARD_BOARD_H */ diff --git a/configs/mcu123-lpc214x/ld.script b/configs/mcu123-lpc214x/ld.script index 774f174201..80138e3b3a 100644 --- a/configs/mcu123-lpc214x/ld.script +++ b/configs/mcu123-lpc214x/ld.script @@ -1,7 +1,7 @@ -/************************************************************ - * ld.script +/**************************************************************************** + * configs/mcu123-lpc214x/ld.script * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ OUTPUT_ARCH(arm) ENTRY(_stext) diff --git a/configs/mcu123-lpc214x/lpc21isp.sh b/configs/mcu123-lpc214x/lpc21isp.sh new file mode 100755 index 0000000000..1355a55a56 --- /dev/null +++ b/configs/mcu123-lpc214x/lpc21isp.sh @@ -0,0 +1,66 @@ +#!/bin/sh +############################################################################# +# configs/mcu123-lpc214x/lpc21isp.sh +# +# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################# +#set -x + +# The path to the built lpc21isp binary + +lpc21isp=../lpc2148/lpc21isp/lpc21isp + +# lpc21ips options + +#options="-debug -control -verify" +options="-control -verify" + +# The path to the NuttX Intel Hex format binary + +hxfile=nuttx.ihx + +# The TTY to use for the download + +tty=/dev/ttyS0 + +# The BAUD rate supported by the lpc214x board + +baud=38400 + +# The LPC214X crystal frequency in KHz + +osckhz=12000 + +# Do it! + +sudo $lpc21isp $options $hxfile $tty $baud $osckhz + diff --git a/configs/mcu123-lpc214x/src/up_leds.c b/configs/mcu123-lpc214x/src/up_leds.c index e6744c5475..8c465a055a 100644 --- a/configs/mcu123-lpc214x/src/up_leds.c +++ b/configs/mcu123-lpc214x/src/up_leds.c @@ -1,7 +1,7 @@ -/************************************************************ - * board/up_leds.c +/**************************************************************************** + * configs/mcu123-lpc214x/src/up_leds.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,54 +31,72 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include #include + +#include "chip.h" +#include "up_arch.h" #include "up_internal.h" -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/* P1.16-P1.23 control LEDS 1-8 */ + +#define LEDBIT(led) (0x00010000 << (led)) +#define ALLLEDS (0x00ff0000) + +#define putled(v,r) putreg32((v),(LPC214X_GPIO1_BASE+(r))) +#define CLRLEDS putled(ALLLEDS,LPC214X_GPIO_SET_OFFSET) + +/**************************************************************************** * Private Data - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Private Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Public Funtions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Name: up_ledinit - ************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_LEDS void up_ledinit(void) { + /* Initilize GIOs P1.16-P1.23 */ + + putled(ALLLEDS,LPC214X_GPIO_DIR_OFFSET); + putled(ALLLEDS,LPC214X_GPIO_SET_OFFSET); + putled(LEDBIT(0),LPC214X_GPIO_CLR_OFFSET); } -/************************************************************ +/**************************************************************************** * Name: up_ledon - ************************************************************/ + ****************************************************************************/ void up_ledon(int led) { + putled(LEDBIT(led),LPC214X_GPIO_CLR_OFFSET); } -/************************************************************ +/**************************************************************************** * Name: up_ledoff - ************************************************************/ + ****************************************************************************/ void up_ledoff(int led) { + putled(LEDBIT(led),LPC214X_GPIO_SET_OFFSET); } #endif /* CONFIG_ARCH_LEDS */