Update lpc214x stuff

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@923 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-09-17 18:44:34 +00:00
parent 4f4d5c076a
commit 10e928c723
13 changed files with 173 additions and 108 deletions

View File

@ -0,0 +1,83 @@
/************************************************************************************
* arch/arm/src/common/up_vectoraddrexceptn.S
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* 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 <nuttx/config.h>
#include <nuttx/irq.h>
#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

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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 <nuttx/config.h>
#include <nuttx/irq.h>
#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

View File

@ -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 \

View File

@ -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 <spudmonkey@racsa.co.cr>
#
# 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

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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.
*

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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.
*

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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 <nuttx/config.h>
#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

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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.
*

View File

@ -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 <spudmonkey@racsa.co.cr>

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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.
*

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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 <nuttx/config.h>
#include <sys/types.h>
@ -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)
{

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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.
*

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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.
*