From 729525f67ccd756531d379970afee32fac659638 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 18 Feb 2009 03:22:17 +0000 Subject: [PATCH] Hook in low-level UART init git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1511 42af7a65-404d-4744-a932-0658087f49c3 --- arch/sh/src/m16c/m16c_head.S | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/arch/sh/src/m16c/m16c_head.S b/arch/sh/src/m16c/m16c_head.S index cfa1795a3f..7a20491988 100644 --- a/arch/sh/src/m16c/m16c_head.S +++ b/arch/sh/src/m16c/m16c_head.S @@ -39,6 +39,7 @@ #include #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