3 * Purpose: Low-level routines for the MCF5225x.
7 * License: All software covered by license agreement in -
8 * docs/Freescale_Software_License.pdf
11 #define mcf5225x_init _mcf5225x_init
12 #define common_startup _common_startup
13 #define cpu_startup _cpu_startup
15 #define __IPSBAR ___IPSBAR
16 #define __SRAM ___SRAM
17 #define __FLASH ___FLASH
18 #define __SP_INIT ___SP_INIT
25 .extern common_startup
30 .global _asm_startmeup
45 /********************************************************************
47 * This is the main entry point upon hard reset. The memory map is
48 * setup based on linker file definitions, then the higher level
49 * system initialization routine is called. Finally, we jump to the
57 /* Save off reset values of D0 and D1 */
61 /* Initialize RAMBAR1: locate SRAM and validate it */
67 /* Locate Stack Pointer */
70 /* Initialize IPSBAR */
75 /* Initialize FLASHBAR */
84 /* Locate Stack Pointer */
87 /* Initialize the system */
90 /* Common startup code */
93 /* Save off intial D0 and D1 to RAM */
97 /* CPU specific startup code */
100 /* Jump to the main process */
110 * The following sequence is used to set FLASHBAR. Since we may
111 * be executing from Flash, we must put the routine into SRAM for
112 * execution and then jump back to Flash using the new address.
114 * The following instructions are coded into the SRAM:
116 * move.l #(__FLASH + 0x21),d0
118 * jmp _continue_startup
120 * An arbitrary SRAM address is chosen until the real address
123 * This routine is not necessary if the default Flash address
124 * (0x00000000) is used.
126 * If running in SRAM, change_flashbar should not be executed
131 /* Code "move.l #(__FLASH + 0x21),d0" into SRAM */
138 /* Code "movec d0,FLASHBAR" into SRAM */
139 move.l #0x4e7b0C04,d0
142 /* Code "jmp _continue_startup" into SRAM */
145 move.l #_continue_startup,d0
148 /* Jump to code segment in internal SRAM */
151 /********************************************************************/