You should let the initialization of ram and vectors complete befor using them:
void
mcf5213_init(void)
{
/********************************************************************/
/* RAMBAR & FLASHBAR already initialized in asm_startmeup */
/********************************************************************/
extern char __DATA_ROM[];
extern char __DATA_RAM[];
extern char __DATA_END[];
extern char __BSS_START[];
extern char __BSS_END[];
extern uint32 VECTOR_TABLE[];
extern uint32 __VECTOR_RAM[];
register uint32 n;
register uint8 *dp, *sp;
/* Copy the vector table to RAM */
if (__VECTOR_RAM != VECTOR_TABLE)
{
for (n = 0; n < 256; n++)
__VECTOR_RAM[n] = VECTOR_TABLE[n];
}
mcf5xxx_wr_vbr((uint32)__VECTOR_RAM);
/*
* Move initialized data from ROM to RAM.
*/
if (__DATA_ROM != __DATA_RAM)
{
dp = (uint8 *)__DATA_RAM;
sp = (uint8 *)__DATA_ROM;
n = __DATA_END - __DATA_RAM;
while (n--)
*dp++ = *sp++;
}
/*
* Zero uninitialized data
*/
if (__BSS_START != __BSS_END)
{
sp = (uint8 *)__BSS_START;
n = __BSS_END - __BSS_START;
while (n--)
*sp++ = 0;
}
mcf5213_wtm_init();
mcf5213_pll_init();
mcf5213_uart_init();
mcf5213_allow_interrupts();
}