1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/init.h>
23#include <asm/processor.h>
24#include <asm/page.h>
25#include <asm/mmu.h>
26#include <asm/cache.h>
27#include <asm/pgtable.h>
28#include <asm/cputable.h>
29#include <asm/thread_info.h>
30#include <asm/ppc_asm.h>
31#include <asm/asm-offsets.h>
32#include <asm/ptrace.h>
33
34
35#ifdef CONFIG_8xx_CPU6
36#define SPRN_MI_TWC_ADDR 0x2b80
37#define SPRN_MI_RPN_ADDR 0x2d80
38#define SPRN_MD_TWC_ADDR 0x3b80
39#define SPRN_MD_RPN_ADDR 0x3d80
40
41#define MTSPR_CPU6(spr, reg, treg) \
42 li treg, spr
43 stw treg, 12(r0); \
44 lwz treg, 12(r0); \
45 mtspr spr, reg
46#else
47#define MTSPR_CPU6(spr, reg, treg) \
48 mtspr spr, reg
49#endif
50
51
52
53
54
55#ifdef CONFIG_PPC_16K_PAGES
56#define RPN_PATTERN (0x00f0 | MD_SPS16K)
57#else
58#define RPN_PATTERN 0x00f0
59#endif
60
61 __HEAD
62_ENTRY(_stext);
63_ENTRY(_start);
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 .globl __start
89__start:
90 mr r31,r3
91
92
93
94
95 bl initial_mmu
96
97
98
99
100
101turn_on_mmu:
102 mfmsr r0
103 ori r0,r0,MSR_DR|MSR_IR
104 mtspr SPRN_SRR1,r0
105 lis r0,start_here@h
106 ori r0,r0,start_here@l
107 mtspr SPRN_SRR0,r0
108 SYNC
109 rfi
110
111
112
113
114
115
116
117#define EXCEPTION_PROLOG \
118 EXCEPTION_PROLOG_0; \
119 EXCEPTION_PROLOG_1; \
120 EXCEPTION_PROLOG_2
121
122#define EXCEPTION_PROLOG_0 \
123 mtspr SPRN_SPRG_SCRATCH0,r10; \
124 mtspr SPRN_SPRG_SCRATCH1,r11; \
125 mfcr r10
126
127#define EXCEPTION_PROLOG_1 \
128 mfspr r11,SPRN_SRR1; \
129 andi. r11,r11,MSR_PR; \
130 tophys(r11,r1); \
131 beq 1f; \
132 mfspr r11,SPRN_SPRG_THREAD; \
133 lwz r11,THREAD_INFO-THREAD(r11); \
134 addi r11,r11,THREAD_SIZE; \
135 tophys(r11,r11); \
1361: subi r11,r11,INT_FRAME_SIZE
137
138
139#define EXCEPTION_PROLOG_2 \
140 CLR_TOP32(r11); \
141 stw r10,_CCR(r11); \
142 stw r12,GPR12(r11); \
143 stw r9,GPR9(r11); \
144 mfspr r10,SPRN_SPRG_SCRATCH0; \
145 stw r10,GPR10(r11); \
146 mfspr r12,SPRN_SPRG_SCRATCH1; \
147 stw r12,GPR11(r11); \
148 mflr r10; \
149 stw r10,_LINK(r11); \
150 mfspr r12,SPRN_SRR0; \
151 mfspr r9,SPRN_SRR1; \
152 stw r1,GPR1(r11); \
153 stw r1,0(r11); \
154 tovirt(r1,r11); \
155 li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); \
156 MTMSRD(r10); \
157 stw r0,GPR0(r11); \
158 SAVE_4GPRS(3, r11); \
159 SAVE_2GPRS(7, r11)
160
161
162
163
164#define EXCEPTION_EPILOG_0 \
165 mtcr r10; \
166 mfspr r10,SPRN_SPRG_SCRATCH0; \
167 mfspr r11,SPRN_SPRG_SCRATCH1
168
169
170
171
172
173
174
175
176
177
178
179
180#define EXCEPTION(n, label, hdlr, xfer) \
181 . = n; \
182label: \
183 EXCEPTION_PROLOG; \
184 addi r3,r1,STACK_FRAME_OVERHEAD; \
185 xfer(n, hdlr)
186
187#define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \
188 li r10,trap; \
189 stw r10,_TRAP(r11); \
190 li r10,MSR_KERNEL; \
191 copyee(r10, r9); \
192 bl tfer; \
193i
194 .long hdlr; \
195 .long ret
196
197#define COPY_EE(d, s) rlwimi d,s,0,16,16
198#define NOCOPY(d, s)
199
200#define EXC_XFER_STD(n, hdlr) \
201 EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \
202 ret_from_except_full)
203
204#define EXC_XFER_LITE(n, hdlr) \
205 EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \
206 ret_from_except)
207
208#define EXC_XFER_EE(n, hdlr) \
209 EXC_XFER_TEMPLATE(n, hdlr, n, COPY_EE, transfer_to_handler_full, \
210 ret_from_except_full)
211
212#define EXC_XFER_EE_LITE(n, hdlr) \
213 EXC_XFER_TEMPLATE(n, hdlr, n+1, COPY_EE, transfer_to_handler, \
214 ret_from_except)
215
216
217 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
218
219
220 . = 0x200
221MachineCheck:
222 EXCEPTION_PROLOG
223 mfspr r4,SPRN_DAR
224 stw r4,_DAR(r11)
225 li r5,RPN_PATTERN
226 mtspr SPRN_DAR,r5
227 mfspr r5,SPRN_DSISR
228 stw r5,_DSISR(r11)
229 addi r3,r1,STACK_FRAME_OVERHEAD
230 EXC_XFER_STD(0x200, machine_check_exception)
231
232
233
234
235 . = 0x300
236DataAccess:
237
238
239
240
241 . = 0x400
242InstructionAccess:
243
244
245 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
246
247
248 . = 0x600
249Alignment:
250 EXCEPTION_PROLOG
251 mfspr r4,SPRN_DAR
252 stw r4,_DAR(r11)
253 li r5,RPN_PATTERN
254 mtspr SPRN_DAR,r5
255 mfspr r5,SPRN_DSISR
256 stw r5,_DSISR(r11)
257 addi r3,r1,STACK_FRAME_OVERHEAD
258 EXC_XFER_EE(0x600, alignment_exception)
259
260
261 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
262
263
264
265 EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD)
266
267
268 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
269
270 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
271 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
272
273
274 . = 0xc00
275SystemCall:
276 EXCEPTION_PROLOG
277 EXC_XFER_EE_LITE(0xc00, DoSyscall)
278
279
280 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
281 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
282 EXCEPTION(0xf00, Trap_0f, unknown_exception, EXC_XFER_EE)
283
284
285
286
287 EXCEPTION(0x1000, SoftEmu, SoftwareEmulation, EXC_XFER_STD)
288
289 . = 0x1100
290
291
292
293
294
295
296
297
298
299
300InstructionTLBMiss:
301#ifdef CONFIG_8xx_CPU6
302 mtspr SPRN_DAR, r3
303#endif
304 EXCEPTION_PROLOG_0
305 mtspr SPRN_SPRG_SCRATCH2, r10
306 mfspr r10, SPRN_SRR0
307#ifdef CONFIG_8xx_CPU15
308 addi r11, r10, PAGE_SIZE
309 tlbie r11
310 addi r11, r10, -PAGE_SIZE
311 tlbie r11
312#endif
313
314
315
316
317#ifdef CONFIG_MODULES
318
319
320 andis. r11, r10, 0x8000
321#endif
322 mfspr r11, SPRN_M_TW
323#ifdef CONFIG_MODULES
324 beq 3f
325 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
3263:
327#endif
328
329 rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
330 lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11)
331
332
333 MTSPR_CPU6(SPRN_MI_TWC, r11, r3)
334 rlwinm r11, r11,0,0,19
335
336 rlwinm r10, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29
337 lwzx r10, r10, r11
338
339#ifdef CONFIG_SWAP
340 rlwinm r11, r10, 32-5, _PAGE_PRESENT
341 and r11, r11, r10
342 rlwimi r10, r11, 0, _PAGE_PRESENT
343#endif
344 li r11, RPN_PATTERN
345
346
347
348
349
350
351 rlwimi r10, r11, 0, 0x07f8
352 MTSPR_CPU6(SPRN_MI_RPN, r10, r3)
353
354
355#ifdef CONFIG_8xx_CPU6
356 mfspr r3, SPRN_DAR
357 mtspr SPRN_DAR, r11
358#endif
359 mfspr r10, SPRN_SPRG_SCRATCH2
360 EXCEPTION_EPILOG_0
361 rfi
362
363 . = 0x1200
364DataStoreTLBMiss:
365#ifdef CONFIG_8xx_CPU6
366 mtspr SPRN_DAR, r3
367#endif
368 EXCEPTION_PROLOG_0
369 mtspr SPRN_SPRG_SCRATCH2, r10
370 mfspr r10, SPRN_MD_EPN
371
372
373
374
375 andis. r11, r10, 0x8000
376 mfspr r11, SPRN_M_TW
377 beq 3f
378 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
3793:
380
381 rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
382 lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11)
383
384
385
386
387 rlwinm r10, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29
388 rlwimi r10, r11, 0, 0, 32 - PAGE_SHIFT - 1
389 lwz r10, 0(r10)
390
391
392
393
394
395
396
397 rlwimi r11, r10, 0, 27, 27
398
399
400
401 rlwimi r11, r10, 32-5, 30, 30
402 MTSPR_CPU6(SPRN_MD_TWC, r11, r3)
403
404
405
406
407
408
409
410
411
412
413#ifdef CONFIG_SWAP
414 rlwinm r11, r10, 32-5, _PAGE_PRESENT
415 and r11, r11, r10
416 rlwimi r10, r11, 0, _PAGE_PRESENT
417#endif
418
419
420
421
422
423
424 li r11, RPN_PATTERN
425 rlwimi r10, r11, 0, 24, 28
426 MTSPR_CPU6(SPRN_MD_RPN, r10, r3)
427
428
429#ifdef CONFIG_8xx_CPU6
430 mfspr r3, SPRN_DAR
431#endif
432 mtspr SPRN_DAR, r11
433 mfspr r10, SPRN_SPRG_SCRATCH2
434 EXCEPTION_EPILOG_0
435 rfi
436
437
438
439
440
441 . = 0x1300
442InstructionTLBError:
443 EXCEPTION_PROLOG
444 mr r4,r12
445 mr r5,r9
446 andis. r10,r5,0x4000
447 beq+ 1f
448 tlbie r4
449
4501: EXC_XFER_LITE(0x400, handle_page_fault)
451
452
453
454
455
456 . = 0x1400
457DataTLBError:
458 EXCEPTION_PROLOG_0
459
460 mfspr r11, SPRN_DAR
461 cmpwi cr0, r11, RPN_PATTERN
462 beq- FixupDAR
463DARFixed:
464 EXCEPTION_PROLOG_1
465 EXCEPTION_PROLOG_2
466 mfspr r5,SPRN_DSISR
467 stw r5,_DSISR(r11)
468 mfspr r4,SPRN_DAR
469 andis. r10,r5,0x4000
470 beq+ 1f
471 tlbie r4
4721: li r10,RPN_PATTERN
473 mtspr SPRN_DAR,r10
474
475 EXC_XFER_LITE(0x300, handle_page_fault)
476
477 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
478 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
479 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
480 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
481 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
482 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
483 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
484
485
486
487
488
489 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
490 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
491 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
492 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
493
494 . = 0x2000
495
496
497
498
499
500
501#define NO_SELF_MODIFYING_CODE
502FixupDAR:
503 mtspr SPRN_SPRG_SCRATCH2, r10
504
505 mfspr r10, SPRN_SRR0
506 andis. r11, r10, 0x8000
507 mfspr r11, SPRN_M_TW
508 beq 3f
509 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
510
5113: rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
512 lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11)
513 rlwinm r11, r11,0,0,19
514
515 rlwimi r11, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29
516 lwz r11, 0(r11)
517
518 rlwimi r11, r10, 0, 32 - PAGE_SHIFT, 31
519 lwz r11,0(r11)
520
521
522
523 xoris r10, r11, 0x7c00
524 rlwinm r10, r10, 0, 21, 5
525 cmpwi cr0, r10, 2028
526 beq+ 142f
527 cmpwi cr0, r10, 940
528 beq+ 142f
529 cmpwi cr0, r10, 108
530 beq+ 144f
531 cmpwi cr0, r10, 172
532 beq+ 142f
533 cmpwi cr0, r10, 1964
534 beq+ 142f
535141: mfspr r10,SPRN_SPRG_SCRATCH2
536 b DARFixed
537
538144: mfspr r10, SPRN_DSISR
539 rlwinm r10, r10,0,7,5
540 mtspr SPRN_DSISR, r10
541142:
542#ifndef NO_SELF_MODIFYING_CODE
543 andis. r10,r11,0x1f
544 li r10,modified_instr@l
545 dcbtst r0,r10
546 rlwinm r11,r11,0,0,20
547 oris r11,r11,640
548 ori r11,r11,532
549 stw r11,0(r10)
550 dcbf 0,r10
551 icbi 0,r10
552 mfspr r11, SPRN_SPRG_SCRATCH1
553 mfspr r10, SPRN_SPRG_SCRATCH0
554 isync
555modified_instr:
556 .space 4
557 bne+ 143f
558 subf r10,r0,r10
559143: mtdar r10
560 mfspr r10,SPRN_SPRG_SCRATCH2
561 b DARFixed
562#else
563 mfctr r10
564 mtdar r10
565 rlwinm r10, r11, 24, 24, 28
566 addi r10, r10, 150f@l
567 mtctr r10
568 xor r10, r10, r10
569 bctr
570150:
571 add r10, r10, r0 ;b 151f
572 add r10, r10, r1 ;b 151f
573 add r10, r10, r2 ;b 151f
574 add r10, r10, r3 ;b 151f
575 add r10, r10, r4 ;b 151f
576 add r10, r10, r5 ;b 151f
577 add r10, r10, r6 ;b 151f
578 add r10, r10, r7 ;b 151f
579 add r10, r10, r8 ;b 151f
580 add r10, r10, r9 ;b 151f
581 mtctr r11 ;b 154f
582 mtctr r11 ;b 153f
583 add r10, r10, r12 ;b 151f
584 add r10, r10, r13 ;b 151f
585 add r10, r10, r14 ;b 151f
586 add r10, r10, r15 ;b 151f
587 add r10, r10, r16 ;b 151f
588 add r10, r10, r17 ;b 151f
589 add r10, r10, r18 ;b 151f
590 add r10, r10, r19 ;b 151f
591 add r10, r10, r20 ;b 151f
592 add r10, r10, r21 ;b 151f
593 add r10, r10, r22 ;b 151f
594 add r10, r10, r23 ;b 151f
595 add r10, r10, r24 ;b 151f
596 add r10, r10, r25 ;b 151f
597 add r10, r10, r26 ;b 151f
598 add r10, r10, r27 ;b 151f
599 add r10, r10, r28 ;b 151f
600 add r10, r10, r29 ;b 151f
601 add r10, r10, r30 ;b 151f
602 add r10, r10, r31
603151:
604 rlwinm. r11,r11,19,24,28
605 beq 152f
606 addi r11, r11, 150b@l
607 mtctr r11
608 rlwinm r11,r11,0,16,10
609 bctr
610152:
611 mfdar r11
612 mtctr r11
613 mtdar r10
614 mfspr r10,SPRN_SPRG_SCRATCH2
615 b DARFixed
616
617
618153: mfspr r11, SPRN_SPRG_SCRATCH1
619 add r10, r10, r11
620 mfctr r11
621 b 151b
622154: mfspr r11, SPRN_SPRG_SCRATCH0
623 add r10, r10, r11
624 mfctr r11
625 b 151b
626#endif
627
628
629
630
631start_here:
632
633 lis r2,init_task@h
634 ori r2,r2,init_task@l
635
636
637 tophys(r4,r2)
638 addi r4,r4,THREAD
639 mtspr SPRN_SPRG_THREAD,r4
640
641
642 lis r1,init_thread_union@ha
643 addi r1,r1,init_thread_union@l
644 li r0,0
645 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
646
647 bl early_init
648
649
650
651
652 li r3,0
653 mr r4,r31
654 bl machine_init
655 bl MMU_init
656
657
658
659
660
661
662
663
664
665
666
667 lis r6, swapper_pg_dir@ha
668 tophys(r6,r6)
669#ifdef CONFIG_8xx_CPU6
670 lis r4, cpu6_errata_word@h
671 ori r4, r4, cpu6_errata_word@l
672 li r3, 0x3f80
673 stw r3, 12(r4)
674 lwz r3, 12(r4)
675#endif
676 mtspr SPRN_M_TW, r6
677 lis r4,2f@h
678 ori r4,r4,2f@l
679 tophys(r4,r4)
680 li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR)
681 mtspr SPRN_SRR0,r4
682 mtspr SPRN_SRR1,r3
683 rfi
684
6852:
686 SYNC
687 tlbia
688 sync
689 TLBSYNC
690
691
692
693 tovirt(r6,r6)
694 lis r5, abatron_pteptrs@h
695 ori r5, r5, abatron_pteptrs@l
696 stw r5, 0xf0(r0)
697 tophys(r5,r5)
698 stw r6, 0(r5)
699
700
701 li r4,MSR_KERNEL
702 lis r3,start_kernel@h
703 ori r3,r3,start_kernel@l
704 mtspr SPRN_SRR0,r3
705 mtspr SPRN_SRR1,r4
706 rfi
707
708
709
710
711
712
713
714
715
716initial_mmu:
717 tlbia
718
719
720
721 lis r8, MI_RSV4I@h
722 ori r8, r8, 0x1c00
723
724 mtspr SPRN_MI_CTR, r8
725
726#ifdef CONFIG_PIN_TLB
727 lis r10, (MD_RSV4I | MD_RESETVAL)@h
728 ori r10, r10, 0x1c00
729 mr r8, r10
730#else
731 lis r10, MD_RESETVAL@h
732#endif
733#ifndef CONFIG_8xx_COPYBACK
734 oris r10, r10, MD_WTDEF@h
735#endif
736 mtspr SPRN_MD_CTR, r10
737
738
739
740
741
742 lis r8, KERNELBASE@h
743 ori r8, r8, MI_EVALID
744 mtspr SPRN_MI_EPN, r8
745 mtspr SPRN_MD_EPN, r8
746 li r8, MI_PS8MEG
747 ori r8, r8, MI_SVALID
748 mtspr SPRN_MI_TWC, r8
749 mtspr SPRN_MD_TWC, r8
750 li r8, MI_BOOTINIT
751 mtspr SPRN_MI_RPN, r8
752 mtspr SPRN_MD_RPN, r8
753 lis r8, MI_Kp@h
754 mtspr SPRN_MI_AP, r8
755 mtspr SPRN_MD_AP, r8
756
757
758
759
760#ifdef CONFIG_PIN_TLB
761 addi r10, r10, 0x0100
762 mtspr SPRN_MD_CTR, r10
763#endif
764 mfspr r9, 638
765 andis. r9, r9, 0xff80
766
767 mr r8, r9
768 ori r8, r8, MD_EVALID
769 mtspr SPRN_MD_EPN, r8
770 li r8, MD_PS8MEG
771 ori r8, r8, MD_SVALID
772 mtspr SPRN_MD_TWC, r8
773 mr r8, r9
774 ori r8, r8, MI_BOOTINIT|0x2
775 mtspr SPRN_MD_RPN, r8
776
777#ifdef CONFIG_PIN_TLB
778
779
780 addi r10, r10, 0x0100
781 mtspr SPRN_MD_CTR, r10
782
783 lis r8, KERNELBASE@h
784 addis r8, r8, 0x0080
785 ori r8, r8, MI_EVALID
786 mtspr SPRN_MD_EPN, r8
787 li r9, MI_PS8MEG
788 ori r9, r9, MI_SVALID
789 mtspr SPRN_MD_TWC, r9
790 li r11, MI_BOOTINIT
791 addis r11, r11, 0x0080
792 mtspr SPRN_MD_RPN, r11
793
794 addi r10, r10, 0x0100
795 mtspr SPRN_MD_CTR, r10
796
797 addis r8, r8, 0x0080
798 mtspr SPRN_MD_EPN, r8
799 mtspr SPRN_MD_TWC, r9
800 addis r11, r11, 0x0080
801 mtspr SPRN_MD_RPN, r11
802#endif
803
804
805
806
807
808 lis r8, IDC_INVALL@h
809 mtspr SPRN_IC_CST, r8
810 mtspr SPRN_DC_CST, r8
811 lis r8, IDC_ENABLE@h
812 mtspr SPRN_IC_CST, r8
813#ifdef CONFIG_8xx_COPYBACK
814 mtspr SPRN_DC_CST, r8
815#else
816
817
818
819 lis r8, DC_SFWT@h
820 mtspr SPRN_DC_CST, r8
821 lis r8, IDC_ENABLE@h
822 mtspr SPRN_DC_CST, r8
823#endif
824 blr
825
826
827
828
829
830
831
832
833
834
835_GLOBAL(set_context)
836
837#ifdef CONFIG_BDI_SWITCH
838
839
840
841 lis r5, KERNELBASE@h
842 lwz r5, 0xf0(r5)
843 stw r4, 0x4(r5)
844#endif
845
846
847
848
849
850
851 li r5, (swapper_pg_dir-PAGE_OFFSET)@l
852 sub r4, r4, r5
853 tophys (r4, r4)
854#ifdef CONFIG_8xx_CPU6
855 lis r6, cpu6_errata_word@h
856 ori r6, r6, cpu6_errata_word@l
857 li r7, 0x3f80
858 stw r7, 12(r6)
859 lwz r7, 12(r6)
860#endif
861 mtspr SPRN_M_TW, r4
862#ifdef CONFIG_8xx_CPU6
863 li r7, 0x3380
864 stw r7, 12(r6)
865 lwz r7, 12(r6)
866#endif
867 mtspr SPRN_M_CASID, r3
868 SYNC
869 blr
870
871#ifdef CONFIG_8xx_CPU6
872
873
874
875
876
877 .globl set_dec_cpu6
878set_dec_cpu6:
879 lis r7, cpu6_errata_word@h
880 ori r7, r7, cpu6_errata_word@l
881 li r4, 0x2c00
882 stw r4, 8(r7)
883 lwz r4, 8(r7)
884 mtspr 22, r3
885 SYNC
886 blr
887#endif
888
889
890
891
892
893
894 .data
895 .globl sdata
896sdata:
897 .globl empty_zero_page
898 .align PAGE_SHIFT
899empty_zero_page:
900 .space PAGE_SIZE
901
902 .globl swapper_pg_dir
903swapper_pg_dir:
904 .space PGD_TABLE_SIZE
905
906
907
908
909abatron_pteptrs:
910 .space 8
911
912#ifdef CONFIG_8xx_CPU6
913 .globl cpu6_errata_word
914cpu6_errata_word:
915 .space 16
916#endif
917
918