Add board init

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@551 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-01-11 13:56:58 +00:00
parent 9dbc6e1c2f
commit 0dd2134fa8
4 changed files with 77 additions and 40 deletions

View File

@ -109,7 +109,7 @@ clean:
@if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
fi
@rm -f libarch$(LIBEXT) nuttx.linkcmd *~ .*.swp *.asm *.tmp
@rm -f libarch$(LIBEXT) nuttx.linkcmd *~ .*.swp *.asm *.tmp *.map
$(call CLEAN)
distclean: clean

View File

@ -41,6 +41,8 @@
* Included Files
************************************************************************************/
#include <nuttx/config.h>
/************************************************************************************
* Definitions
************************************************************************************/
@ -106,7 +108,7 @@
* on the size of the IRAM supported by the chip.
*/
#define Z16F_IRAM_BASE (HZ32(ffffc000) - Z16F_IRAM_SIZE)
#define Z16F_IRAM_BASE (_HX32(ffffc000) - Z16F_IRAM_SIZE)
/* External memory mapped peripherals, internal I/O memory and SFRS */
@ -286,6 +288,16 @@ extern "C" {
#define EXTERN extern
#endif
/* The following two routines are called from the low-level reset logic. z16f_lowinit()
* must be provided by the board-specific logic; z16f_lowuartinit() is called only if
* debugging support for up_lowputc (or getc) is enabled.
*/
extern void z16f_lowinit(void);
#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC)
extern void z16f_lowuartinit(void);
#endif
#undef EXTERN
#ifdef __cplusplus
}

View File

@ -65,31 +65,31 @@
**************************************************************************/
vector RESET=_reset
vector SYSEXC=_default_handler
vector TIMER2=_default_handler
vector TIMER1=_default_handler
vector TIMER0=_default_handler
vector UART0_RX=_default_handler
vector UART0_TX=_default_handler
vector I2C=_default_handler
vector SPI=_default_handler
vector ADC=_default_handler
vector P7AD=_default_handler
vector P6AD=_default_handler
vector P5AD=_default_handler
vector P4AD=_default_handler
vector P3AD=_default_handler
vector P2AD=_default_handler
vector P1AD=_default_handler
vector P0AD=_default_handler
vector PWM_TIMER=_default_handler
vector UART1_RX=_default_handler
vector UART1_TX=_default_handler
vector PWM_FAULT=_default_handler
vector C3=_default_handler
vector C2=_default_handler
vector C1=_default_handler
vector C0=_default_handler
vector SYSEXC=_sysexc_isr
vector TIMER2=_timer2_isr
vector TIMER1=_timer1_isr
vector TIMER0=_timer0_isr
vector UART0_RX=_uart0rx_isr
vector UART0_TX=_uart0tx_isr
vector I2C=_i2c_isr
vector SPI=_spi_isr
vector ADC=_adc_isr
vector P7AD=_p7ad_isr
vector P6AD=_p6ad_isr
vector P5AD=_p5ad_isr
vector P4AD=_p4ad_isr
vector P3AD=_p3ad_isr
vector P2AD=_p2ad_isr
vector P1AD=_p1ad_isr
vector P0AD=_p0ad_isr
vector PWM_TIMER=_pwmtimer_isr
vector UART1_RX=_uart1rx_isr
vector UART1_TX=_uart1tx_isr
vector PWM_FAULT=_pwmfault_isr
vector C3=_c3_isr
vector C2=_c3_isr
vector C1=_c2_isr
vector C0=_c0_isr
/**************************************************************************
* Equates
@ -117,25 +117,50 @@ STACK_TOP equ %FFC000
**************************************************************************/
_reset:
ld sp, #STACK_TOP /* Set Stack Pointer */
ld sp, #STACK_TOP /* Set Stack Pointer */
call _z16f_lowinit /* Perform low-level hardware initialization */
#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC)
call _z16f_lowinit /* Initialize the UART for low-level debug */
call _z16f_lowuartinit /* Initialize the UART for debugging */
#endif
call _os_start /* Start the operating system */
_halted: /* _os_start() should not return */
halt
jp _halted
call _os_start /* Start the operating system */
_halted: /* _os_start() should not return */
halt
jp _halted
/**************************************************************************
* Name: _default_handler
* Name: Interrupt handlers
*
* Description:
* This is where interrupts will go if they have not yet been intialize
* All interrupts will be vectored to the following locations.
*
**************************************************************************/
_default_handler:
_sysexc_isr:
_timer2_isr:
_timer1_isr:
_timer0_isr:
_uart0rx_isr:
_uart0tx_isr:
_i2c_isr:
_spi_isr:
_adc_isr:
_p7ad_isr:
_p6ad_isr:
_p5ad_isr:
_p4ad_isr:
_p3ad_isr:
_p2ad_isr:
_p1ad_isr:
_p0ad_isr:
_pwmtimer_isr:
_uart1rx_isr:
_uart1tx_isr:
_pwmfault_isr:
_c3_isr:
_c2_isr:
_c1_isr:
_c0_isr:
_common_isr:
nop
iret

View File

@ -47,7 +47,7 @@
* External References / External Definitions
*************************************************************************/
xdef z16f_lowinit
xdef z16f_lowuartinit
xref _SYS_CLK_FREQ:EROM
#ifdef CONFIG_ARCH_LOWPUTC
xdef _z16f_xmitc
@ -73,7 +73,7 @@
*************************************************************************/
/*************************************************************************
* Name: z16f_lowinit
* Name: z16f_lowuartinit
*
* Description:
* Initialize UART0 or UART1
@ -85,7 +85,7 @@
*
*************************************************************************/
z16f_lowinit:
z16f_lowuartinit:
pushmlo <r0,R3> /* Save registers */
ld r3, #_SYS_CLK_FREQ