summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-11 13:56:58 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-11 13:56:58 +0000
commit8a159f47cd6550e70b5f1513f866ba1bbfefb41d (patch)
treeb3d2346b25763e6a263db012096f263dfbd06cd2 /nuttx/arch
parent3e721ef06a3633d241f2fd97f5ca0e2e1e946164 (diff)
downloadpx4-nuttx-8a159f47cd6550e70b5f1513f866ba1bbfefb41d.tar.gz
px4-nuttx-8a159f47cd6550e70b5f1513f866ba1bbfefb41d.tar.bz2
px4-nuttx-8a159f47cd6550e70b5f1513f866ba1bbfefb41d.zip
Add board init
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@551 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/z16/src/Makefile2
-rw-r--r--nuttx/arch/z16/src/z16f/chip.h14
-rwxr-xr-xnuttx/arch/z16/src/z16f/z16f_head.S95
-rwxr-xr-xnuttx/arch/z16/src/z16f/z16f_lowuart.S6
4 files changed, 77 insertions, 40 deletions
diff --git a/nuttx/arch/z16/src/Makefile b/nuttx/arch/z16/src/Makefile
index 229389a33..e900db026 100644
--- a/nuttx/arch/z16/src/Makefile
+++ b/nuttx/arch/z16/src/Makefile
@@ -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
diff --git a/nuttx/arch/z16/src/z16f/chip.h b/nuttx/arch/z16/src/z16f/chip.h
index 5bbf83580..b91e44484 100644
--- a/nuttx/arch/z16/src/z16f/chip.h
+++ b/nuttx/arch/z16/src/z16f/chip.h
@@ -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
}
diff --git a/nuttx/arch/z16/src/z16f/z16f_head.S b/nuttx/arch/z16/src/z16f/z16f_head.S
index 00ae886f4..24238be2e 100755
--- a/nuttx/arch/z16/src/z16f/z16f_head.S
+++ b/nuttx/arch/z16/src/z16f/z16f_head.S
@@ -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
diff --git a/nuttx/arch/z16/src/z16f/z16f_lowuart.S b/nuttx/arch/z16/src/z16f/z16f_lowuart.S
index 97d904069..20c4fc35a 100755
--- a/nuttx/arch/z16/src/z16f/z16f_lowuart.S
+++ b/nuttx/arch/z16/src/z16f/z16f_lowuart.S
@@ -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