diff --git a/arch/hc/src/m9s12/m9s12_lowputc.S b/arch/hc/src/m9s12/m9s12_lowputc.S index 1a251ec22e..271d66ec06 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 ad5a39c0da..1a3ec463fd 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'