1 /* Copyright 2000 AG Electronics Ltd. */
2 /* This code is distributed without warranty under the GPL v2 (see COPYING) */
6 #include <ppc_asm.tmpl>
8 .section ".rom.reset", "ax", @progbits
14 .section ".rom.exception_vectors", "ax", @progbits
16 %%EXCEPTION_VECTOR_TABLE%%
18 .section ".rom.data", "a", @progbits
19 .section ".rom.text", "ax", @progbits
24 * Do processor family initialization
29 * Do processor specific initialization
33 #if USE_DCACHE_RAM == 1
34 #define DCACHE_RAM_END (DCACHE_RAM_BASE + DCACHE_RAM_SIZE - 1)
36 * Initialize data cache blocks
37 * (assumes cache block size of 32 bytes)
39 * NOTE: This may need to be moved to FAMILY_INIT if
40 * dcbz is not supported on all CPU's
42 lis r1, DCACHE_RAM_BASE@h
43 ori r1, r1, DCACHE_RAM_BASE@l
44 li r3, (DCACHE_RAM_SIZE / 32)
51 * Set up stack in cache. The SP must be 16-byte (4-word) aligned
52 * for SYSV EABI or 8-byte (2-word) aligned for PPC EABI, so we make
53 * it 16-byte aligned to cover both cases. Also we have to ensure that
54 * the first word is located within the cache.
56 lis r1, (DCACHE_RAM_BASE+DCACHE_RAM_SIZE)@h
57 ori r1, r1, (DCACHE_RAM_BASE+DCACHE_RAM_SIZE)@l
68 lis r4, DCACHE_RAM_BASE@h
69 ori r4, r4, DCACHE_RAM_BASE@l
70 lis r7, DCACHE_RAM_END@h
71 ori r7, r7, DCACHE_RAM_END@l
81 * Set up the EABI pointers, before we enter any C code
84 ori r13, r13, _SDA_BASE_@l
86 ori r2, r2, _SDA2_BASE_@l
89 * load start address into SRR0 for rfi
92 ori r3, r3, ppc_main@l
96 * load the current MSR into SRR1 so that it will be copied
97 * back into MSR on rfi
100 mtspr SRR1, r4 // load SRR1 with r4
103 * If something returns after rfi then die
110 * Complete rest of initialization in C (ppc_main)
113 #endif /* USE_DCACHE_RAM */
116 * Stop here if something goes wrong
122 /* Remove need for ecrti.o and ectrn.o */