From 2805c4beabc1193af924cf01c32025b370baafa6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 22 Feb 2011 02:26:15 +0000 Subject: [PATCH] Call call to low-level UART initialization logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3309 42af7a65-404d-4744-a932-0658087f49c3 --- arch/hc/src/m9s12/m9s12_lowputc.S | 5 +++++ arch/hc/src/m9s12/m9s12_start.S | 34 +++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/arch/hc/src/m9s12/m9s12_lowputc.S b/arch/hc/src/m9s12/m9s12_lowputc.S index 1a251ec22ec..271d66ec06c 100755 --- a/arch/hc/src/m9s12/m9s12_lowputc.S +++ b/arch/hc/src/m9s12/m9s12_lowputc.S @@ -126,6 +126,11 @@ /************************************************************************** * Name: up_lowsetup + * + * Note: This function is called from the boot logic very early in the + * initialization sequence: After the stack pointer has been setup, but + * before .bss has been cleared and .data initialized. + * **************************************************************************/ .text diff --git a/arch/hc/src/m9s12/m9s12_start.S b/arch/hc/src/m9s12/m9s12_start.S index ad5a39c0da7..1a3ec463fd2 100755 --- a/arch/hc/src/m9s12/m9s12_start.S +++ b/arch/hc/src/m9s12/m9s12_start.S @@ -59,9 +59,11 @@ * Global Symbols ****************************************************************************/ + .file "m9s12_start.S" .globl __start .globl os_start - .file "m9s12_start.S" + .globl up_lowsetup + .globl hcs12_boardinitialize /**************************************************************************** * Macros @@ -72,8 +74,17 @@ */ .macro showprogress, code -#if defined(CONFIG_DEBUG) && defined(CONFIG_HCS12_SERIALMON) +#ifdef CONFIG_DEBUG + ldab \code +#ifdef CONFIG_HCS12_SERIALMON jsr #PutChar +#else +#ifdef CONFIG_HCS12_NONBANKED + jsr up_lowputc +#else + call up_lowputc +#endif +#endif #endif .endm @@ -161,6 +172,16 @@ __start: /* Setup the stack pointer */ lds .Lstackbase + + /* Perform early, low-level initialization */ + +#ifndef CONFIG_HCS12_SERIALMON +#ifdef CONFIG_HCS12_NONBANKED + jsr up_lowsetup +#else + call up_lowsetup +#endif +#endif showprogress 'A' /* Clear BSS */ @@ -196,6 +217,15 @@ __start: .Ldatainitialized: showprogress 'C' + /* Perform early board-level initialization */ + +#ifdef CONFIG_HCS12_NONBANKED + jsr hcs12_boardinitialize +#else + call hcs12_boardinitialize +#endif + showprogress 'D' + /* Now, start the OS */ showprogress '\n'