blob: 92f956db8da07bad3b11d6b4dfe23f8e02d47eca [file] [log] [blame]
wdenk359733b2003-03-31 17:27:09 +00001/*
2 * Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
3 * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
4 * Copyright (C) 2000, 2001, 2002 Wolfgang Denk <wd@denx.de>
5 * Copyright (C) 2003 Martin Winistoerfer, martinwinistoerfer@gmx.ch.
wdenk57b2d802003-06-27 21:31:46 +00006 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
wdenk359733b2003-03-31 17:27:09 +00008 */
9
10/*
11 * File: start.S
wdenk57b2d802003-06-27 21:31:46 +000012 *
wdenk359733b2003-03-31 17:27:09 +000013 * Discription: startup code
14 *
15 */
16
Wolfgang Denk0191e472010-10-26 14:34:52 +020017#include <asm-offsets.h>
wdenk359733b2003-03-31 17:27:09 +000018#include <config.h>
19#include <mpc5xx.h>
20#include <version.h>
21
22#define CONFIG_5xx 1 /* needed for Linux kernel header files */
23#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
24
25#include <ppc_asm.tmpl>
26#include <ppc_defs.h>
wdenk57b2d802003-06-27 21:31:46 +000027
wdenk57b2d802003-06-27 21:31:46 +000028#include <asm/processor.h>
Peter Tyser3a1362d2010-10-14 23:33:24 -050029#include <asm/u-boot.h>
wdenk359733b2003-03-31 17:27:09 +000030
wdenk359733b2003-03-31 17:27:09 +000031/* We don't have a MMU.
32*/
33#undef MSR_KERNEL
34#define MSR_KERNEL ( MSR_ME | MSR_RI ) /* Machine Check and Recoverable Interr. */
35
36/*
37 * Set up GOT: Global Offset Table
38 *
Joakim Tjernlund3fbaa4d2010-01-19 14:41:56 +010039 * Use r12 to access the GOT
wdenk359733b2003-03-31 17:27:09 +000040 */
41 START_GOT
42 GOT_ENTRY(_GOT2_TABLE_)
43 GOT_ENTRY(_FIXUP_TABLE_)
44
45 GOT_ENTRY(_start)
46 GOT_ENTRY(_start_of_vectors)
47 GOT_ENTRY(_end_of_vectors)
48 GOT_ENTRY(transfer_to_handler)
49
wdenkb9a83a92003-05-30 12:48:29 +000050 GOT_ENTRY(__init_end)
Simon Glassed70c8f2013-03-14 06:54:53 +000051 GOT_ENTRY(__bss_end)
wdenkbf2f8c92003-05-22 22:52:13 +000052 GOT_ENTRY(__bss_start)
wdenk359733b2003-03-31 17:27:09 +000053 END_GOT
54
55/*
56 * r3 - 1st arg to board_init(): IMMP pointer
57 * r4 - 2nd arg to board_init(): boot flag
58 */
59 .text
60 .long 0x27051956 /* U-Boot Magic Number */
61 .globl version_string
62version_string:
Andreas Bießmann61d01952011-07-18 20:24:04 +020063 .ascii U_BOOT_VERSION_STRING, "\0"
wdenk359733b2003-03-31 17:27:09 +000064
65 . = EXC_OFF_SYS_RESET
66 .globl _start
67_start:
68 mfspr r3, 638
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020069 li r4, CONFIG_SYS_ISB /* Set ISB bit */
wdenk57b2d802003-06-27 21:31:46 +000070 or r3, r3, r4
wdenk359733b2003-03-31 17:27:09 +000071 mtspr 638, r3
wdenk359733b2003-03-31 17:27:09 +000072
73 /* Initialize machine status; enable machine check interrupt */
74 /*----------------------------------------------------------------------*/
75 li r3, MSR_KERNEL /* Set ME, RI flags */
76 mtmsr r3
77 mtspr SRR1, r3 /* Make SRR1 match MSR */
78
79 /* Initialize debug port registers */
80 /*----------------------------------------------------------------------*/
81 xor r0, r0, r0 /* Clear R0 */
82 mtspr LCTRL1, r0 /* Initialize debug port regs */
83 mtspr LCTRL2, r0
84 mtspr COUNTA, r0
85 mtspr COUNTB, r0
86
wdenkbc01dd52004-01-02 16:05:07 +000087#if defined(CONFIG_PATI)
88 /* the external flash access on PATI fails if programming the PLL to 40MHz.
89 * Copy the PLL programming code to the internal RAM and execute it
90 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020091 lis r3, CONFIG_SYS_MONITOR_BASE@h
92 ori r3, r3, CONFIG_SYS_MONITOR_BASE@l
wdenkbc01dd52004-01-02 16:05:07 +000093 addi r3, r3, pll_prog_code_start - _start + EXC_OFF_SYS_RESET
94
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020095 lis r4, CONFIG_SYS_INIT_RAM_ADDR@h
96 ori r4, r4, CONFIG_SYS_INIT_RAM_ADDR@l
wdenkbc01dd52004-01-02 16:05:07 +000097 mtlr r4
98 addis r5,0,0x0
99 ori r5,r5,((pll_prog_code_end - pll_prog_code_start) >>2)
100 mtctr r5
101 addi r3, r3, -4
102 addi r4, r4, -4
1030:
104 lwzu r0,4(r3)
105 stwu r0,4(r4)
106 bdnz 0b /* copy loop */
107 blrl
108#endif
109
wdenk359733b2003-03-31 17:27:09 +0000110 /*
111 * Calculate absolute address in FLASH and jump there
112 *----------------------------------------------------------------------*/
113
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200114 lis r3, CONFIG_SYS_MONITOR_BASE@h
115 ori r3, r3, CONFIG_SYS_MONITOR_BASE@l
wdenk359733b2003-03-31 17:27:09 +0000116 addi r3, r3, in_flash - _start + EXC_OFF_SYS_RESET
117 mtlr r3
118 blr
119
120in_flash:
121
122 /* Initialize some SPRs that are hard to access from C */
123 /*----------------------------------------------------------------------*/
wdenk57b2d802003-06-27 21:31:46 +0000124
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200125 lis r3, CONFIG_SYS_IMMR@h /* Pass IMMR as arg1 to C routine */
126 lis r2, CONFIG_SYS_INIT_SP_ADDR@h
127 ori r1, r2, CONFIG_SYS_INIT_SP_ADDR@l /* Set up the stack in internal SRAM */
wdenk359733b2003-03-31 17:27:09 +0000128 /* Note: R0 is still 0 here */
129 stwu r0, -4(r1) /* Clear final stack frame so that */
130 stwu r0, -4(r1) /* stack backtraces terminate cleanly */
131
132 /*
133 * Disable serialized ifetch and show cycles
134 * (i.e. set processor to normal mode) for maximum
135 * performance.
136 */
137
138 li r2, 0x0007
139 mtspr ICTRL, r2
140
141 /* Set up debug mode entry */
142
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200143 lis r2, CONFIG_SYS_DER@h
144 ori r2, r2, CONFIG_SYS_DER@l
wdenk359733b2003-03-31 17:27:09 +0000145 mtspr DER, r2
146
147 /* Let the C-code set up the rest */
148 /* */
149 /* Be careful to keep code relocatable ! */
150 /*----------------------------------------------------------------------*/
151
152 GET_GOT /* initialize GOT access */
Wolfgang Denkb2d36ea2011-04-20 22:11:21 +0200153
wdenk359733b2003-03-31 17:27:09 +0000154 /* r3: IMMR */
155 bl cpu_init_f /* run low-level CPU init code (from Flash) */
156
wdenk359733b2003-03-31 17:27:09 +0000157 bl board_init_f /* run 1st part of board init code (from Flash) */
158
Peter Tyser0c44caf2010-09-14 19:13:53 -0500159 /* NOTREACHED - board_init_f() does not return */
160
wdenk359733b2003-03-31 17:27:09 +0000161
wdenk359733b2003-03-31 17:27:09 +0000162 .globl _start_of_vectors
163_start_of_vectors:
164
165/* Machine check */
166 STD_EXCEPTION(0x200, MachineCheck, MachineCheckException)
167
168/* Data Storage exception. "Never" generated on the 860. */
169 STD_EXCEPTION(0x300, DataStorage, UnknownException)
170
171/* Instruction Storage exception. "Never" generated on the 860. */
172 STD_EXCEPTION(0x400, InstStorage, UnknownException)
173
174/* External Interrupt exception. */
175 STD_EXCEPTION(0x500, ExtInterrupt, external_interrupt)
176
177/* Alignment exception. */
178 . = 0x600
179Alignment:
Rafal Jaworowski06244e42007-06-22 14:58:04 +0200180 EXCEPTION_PROLOG(SRR0, SRR1)
wdenk359733b2003-03-31 17:27:09 +0000181 mfspr r4,DAR
182 stw r4,_DAR(r21)
183 mfspr r5,DSISR
184 stw r5,_DSISR(r21)
185 addi r3,r1,STACK_FRAME_OVERHEAD
Joakim Tjernlund4ff6bc02010-01-19 14:41:55 +0100186 EXC_XFER_TEMPLATE(Alignment, AlignmentException, MSR_KERNEL, COPY_EE)
wdenk359733b2003-03-31 17:27:09 +0000187
188/* Program check exception */
189 . = 0x700
190ProgramCheck:
Rafal Jaworowski06244e42007-06-22 14:58:04 +0200191 EXCEPTION_PROLOG(SRR0, SRR1)
wdenk359733b2003-03-31 17:27:09 +0000192 addi r3,r1,STACK_FRAME_OVERHEAD
Joakim Tjernlund4ff6bc02010-01-19 14:41:55 +0100193 EXC_XFER_TEMPLATE(ProgramCheck, ProgramCheckException,
194 MSR_KERNEL, COPY_EE)
wdenk359733b2003-03-31 17:27:09 +0000195
196 /* FPU on MPC5xx available. We will use it later.
197 */
198 STD_EXCEPTION(0x800, FPUnavailable, UnknownException)
199
200 /* I guess we could implement decrementer, and may have
201 * to someday for timekeeping.
202 */
203 STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
204 STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
205 STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
wdenk874ac262003-07-24 23:38:38 +0000206 STD_EXCEPTION(0xc00, SystemCall, UnknownException)
wdenk359733b2003-03-31 17:27:09 +0000207 STD_EXCEPTION(0xd00, SingleStep, UnknownException)
208
209 STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
210 STD_EXCEPTION(0xf00, Trap_0f, UnknownException)
211
212 /* On the MPC8xx, this is a software emulation interrupt. It occurs
213 * for all unimplemented and illegal instructions.
214 */
215 STD_EXCEPTION(0x1000, SoftEmu, SoftEmuException)
216 STD_EXCEPTION(0x1100, InstructionTLBMiss, UnknownException)
217 STD_EXCEPTION(0x1200, DataTLBMiss, UnknownException)
218 STD_EXCEPTION(0x1300, InstructionTLBError, UnknownException)
219 STD_EXCEPTION(0x1400, DataTLBError, UnknownException)
220
221 STD_EXCEPTION(0x1500, Reserved5, UnknownException)
222 STD_EXCEPTION(0x1600, Reserved6, UnknownException)
223 STD_EXCEPTION(0x1700, Reserved7, UnknownException)
224 STD_EXCEPTION(0x1800, Reserved8, UnknownException)
225 STD_EXCEPTION(0x1900, Reserved9, UnknownException)
226 STD_EXCEPTION(0x1a00, ReservedA, UnknownException)
227 STD_EXCEPTION(0x1b00, ReservedB, UnknownException)
228
229 STD_EXCEPTION(0x1c00, DataBreakpoint, UnknownException)
230 STD_EXCEPTION(0x1d00, InstructionBreakpoint, DebugException)
231 STD_EXCEPTION(0x1e00, PeripheralBreakpoint, UnknownException)
232 STD_EXCEPTION(0x1f00, DevPortBreakpoint, UnknownException)
233
234
235 .globl _end_of_vectors
236_end_of_vectors:
237
238
239 . = 0x2000
240
241/*
242 * This code finishes saving the registers to the exception frame
243 * and jumps to the appropriate handler for the exception.
244 * Register r21 is pointer into trap frame, r1 has new stack pointer.
245 */
246 .globl transfer_to_handler
247transfer_to_handler:
248 stw r22,_NIP(r21)
249 lis r22,MSR_POW@h
250 andc r23,r23,r22
251 stw r23,_MSR(r21)
252 SAVE_GPR(7, r21)
253 SAVE_4GPRS(8, r21)
254 SAVE_8GPRS(12, r21)
255 SAVE_8GPRS(24, r21)
256 mflr r23
257 andi. r24,r23,0x3f00 /* get vector offset */
258 stw r24,TRAP(r21)
259 li r22,0
260 stw r22,RESULT(r21)
261 mtspr SPRG2,r22 /* r1 is now kernel sp */
262 lwz r24,0(r23) /* virtual address of handler */
263 lwz r23,4(r23) /* where to go when done */
264 mtspr SRR0,r24
265 mtspr SRR1,r20
266 mtlr r23
267 SYNC
268 rfi /* jump to handler, enable MMU */
269
270int_return:
271 mfmsr r28 /* Disable interrupts */
272 li r4,0
273 ori r4,r4,MSR_EE
274 andc r28,r28,r4
275 SYNC /* Some chip revs need this... */
276 mtmsr r28
277 SYNC
278 lwz r2,_CTR(r1)
279 lwz r0,_LINK(r1)
280 mtctr r2
281 mtlr r0
282 lwz r2,_XER(r1)
283 lwz r0,_CCR(r1)
284 mtspr XER,r2
285 mtcrf 0xFF,r0
286 REST_10GPRS(3, r1)
287 REST_10GPRS(13, r1)
288 REST_8GPRS(23, r1)
289 REST_GPR(31, r1)
290 lwz r2,_NIP(r1) /* Restore environment */
291 lwz r0,_MSR(r1)
292 mtspr SRR0,r2
293 mtspr SRR1,r0
294 lwz r0,GPR0(r1)
295 lwz r2,GPR2(r1)
296 lwz r1,GPR1(r1)
297 SYNC
298 rfi
299
wdenk57b2d802003-06-27 21:31:46 +0000300
wdenk359733b2003-03-31 17:27:09 +0000301/*
302 * unsigned int get_immr (unsigned int mask)
303 *
304 * return (mask ? (IMMR & mask) : IMMR);
305 */
306 .globl get_immr
307get_immr:
308 mr r4,r3 /* save mask */
309 mfspr r3, IMMR /* IMMR */
310 cmpwi 0,r4,0 /* mask != 0 ? */
311 beq 4f
312 and r3,r3,r4 /* IMMR & mask */
3134:
314 blr
315
316 .globl get_pvr
317get_pvr:
318 mfspr r3, PVR
319 blr
320
321
322/*------------------------------------------------------------------------------*/
323
324/*
325 * void relocate_code (addr_sp, gd, addr_moni)
326 *
327 * This "function" does not return, instead it continues in RAM
328 * after relocating the monitor code.
329 *
330 * r3 = dest
331 * r4 = src
332 * r5 = length in bytes
333 * r6 = cachelinesize
334 */
335 .globl relocate_code
336relocate_code:
337 mr r1, r3 /* Set new stack pointer in SRAM */
338 mr r9, r4 /* Save copy of global data pointer in SRAM */
339 mr r10, r5 /* Save copy of monitor destination Address in SRAM */
340
Joakim Tjernlund3fbaa4d2010-01-19 14:41:56 +0100341 GET_GOT
wdenk359733b2003-03-31 17:27:09 +0000342 mr r3, r5 /* Destination Address */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200343 lis r4, CONFIG_SYS_MONITOR_BASE@h /* Source Address */
344 ori r4, r4, CONFIG_SYS_MONITOR_BASE@l
wdenkb9a83a92003-05-30 12:48:29 +0000345 lwz r5, GOT(__init_end)
346 sub r5, r5, r4
wdenk359733b2003-03-31 17:27:09 +0000347
348 /*
349 * Fix GOT pointer:
350 *
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200351 * New GOT-PTR = (old GOT-PTR - CONFIG_SYS_MONITOR_BASE) + Destination Address
wdenk359733b2003-03-31 17:27:09 +0000352 *
353 * Offset:
354 */
355 sub r15, r10, r4
356
357 /* First our own GOT */
Joakim Tjernlund3fbaa4d2010-01-19 14:41:56 +0100358 add r12, r12, r15
wdenk359733b2003-03-31 17:27:09 +0000359 /* the the one used by the C code */
360 add r30, r30, r15
361
362 /*
363 * Now relocate code
364 */
365
366 cmplw cr1,r3,r4
367 addi r0,r5,3
368 srwi. r0,r0,2
369 beq cr1,4f /* In place copy is not necessary */
370 beq 4f /* Protect against 0 count */
371 mtctr r0
372 bge cr1,2f
373
374 la r8,-4(r4)
375 la r7,-4(r3)
3761: lwzu r0,4(r8)
377 stwu r0,4(r7)
378 bdnz 1b
379 b 4f
380
3812: slwi r0,r0,2
382 add r8,r4,r0
383 add r7,r3,r0
3843: lwzu r0,-4(r8)
385 stwu r0,-4(r7)
386 bdnz 3b
387
wdenk57b2d802003-06-27 21:31:46 +00003884: sync
wdenk359733b2003-03-31 17:27:09 +0000389 isync
390
391/*
392 * We are done. Do not return, instead branch to second part of board
393 * initialization, now running from RAM.
394 */
395
396 addi r0, r10, in_ram - _start + EXC_OFF_SYS_RESET
397 mtlr r0
398 blr
399
400in_ram:
401
402 /*
Joakim Tjernlund3fbaa4d2010-01-19 14:41:56 +0100403 * Relocation Function, r12 point to got2+0x8000
wdenk359733b2003-03-31 17:27:09 +0000404 *
wdenk57b2d802003-06-27 21:31:46 +0000405 * Adjust got2 pointers, no need to check for 0, this code
406 * already puts a few entries in the table.
wdenk359733b2003-03-31 17:27:09 +0000407 */
408 li r0,__got2_entries@sectoff@l
409 la r3,GOT(_GOT2_TABLE_)
410 lwz r11,GOT(_GOT2_TABLE_)
411 mtctr r0
412 sub r11,r3,r11
413 addi r3,r3,-4
4141: lwzu r0,4(r3)
Joakim Tjernlund4f2fdac2009-10-08 02:03:51 +0200415 cmpwi r0,0
416 beq- 2f
wdenk359733b2003-03-31 17:27:09 +0000417 add r0,r0,r11
418 stw r0,0(r3)
Joakim Tjernlund4f2fdac2009-10-08 02:03:51 +02004192: bdnz 1b
wdenk359733b2003-03-31 17:27:09 +0000420
421 /*
wdenk57b2d802003-06-27 21:31:46 +0000422 * Now adjust the fixups and the pointers to the fixups
wdenk359733b2003-03-31 17:27:09 +0000423 * in case we need to move ourselves again.
424 */
Joakim Tjernlund4f2fdac2009-10-08 02:03:51 +0200425 li r0,__fixup_entries@sectoff@l
wdenk359733b2003-03-31 17:27:09 +0000426 lwz r3,GOT(_FIXUP_TABLE_)
427 cmpwi r0,0
428 mtctr r0
429 addi r3,r3,-4
430 beq 4f
4313: lwzu r4,4(r3)
432 lwzux r0,r4,r11
Joakim Tjernlundc61b25a2010-10-14 11:51:44 +0200433 cmpwi r0,0
wdenk359733b2003-03-31 17:27:09 +0000434 add r0,r0,r11
Joakim Tjernlund401b5922010-11-04 19:02:00 +0100435 stw r4,0(r3)
Joakim Tjernlundc61b25a2010-10-14 11:51:44 +0200436 beq- 5f
wdenk359733b2003-03-31 17:27:09 +0000437 stw r0,0(r4)
Joakim Tjernlundc61b25a2010-10-14 11:51:44 +02004385: bdnz 3b
wdenk359733b2003-03-31 17:27:09 +00004394:
440clear_bss:
441 /*
442 * Now clear BSS segment
443 */
wdenkbf2f8c92003-05-22 22:52:13 +0000444 lwz r3,GOT(__bss_start)
Simon Glassed70c8f2013-03-14 06:54:53 +0000445 lwz r4,GOT(__bss_end)
wdenk359733b2003-03-31 17:27:09 +0000446 cmplw 0, r3, r4
447 beq 6f
448
449 li r0, 0
4505:
451 stw r0, 0(r3)
452 addi r3, r3, 4
453 cmplw 0, r3, r4
454 bne 5b
4556:
456
457 mr r3, r9 /* Global Data pointer */
458 mr r4, r10 /* Destination Address */
459 bl board_init_r
460
wdenk359733b2003-03-31 17:27:09 +0000461 /*
462 * Copy exception vector code to low memory
463 *
464 * r3: dest_addr
465 * r7: source address, r8: end address, r9: target address
466 */
467 .globl trap_init
468trap_init:
Joakim Tjernlund3fbaa4d2010-01-19 14:41:56 +0100469 mflr r4 /* save link register */
470 GET_GOT
wdenk359733b2003-03-31 17:27:09 +0000471 lwz r7, GOT(_start)
472 lwz r8, GOT(_end_of_vectors)
473
wdenk4e112c12003-06-03 23:54:09 +0000474 li r9, 0x100 /* reset vector always at 0x100 */
wdenk359733b2003-03-31 17:27:09 +0000475
476 cmplw 0, r7, r8
477 bgelr /* return if r7>=r8 - just in case */
wdenk359733b2003-03-31 17:27:09 +00004781:
479 lwz r0, 0(r7)
480 stw r0, 0(r9)
481 addi r7, r7, 4
482 addi r9, r9, 4
483 cmplw 0, r7, r8
484 bne 1b
485
486 /*
487 * relocate `hdlr' and `int_return' entries
488 */
489 li r7, .L_MachineCheck - _start + EXC_OFF_SYS_RESET
490 li r8, Alignment - _start + EXC_OFF_SYS_RESET
4912:
492 bl trap_reloc
493 addi r7, r7, 0x100 /* next exception vector */
494 cmplw 0, r7, r8
495 blt 2b
496
497 li r7, .L_Alignment - _start + EXC_OFF_SYS_RESET
498 bl trap_reloc
499
500 li r7, .L_ProgramCheck - _start + EXC_OFF_SYS_RESET
501 bl trap_reloc
502
503 li r7, .L_FPUnavailable - _start + EXC_OFF_SYS_RESET
504 li r8, SystemCall - _start + EXC_OFF_SYS_RESET
5053:
506 bl trap_reloc
507 addi r7, r7, 0x100 /* next exception vector */
508 cmplw 0, r7, r8
509 blt 3b
510
511 li r7, .L_SingleStep - _start + EXC_OFF_SYS_RESET
512 li r8, _end_of_vectors - _start + EXC_OFF_SYS_RESET
5134:
514 bl trap_reloc
515 addi r7, r7, 0x100 /* next exception vector */
516 cmplw 0, r7, r8
517 blt 4b
518
519 mtlr r4 /* restore link register */
520 blr
521
wdenkbc01dd52004-01-02 16:05:07 +0000522#if defined(CONFIG_PATI)
523/* Program the PLL */
524pll_prog_code_start:
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200525 lis r4, (CONFIG_SYS_IMMR + 0x002fc384)@h
526 ori r4, r4, (CONFIG_SYS_IMMR + 0x002fc384)@l
wdenkbc01dd52004-01-02 16:05:07 +0000527 lis r3, (0x55ccaa33)@h
528 ori r3, r3, (0x55ccaa33)@l
529 stw r3, 0(r4)
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200530 lis r4, (CONFIG_SYS_IMMR + 0x002fc284)@h
531 ori r4, r4, (CONFIG_SYS_IMMR + 0x002fc284)@l
532 lis r3, CONFIG_SYS_PLPRCR@h
533 ori r3, r3, CONFIG_SYS_PLPRCR@l
wdenkbc01dd52004-01-02 16:05:07 +0000534 stw r3, 0(r4)
535 addis r3,0,0x0
536 ori r3,r3,0xA000
537 mtctr r3
538..spinlp:
539 bdnz ..spinlp /* spin loop */
540 blr
541pll_prog_code_end:
542 nop
543 blr
544#endif