diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-18 03:22:17 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-18 03:22:17 +0000 |
commit | f3fad3954742d93d27c75c2f5a1b9542cf82fc32 (patch) | |
tree | ab706cbc43747f5c74fc39b90ba7c908aa1ef005 | |
parent | 6ae471ff90ac6783fb8d3d1559652f45aa6a794f (diff) | |
download | px4-nuttx-f3fad3954742d93d27c75c2f5a1b9542cf82fc32.tar.gz px4-nuttx-f3fad3954742d93d27c75c2f5a1b9542cf82fc32.tar.bz2 px4-nuttx-f3fad3954742d93d27c75c2f5a1b9542cf82fc32.zip |
Hook in low-level UART init
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1511 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_head.S | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/nuttx/arch/sh/src/m16c/m16c_head.S b/nuttx/arch/sh/src/m16c/m16c_head.S index cfa1795a3..7a2049198 100644 --- a/nuttx/arch/sh/src/m16c/m16c_head.S +++ b/nuttx/arch/sh/src/m16c/m16c_head.S @@ -39,6 +39,7 @@ #include <nuttx/config.h> #include "chip.h" +#include "up_internal.h" /************************************************************************************ * Pre-processor Definitions @@ -48,6 +49,22 @@ * Macro Definitions ************************************************************************************/ +/***************************************************************************** + * Name: showprogress + * + * Description: + * Print a character on the UART to show boot status. + * + *****************************************************************************/ + + .macro showprogress, code +#ifdef CONFIG_DEBUG + .globl _up_lowputc + mov.b r#\code1l /* Character to print */ + jsr.a _up_lowputc /* Print it */ +#endif + .endm + /************************************************************************************ * Data ************************************************************************************/ @@ -186,6 +203,12 @@ __start: ldc r1, intbh ldc r0, intbl +/* Configure the uart so that we can get debug output as soon as possible. */ + + .globl _up_lowsetup /* Early initialization of UART */ + jsr.a _up_lowsetup + showprogress 'A' + /* Clear near .bss sections */ mov.b #0x00, r0l /* r0l: 0 */ @@ -196,6 +219,8 @@ __start: /* Clear far .bss sections */ + showprogress 'B' + #ifdef CONFIG_M16C_HAVEFARRAM # warning "Far RAM support not implemented" #endif @@ -211,10 +236,35 @@ __start: /* Initialize far .data sections (.rodata is not moved) */ + showprogress 'C' + #ifdef CONFIG_M16C_HAVEFARRAM # warning "Far RAM support not implemented" #endif +/* Perform early serial initialization */ + +#ifdef CONFIG_USE_EARLYSERIALINIT + .globl _up_earlyserialinit /* Early initialization of serial driver */ + jsr.a _up_earlyserialinit /* Call it */ + showprogress 'D' +#endif + +/* Call C++ constructors */ + +#ifdef CONFIG_CPLUSPLUS +# warning "No C++ support yet" + showprogress 'E' +#endif + +/* Initialize onboard LEDs */ + +#ifdef CONFIG_ARCH_LEDS + .globl _up_ledinit /* Boot LED setup */ + jsr.a _up_ledinit /* Call it */ +#endif + showprogress '\n' + /* Pass control to NuttX */ .globl _os_start |