2 * File: mcf52221_sysinit.c
\r
3 * Purpose: Power-on Reset configuration of the MCF52221.
\r
8 #include "support_common.h"
\r
9 #include "exceptions.h"
\r
13 /********************************************************************/
\r
14 static void pll_init(void)
\r
17 MCF_CLOCK_CCHR =0x05; // The PLL pre divider - 48MHz / 6 = 8MHz
\r
19 /* The PLL pre-divider affects this!!!
\r
20 * Multiply 8Mhz reference crystal /CCHR by 10 to acheive system clock of 80Mhz
\r
23 MCF_CLOCK_SYNCR = MCF_CLOCK_SYNCR_MFD(3) | MCF_CLOCK_SYNCR_CLKSRC| MCF_CLOCK_SYNCR_PLLMODE | MCF_CLOCK_SYNCR_PLLEN ;
\r
25 while (!(MCF_CLOCK_SYNSR & MCF_CLOCK_SYNSR_LOCK))
\r
29 /********************************************************************/
\r
30 static void scm_init(void)
\r
33 * Enable on-chip modules to access internal SRAM
\r
36 | MCF_SCM_RAMBAR_BA(RAMBAR_ADDRESS)
\r
37 | MCF_SCM_RAMBAR_BDE);
\r
40 /********************************************************************/
\r
43 * Out of reset, the low-level assembly code calls this routine to
\r
44 * initialize the mcf5206e for this board. A temporary stack has been
\r
45 * setup in the internal SRAM, and the stack pointer will be changed
\r
46 * to point to DRAM once this routine returns.
\r
48 void __initialize_hardware(void)
\r
50 /*******************************************************
\r
51 * Out of reset, the low-level assembly code calls this
\r
52 * routine to initialize the MCF52221 modules for the
\r
53 * M522223EVB board.
\r
54 ********************************************************/
\r
59 /* Initialize IPSBAR */
\r
61 andi.l #0xC0000000,d0 // need to mask
\r
63 move.l d0,0x40000000
\r
67 /* Initialize FLASHBAR */
\r
68 move.l #__FLASHBAR,d0
\r
69 andi.l #0xFFF80000,d0 // need to mask
\r
76 /* Set real time clock freq */
\r
77 MCF_CLOCK_RTCDR = 48000000;
\r
82 initialize_exceptions();
\r