blob: bdd46d955dc9876274aeea27195e79ca8328225b [file] [log] [blame]
wdenk0db5bca2003-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.
wdenk8bde7f72003-06-27 21:31:46 +00006 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
wdenk0db5bca2003-03-31 17:27:09 +00008 */
9
10/*
11 * File: start.S
wdenk8bde7f72003-06-27 21:31:46 +000012 *
wdenk0db5bca2003-03-31 17:27:09 +000013 * Discription: startup code
14 *
15 */
16
Wolfgang Denk25ddd1f2010-10-26 14:34:52 +020017#include <asm-offsets.h>
wdenk0db5bca2003-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>
wdenk8bde7f72003-06-27 21:31:46 +000027
wdenk0db5bca2003-03-31 17:27:09 +000028#include <linux/config.h>
wdenk8bde7f72003-06-27 21:31:46 +000029#include <asm/processor.h>
Peter Tyserd98b0522010-10-14 23:33:24 -050030#include <asm/u-boot.h>
wdenk0db5bca2003-03-31 17:27:09 +000031
wdenk0db5bca2003-03-31 17:27:09 +000032/* We don't have a MMU.
33*/
34#undef MSR_KERNEL
35#define MSR_KERNEL ( MSR_ME | MSR_RI ) /* Machine Check and Recoverable Interr. */
36
37/*
38 * Set up GOT: Global Offset Table
39 *
Joakim Tjernlund0f8aa152010-01-19 14:41:56 +010040 * Use r12 to access the GOT
wdenk0db5bca2003-03-31 17:27:09 +000041 */
42 START_GOT
43 GOT_ENTRY(_GOT2_TABLE_)
44 GOT_ENTRY(_FIXUP_TABLE_)
45
46 GOT_ENTRY(_start)
47 GOT_ENTRY(_start_of_vectors)
48 GOT_ENTRY(_end_of_vectors)
49 GOT_ENTRY(transfer_to_handler)
50
wdenk3b57fe02003-05-30 12:48:29 +000051 GOT_ENTRY(__init_end)
Simon Glass3929fb02013-03-14 06:54:53 +000052 GOT_ENTRY(__bss_end)
wdenk5d232d02003-05-22 22:52:13 +000053 GOT_ENTRY(__bss_start)
wdenk0db5bca2003-03-31 17:27:09 +000054 END_GOT
55
56/*
57 * r3 - 1st arg to board_init(): IMMP pointer
58 * r4 - 2nd arg to board_init(): boot flag
59 */
60 .text
61 .long 0x27051956 /* U-Boot Magic Number */
62 .globl version_string
63version_string:
Andreas Bießmann09c2e902011-07-18 20:24:04 +020064 .ascii U_BOOT_VERSION_STRING, "\0"
wdenk0db5bca2003-03-31 17:27:09 +000065
66 . = EXC_OFF_SYS_RESET
67 .globl _start
68_start:
69 mfspr r3, 638
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020070 li r4, CONFIG_SYS_ISB /* Set ISB bit */
wdenk8bde7f72003-06-27 21:31:46 +000071 or r3, r3, r4
wdenk0db5bca2003-03-31 17:27:09 +000072 mtspr 638, r3
wdenk0db5bca2003-03-31 17:27:09 +000073
74 /* Initialize machine status; enable machine check interrupt */
75 /*----------------------------------------------------------------------*/
76 li r3, MSR_KERNEL /* Set ME, RI flags */
77 mtmsr r3
78 mtspr SRR1, r3 /* Make SRR1 match MSR */
79
80 /* Initialize debug port registers */
81 /*----------------------------------------------------------------------*/
82 xor r0, r0, r0 /* Clear R0 */
83 mtspr LCTRL1, r0 /* Initialize debug port regs */
84 mtspr LCTRL2, r0
85 mtspr COUNTA, r0
86 mtspr COUNTB, r0
87
wdenkb6e4c402004-01-02 16:05:07 +000088#if defined(CONFIG_PATI)
89 /* the external flash access on PATI fails if programming the PLL to 40MHz.
90 * Copy the PLL programming code to the internal RAM and execute it
91 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020092 lis r3, CONFIG_SYS_MONITOR_BASE@h
93 ori r3, r3, CONFIG_SYS_MONITOR_BASE@l
wdenkb6e4c402004-01-02 16:05:07 +000094 addi r3, r3, pll_prog_code_start - _start + EXC_OFF_SYS_RESET
95
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020096 lis r4, CONFIG_SYS_INIT_RAM_ADDR@h
97 ori r4, r4, CONFIG_SYS_INIT_RAM_ADDR@l
wdenkb6e4c402004-01-02 16:05:07 +000098 mtlr r4
99 addis r5,0,0x0
100 ori r5,r5,((pll_prog_code_end - pll_prog_code_start) >>2)
101 mtctr r5
102 addi r3, r3, -4
103 addi r4, r4, -4
1040:
105 lwzu r0,4(r3)
106 stwu r0,4(r4)
107 bdnz 0b /* copy loop */
108 blrl
109#endif
110
wdenk0db5bca2003-03-31 17:27:09 +0000111 /*
112 * Calculate absolute address in FLASH and jump there
113 *----------------------------------------------------------------------*/
114
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200115 lis r3, CONFIG_SYS_MONITOR_BASE@h
116 ori r3, r3, CONFIG_SYS_MONITOR_BASE@l
wdenk0db5bca2003-03-31 17:27:09 +0000117 addi r3, r3, in_flash - _start + EXC_OFF_SYS_RESET
118 mtlr r3
119 blr
120
121in_flash:
122
123 /* Initialize some SPRs that are hard to access from C */
124 /*----------------------------------------------------------------------*/
wdenk8bde7f72003-06-27 21:31:46 +0000125
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200126 lis r3, CONFIG_SYS_IMMR@h /* Pass IMMR as arg1 to C routine */
127 lis r2, CONFIG_SYS_INIT_SP_ADDR@h
128 ori r1, r2, CONFIG_SYS_INIT_SP_ADDR@l /* Set up the stack in internal SRAM */
wdenk0db5bca2003-03-31 17:27:09 +0000129 /* Note: R0 is still 0 here */
130 stwu r0, -4(r1) /* Clear final stack frame so that */
131 stwu r0, -4(r1) /* stack backtraces terminate cleanly */
132
133 /*
134 * Disable serialized ifetch and show cycles
135 * (i.e. set processor to normal mode) for maximum
136 * performance.
137 */
138
139 li r2, 0x0007
140 mtspr ICTRL, r2
141
142 /* Set up debug mode entry */
143
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200144 lis r2, CONFIG_SYS_DER@h
145 ori r2, r2, CONFIG_SYS_DER@l
wdenk0db5bca2003-03-31 17:27:09 +0000146 mtspr DER, r2
147
148 /* Let the C-code set up the rest */
149 /* */
150 /* Be careful to keep code relocatable ! */
151 /*----------------------------------------------------------------------*/
152
153 GET_GOT /* initialize GOT access */
Wolfgang Denk8c4734e2011-04-20 22:11:21 +0200154
wdenk0db5bca2003-03-31 17:27:09 +0000155 /* r3: IMMR */
156 bl cpu_init_f /* run low-level CPU init code (from Flash) */
157
wdenk0db5bca2003-03-31 17:27:09 +0000158 bl board_init_f /* run 1st part of board init code (from Flash) */
159
Peter Tyser52ebd9c2010-09-14 19:13:53 -0500160 /* NOTREACHED - board_init_f() does not return */
161
wdenk0db5bca2003-03-31 17:27:09 +0000162
wdenk0db5bca2003-03-31 17:27:09 +0000163 .globl _start_of_vectors
164_start_of_vectors:
165
166/* Machine check */
167 STD_EXCEPTION(0x200, MachineCheck, MachineCheckException)
168
169/* Data Storage exception. "Never" generated on the 860. */
170 STD_EXCEPTION(0x300, DataStorage, UnknownException)
171
172/* Instruction Storage exception. "Never" generated on the 860. */
173 STD_EXCEPTION(0x400, InstStorage, UnknownException)
174
175/* External Interrupt exception. */
176 STD_EXCEPTION(0x500, ExtInterrupt, external_interrupt)
177
178/* Alignment exception. */
179 . = 0x600
180Alignment:
Rafal Jaworowski02032e82007-06-22 14:58:04 +0200181 EXCEPTION_PROLOG(SRR0, SRR1)
wdenk0db5bca2003-03-31 17:27:09 +0000182 mfspr r4,DAR
183 stw r4,_DAR(r21)
184 mfspr r5,DSISR
185 stw r5,_DSISR(r21)
186 addi r3,r1,STACK_FRAME_OVERHEAD
Joakim Tjernlundfc4e1882010-01-19 14:41:55 +0100187 EXC_XFER_TEMPLATE(Alignment, AlignmentException, MSR_KERNEL, COPY_EE)
wdenk0db5bca2003-03-31 17:27:09 +0000188
189/* Program check exception */
190 . = 0x700
191ProgramCheck:
Rafal Jaworowski02032e82007-06-22 14:58:04 +0200192 EXCEPTION_PROLOG(SRR0, SRR1)
wdenk0db5bca2003-03-31 17:27:09 +0000193 addi r3,r1,STACK_FRAME_OVERHEAD
Joakim Tjernlundfc4e1882010-01-19 14:41:55 +0100194 EXC_XFER_TEMPLATE(ProgramCheck, ProgramCheckException,
195 MSR_KERNEL, COPY_EE)
wdenk0db5bca2003-03-31 17:27:09 +0000196
197 /* FPU on MPC5xx available. We will use it later.
198 */
199 STD_EXCEPTION(0x800, FPUnavailable, UnknownException)
200
201 /* I guess we could implement decrementer, and may have
202 * to someday for timekeeping.
203 */
204 STD_EXCEPTION(0x900, Decrementer, timer_interrupt)
205 STD_EXCEPTION(0xa00, Trap_0a, UnknownException)
206 STD_EXCEPTION(0xb00, Trap_0b, UnknownException)
wdenk27b207f2003-07-24 23:38:38 +0000207 STD_EXCEPTION(0xc00, SystemCall, UnknownException)
wdenk0db5bca2003-03-31 17:27:09 +0000208 STD_EXCEPTION(0xd00, SingleStep, UnknownException)
209
210 STD_EXCEPTION(0xe00, Trap_0e, UnknownException)
211 STD_EXCEPTION(0xf00, Trap_0f, UnknownException)
212
213 /* On the MPC8xx, this is a software emulation interrupt. It occurs
214 * for all unimplemented and illegal instructions.
215 */
216 STD_EXCEPTION(0x1000, SoftEmu, SoftEmuException)
217 STD_EXCEPTION(0x1100, InstructionTLBMiss, UnknownException)
218 STD_EXCEPTION(0x1200, DataTLBMiss, UnknownException)
219 STD_EXCEPTION(0x1300, InstructionTLBError, UnknownException)
220 STD_EXCEPTION(0x1400, DataTLBError, UnknownException)
221
222 STD_EXCEPTION(0x1500, Reserved5, UnknownException)
223 STD_EXCEPTION(0x1600, Reserved6, UnknownException)
224 STD_EXCEPTION(0x1700, Reserved7, UnknownException)
225 STD_EXCEPTION(0x1800, Reserved8, UnknownException)
226 STD_EXCEPTION(0x1900, Reserved9, UnknownException)
227 STD_EXCEPTION(0x1a00, ReservedA, UnknownException)
228 STD_EXCEPTION(0x1b00, ReservedB, UnknownException)
229
230 STD_EXCEPTION(0x1c00, DataBreakpoint, UnknownException)
231 STD_EXCEPTION(0x1d00, InstructionBreakpoint, DebugException)
232 STD_EXCEPTION(0x1e00, PeripheralBreakpoint, UnknownException)
233 STD_EXCEPTION(0x1f00, DevPortBreakpoint, UnknownException)
234
235
236 .globl _end_of_vectors
237_end_of_vectors:
238
239
240 . = 0x2000
241
242/*
243 * This code finishes saving the registers to the exception frame
244 * and jumps to the appropriate handler for the exception.
245 * Register r21 is pointer into trap frame, r1 has new stack pointer.
246 */
247 .globl transfer_to_handler
248transfer_to_handler:
249 stw r22,_NIP(r21)
250 lis r22,MSR_POW@h
251 andc r23,r23,r22
252 stw r23,_MSR(r21)
253 SAVE_GPR(7, r21)
254 SAVE_4GPRS(8, r21)
255 SAVE_8GPRS(12, r21)
256 SAVE_8GPRS(24, r21)
257 mflr r23
258 andi. r24,r23,0x3f00 /* get vector offset */
259 stw r24,TRAP(r21)
260 li r22,0
261 stw r22,RESULT(r21)
262 mtspr SPRG2,r22 /* r1 is now kernel sp */
263 lwz r24,0(r23) /* virtual address of handler */
264 lwz r23,4(r23) /* where to go when done */
265 mtspr SRR0,r24
266 mtspr SRR1,r20
267 mtlr r23
268 SYNC
269 rfi /* jump to handler, enable MMU */
270
271int_return:
272 mfmsr r28 /* Disable interrupts */
273 li r4,0
274 ori r4,r4,MSR_EE
275 andc r28,r28,r4
276 SYNC /* Some chip revs need this... */
277 mtmsr r28
278 SYNC
279 lwz r2,_CTR(r1)
280 lwz r0,_LINK(r1)
281 mtctr r2
282 mtlr r0
283 lwz r2,_XER(r1)
284 lwz r0,_CCR(r1)
285 mtspr XER,r2
286 mtcrf 0xFF,r0
287 REST_10GPRS(3, r1)
288 REST_10GPRS(13, r1)
289 REST_8GPRS(23, r1)
290 REST_GPR(31, r1)
291 lwz r2,_NIP(r1) /* Restore environment */
292 lwz r0,_MSR(r1)
293 mtspr SRR0,r2
294 mtspr SRR1,r0
295 lwz r0,GPR0(r1)
296 lwz r2,GPR2(r1)
297 lwz r1,GPR1(r1)
298 SYNC
299 rfi
300
wdenk8bde7f72003-06-27 21:31:46 +0000301
wdenk0db5bca2003-03-31 17:27:09 +0000302/*
303 * unsigned int get_immr (unsigned int mask)
304 *
305 * return (mask ? (IMMR & mask) : IMMR);
306 */
307 .globl get_immr
308get_immr:
309 mr r4,r3 /* save mask */
310 mfspr r3, IMMR /* IMMR */
311 cmpwi 0,r4,0 /* mask != 0 ? */
312 beq 4f
313 and r3,r3,r4 /* IMMR & mask */
3144:
315 blr
316
317 .globl get_pvr
318get_pvr:
319 mfspr r3, PVR
320 blr
321
322
323/*------------------------------------------------------------------------------*/
324
325/*
326 * void relocate_code (addr_sp, gd, addr_moni)
327 *
328 * This "function" does not return, instead it continues in RAM
329 * after relocating the monitor code.
330 *
331 * r3 = dest
332 * r4 = src
333 * r5 = length in bytes
334 * r6 = cachelinesize
335 */
336 .globl relocate_code
337relocate_code:
338 mr r1, r3 /* Set new stack pointer in SRAM */
339 mr r9, r4 /* Save copy of global data pointer in SRAM */
340 mr r10, r5 /* Save copy of monitor destination Address in SRAM */
341
Joakim Tjernlund0f8aa152010-01-19 14:41:56 +0100342 GET_GOT
wdenk0db5bca2003-03-31 17:27:09 +0000343 mr r3, r5 /* Destination Address */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200344 lis r4, CONFIG_SYS_MONITOR_BASE@h /* Source Address */
345 ori r4, r4, CONFIG_SYS_MONITOR_BASE@l
wdenk3b57fe02003-05-30 12:48:29 +0000346 lwz r5, GOT(__init_end)
347 sub r5, r5, r4
wdenk0db5bca2003-03-31 17:27:09 +0000348
349 /*
350 * Fix GOT pointer:
351 *
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200352 * New GOT-PTR = (old GOT-PTR - CONFIG_SYS_MONITOR_BASE) + Destination Address
wdenk0db5bca2003-03-31 17:27:09 +0000353 *
354 * Offset:
355 */
356 sub r15, r10, r4
357
358 /* First our own GOT */
Joakim Tjernlund0f8aa152010-01-19 14:41:56 +0100359 add r12, r12, r15
wdenk0db5bca2003-03-31 17:27:09 +0000360 /* the the one used by the C code */
361 add r30, r30, r15
362
363 /*
364 * Now relocate code
365 */
366
367 cmplw cr1,r3,r4
368 addi r0,r5,3
369 srwi. r0,r0,2
370 beq cr1,4f /* In place copy is not necessary */
371 beq 4f /* Protect against 0 count */
372 mtctr r0
373 bge cr1,2f
374
375 la r8,-4(r4)
376 la r7,-4(r3)
3771: lwzu r0,4(r8)
378 stwu r0,4(r7)
379 bdnz 1b
380 b 4f
381
3822: slwi r0,r0,2
383 add r8,r4,r0
384 add r7,r3,r0
3853: lwzu r0,-4(r8)
386 stwu r0,-4(r7)
387 bdnz 3b
388
wdenk8bde7f72003-06-27 21:31:46 +00003894: sync
wdenk0db5bca2003-03-31 17:27:09 +0000390 isync
391
392/*
393 * We are done. Do not return, instead branch to second part of board
394 * initialization, now running from RAM.
395 */
396
397 addi r0, r10, in_ram - _start + EXC_OFF_SYS_RESET
398 mtlr r0
399 blr
400
401in_ram:
402
403 /*
Joakim Tjernlund0f8aa152010-01-19 14:41:56 +0100404 * Relocation Function, r12 point to got2+0x8000
wdenk0db5bca2003-03-31 17:27:09 +0000405 *
wdenk8bde7f72003-06-27 21:31:46 +0000406 * Adjust got2 pointers, no need to check for 0, this code
407 * already puts a few entries in the table.
wdenk0db5bca2003-03-31 17:27:09 +0000408 */
409 li r0,__got2_entries@sectoff@l
410 la r3,GOT(_GOT2_TABLE_)
411 lwz r11,GOT(_GOT2_TABLE_)
412 mtctr r0
413 sub r11,r3,r11
414 addi r3,r3,-4
4151: lwzu r0,4(r3)
Joakim Tjernlundafc3ba02009-10-08 02:03:51 +0200416 cmpwi r0,0
417 beq- 2f
wdenk0db5bca2003-03-31 17:27:09 +0000418 add r0,r0,r11
419 stw r0,0(r3)
Joakim Tjernlundafc3ba02009-10-08 02:03:51 +02004202: bdnz 1b
wdenk0db5bca2003-03-31 17:27:09 +0000421
422 /*
wdenk8bde7f72003-06-27 21:31:46 +0000423 * Now adjust the fixups and the pointers to the fixups
wdenk0db5bca2003-03-31 17:27:09 +0000424 * in case we need to move ourselves again.
425 */
Joakim Tjernlundafc3ba02009-10-08 02:03:51 +0200426 li r0,__fixup_entries@sectoff@l
wdenk0db5bca2003-03-31 17:27:09 +0000427 lwz r3,GOT(_FIXUP_TABLE_)
428 cmpwi r0,0
429 mtctr r0
430 addi r3,r3,-4
431 beq 4f
4323: lwzu r4,4(r3)
433 lwzux r0,r4,r11
Joakim Tjernlundd1e0b102010-10-14 11:51:44 +0200434 cmpwi r0,0
wdenk0db5bca2003-03-31 17:27:09 +0000435 add r0,r0,r11
Joakim Tjernlund34bbf612010-11-04 19:02:00 +0100436 stw r4,0(r3)
Joakim Tjernlundd1e0b102010-10-14 11:51:44 +0200437 beq- 5f
wdenk0db5bca2003-03-31 17:27:09 +0000438 stw r0,0(r4)
Joakim Tjernlundd1e0b102010-10-14 11:51:44 +02004395: bdnz 3b
wdenk0db5bca2003-03-31 17:27:09 +00004404:
441clear_bss:
442 /*
443 * Now clear BSS segment
444 */
wdenk5d232d02003-05-22 22:52:13 +0000445 lwz r3,GOT(__bss_start)
Simon Glass3929fb02013-03-14 06:54:53 +0000446 lwz r4,GOT(__bss_end)
wdenk0db5bca2003-03-31 17:27:09 +0000447 cmplw 0, r3, r4
448 beq 6f
449
450 li r0, 0
4515:
452 stw r0, 0(r3)
453 addi r3, r3, 4
454 cmplw 0, r3, r4
455 bne 5b
4566:
457
458 mr r3, r9 /* Global Data pointer */
459 mr r4, r10 /* Destination Address */
460 bl board_init_r
461
wdenk0db5bca2003-03-31 17:27:09 +0000462 /*
463 * Copy exception vector code to low memory
464 *
465 * r3: dest_addr
466 * r7: source address, r8: end address, r9: target address
467 */
468 .globl trap_init
469trap_init:
Joakim Tjernlund0f8aa152010-01-19 14:41:56 +0100470 mflr r4 /* save link register */
471 GET_GOT
wdenk0db5bca2003-03-31 17:27:09 +0000472 lwz r7, GOT(_start)
473 lwz r8, GOT(_end_of_vectors)
474
wdenk682011f2003-06-03 23:54:09 +0000475 li r9, 0x100 /* reset vector always at 0x100 */
wdenk0db5bca2003-03-31 17:27:09 +0000476
477 cmplw 0, r7, r8
478 bgelr /* return if r7>=r8 - just in case */
wdenk0db5bca2003-03-31 17:27:09 +00004791:
480 lwz r0, 0(r7)
481 stw r0, 0(r9)
482 addi r7, r7, 4
483 addi r9, r9, 4
484 cmplw 0, r7, r8
485 bne 1b
486
487 /*
488 * relocate `hdlr' and `int_return' entries
489 */
490 li r7, .L_MachineCheck - _start + EXC_OFF_SYS_RESET
491 li r8, Alignment - _start + EXC_OFF_SYS_RESET
4922:
493 bl trap_reloc
494 addi r7, r7, 0x100 /* next exception vector */
495 cmplw 0, r7, r8
496 blt 2b
497
498 li r7, .L_Alignment - _start + EXC_OFF_SYS_RESET
499 bl trap_reloc
500
501 li r7, .L_ProgramCheck - _start + EXC_OFF_SYS_RESET
502 bl trap_reloc
503
504 li r7, .L_FPUnavailable - _start + EXC_OFF_SYS_RESET
505 li r8, SystemCall - _start + EXC_OFF_SYS_RESET
5063:
507 bl trap_reloc
508 addi r7, r7, 0x100 /* next exception vector */
509 cmplw 0, r7, r8
510 blt 3b
511
512 li r7, .L_SingleStep - _start + EXC_OFF_SYS_RESET
513 li r8, _end_of_vectors - _start + EXC_OFF_SYS_RESET
5144:
515 bl trap_reloc
516 addi r7, r7, 0x100 /* next exception vector */
517 cmplw 0, r7, r8
518 blt 4b
519
520 mtlr r4 /* restore link register */
521 blr
522
wdenkb6e4c402004-01-02 16:05:07 +0000523#if defined(CONFIG_PATI)
524/* Program the PLL */
525pll_prog_code_start:
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200526 lis r4, (CONFIG_SYS_IMMR + 0x002fc384)@h
527 ori r4, r4, (CONFIG_SYS_IMMR + 0x002fc384)@l
wdenkb6e4c402004-01-02 16:05:07 +0000528 lis r3, (0x55ccaa33)@h
529 ori r3, r3, (0x55ccaa33)@l
530 stw r3, 0(r4)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200531 lis r4, (CONFIG_SYS_IMMR + 0x002fc284)@h
532 ori r4, r4, (CONFIG_SYS_IMMR + 0x002fc284)@l
533 lis r3, CONFIG_SYS_PLPRCR@h
534 ori r3, r3, CONFIG_SYS_PLPRCR@l
wdenkb6e4c402004-01-02 16:05:07 +0000535 stw r3, 0(r4)
536 addis r3,0,0x0
537 ori r3,r3,0xA000
538 mtctr r3
539..spinlp:
540 bdnz ..spinlp /* spin loop */
541 blr
542pll_prog_code_end:
543 nop
544 blr
545#endif