aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/Kconfig16
-rw-r--r--arch/powerpc/kernel/head.S148
2 files changed, 11 insertions, 153 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 34be3247fca4..330376b74c87 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -109,10 +109,6 @@ config 40x
109config 44x 109config 44x
110 bool "AMCC 44x" 110 bool "AMCC 44x"
111 111
112config PPC64BRIDGE
113 select PPC_FPU
114 bool "POWER3, POWER4 and PPC970 (G5)"
115
116config 8xx 112config 8xx
117 bool "Freescale 8xx" 113 bool "Freescale 8xx"
118 114
@@ -125,7 +121,7 @@ endchoice
125 121
126config POWER4_ONLY 122config POWER4_ONLY
127 bool "Optimize for POWER4" 123 bool "Optimize for POWER4"
128 depends on PPC64 || PPC64BRIDGE 124 depends on PPC64
129 default n 125 default n
130 ---help--- 126 ---help---
131 Cause the compiler to optimize for POWER4/POWER5/PPC970 processors. 127 Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
@@ -134,16 +130,16 @@ config POWER4_ONLY
134 130
135config POWER3 131config POWER3
136 bool 132 bool
137 depends on PPC64 || PPC64BRIDGE 133 depends on PPC64
138 default y if !POWER4_ONLY 134 default y if !POWER4_ONLY
139 135
140config POWER4 136config POWER4
141 depends on PPC64 || PPC64BRIDGE 137 depends on PPC64
142 def_bool y 138 def_bool y
143 139
144config PPC_FPU 140config PPC_FPU
145 depends on PPC32 141 bool
146 def_bool y 142 default y if PPC64
147 143
148config BOOKE 144config BOOKE
149 bool 145 bool
@@ -317,7 +313,7 @@ config PPC_BPA
317 313
318config PPC_OF 314config PPC_OF
319 bool 315 bool
320 depends on PPC_MULTIPLATFORM || PPC_ISERIES 316 depends on PPC_MULTIPLATFORM # for now
321 default y 317 default y
322 318
323config XICS 319config XICS
diff --git a/arch/powerpc/kernel/head.S b/arch/powerpc/kernel/head.S
index d49bff1a7d51..276793e05fd0 100644
--- a/arch/powerpc/kernel/head.S
+++ b/arch/powerpc/kernel/head.S
@@ -37,19 +37,6 @@
37#include <asm/amigappc.h> 37#include <asm/amigappc.h>
38#endif 38#endif
39 39
40#ifdef CONFIG_PPC64BRIDGE
41#define LOAD_BAT(n, reg, RA, RB) \
42 ld RA,(n*32)+0(reg); \
43 ld RB,(n*32)+8(reg); \
44 mtspr SPRN_IBAT##n##U,RA; \
45 mtspr SPRN_IBAT##n##L,RB; \
46 ld RA,(n*32)+16(reg); \
47 ld RB,(n*32)+24(reg); \
48 mtspr SPRN_DBAT##n##U,RA; \
49 mtspr SPRN_DBAT##n##L,RB; \
50
51#else /* CONFIG_PPC64BRIDGE */
52
53/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 40/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
54#define LOAD_BAT(n, reg, RA, RB) \ 41#define LOAD_BAT(n, reg, RA, RB) \
55 /* see the comment for clear_bats() -- Cort */ \ 42 /* see the comment for clear_bats() -- Cort */ \
@@ -66,7 +53,6 @@
66 mtspr SPRN_DBAT##n##U,RA; \ 53 mtspr SPRN_DBAT##n##U,RA; \
67 mtspr SPRN_DBAT##n##L,RB; \ 54 mtspr SPRN_DBAT##n##L,RB; \
681: 551:
69#endif /* CONFIG_PPC64BRIDGE */
70 56
71 .text 57 .text
72 .stabs "arch/ppc/kernel/",N_SO,0,0,0f 58 .stabs "arch/ppc/kernel/",N_SO,0,0,0f
@@ -150,14 +136,6 @@ __start:
150 */ 136 */
151 bl early_init 137 bl early_init
152 138
153/*
154 * On POWER4, we first need to tweak some CPU configuration registers
155 * like real mode cache inhibit or exception base
156 */
157#ifdef CONFIG_POWER4
158 bl __970_cpu_preinit
159#endif /* CONFIG_POWER4 */
160
161#ifdef CONFIG_APUS 139#ifdef CONFIG_APUS
162/* On APUS the __va/__pa constants need to be set to the correct 140/* On APUS the __va/__pa constants need to be set to the correct
163 * values before continuing. 141 * values before continuing.
@@ -171,7 +149,6 @@ __start:
171 */ 149 */
172 bl mmu_off 150 bl mmu_off
173__after_mmu_off: 151__after_mmu_off:
174#ifndef CONFIG_POWER4
175 bl clear_bats 152 bl clear_bats
176 bl flush_tlbs 153 bl flush_tlbs
177 154
@@ -179,10 +156,6 @@ __after_mmu_off:
179#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 156#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT)
180 bl setup_disp_bat 157 bl setup_disp_bat
181#endif 158#endif
182#else /* CONFIG_POWER4 */
183 bl reloc_offset
184 bl initial_mm_power4
185#endif /* CONFIG_POWER4 */
186 159
187/* 160/*
188 * Call setup_cpu for CPU 0 and initialize 6xx Idle 161 * Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -194,10 +167,6 @@ __after_mmu_off:
194 bl reloc_offset 167 bl reloc_offset
195 bl init_idle_6xx 168 bl init_idle_6xx
196#endif /* CONFIG_6xx */ 169#endif /* CONFIG_6xx */
197#ifdef CONFIG_POWER4
198 bl reloc_offset
199 bl init_idle_power4
200#endif /* CONFIG_POWER4 */
201 170
202 171
203#ifndef CONFIG_APUS 172#ifndef CONFIG_APUS
@@ -397,13 +366,8 @@ i##n: \
397 366
398/* Data access exception. */ 367/* Data access exception. */
399 . = 0x300 368 . = 0x300
400#ifdef CONFIG_PPC64BRIDGE
401 b DataAccess
402DataAccessCont:
403#else
404DataAccess: 369DataAccess:
405 EXCEPTION_PROLOG 370 EXCEPTION_PROLOG
406#endif /* CONFIG_PPC64BRIDGE */
407 mfspr r10,SPRN_DSISR 371 mfspr r10,SPRN_DSISR
408 andis. r0,r10,0xa470 /* weird error? */ 372 andis. r0,r10,0xa470 /* weird error? */
409 bne 1f /* if not, try to put a PTE */ 373 bne 1f /* if not, try to put a PTE */
@@ -415,21 +379,11 @@ DataAccess:
415 mfspr r4,SPRN_DAR 379 mfspr r4,SPRN_DAR
416 EXC_XFER_EE_LITE(0x300, handle_page_fault) 380 EXC_XFER_EE_LITE(0x300, handle_page_fault)
417 381
418#ifdef CONFIG_PPC64BRIDGE
419/* SLB fault on data access. */
420 . = 0x380
421 b DataSegment
422#endif /* CONFIG_PPC64BRIDGE */
423 382
424/* Instruction access exception. */ 383/* Instruction access exception. */
425 . = 0x400 384 . = 0x400
426#ifdef CONFIG_PPC64BRIDGE
427 b InstructionAccess
428InstructionAccessCont:
429#else
430InstructionAccess: 385InstructionAccess:
431 EXCEPTION_PROLOG 386 EXCEPTION_PROLOG
432#endif /* CONFIG_PPC64BRIDGE */
433 andis. r0,r9,0x4000 /* no pte found? */ 387 andis. r0,r9,0x4000 /* no pte found? */
434 beq 1f /* if so, try to put a PTE */ 388 beq 1f /* if so, try to put a PTE */
435 li r3,0 /* into the hash table */ 389 li r3,0 /* into the hash table */
@@ -439,12 +393,6 @@ InstructionAccess:
439 mr r5,r9 393 mr r5,r9
440 EXC_XFER_EE_LITE(0x400, handle_page_fault) 394 EXC_XFER_EE_LITE(0x400, handle_page_fault)
441 395
442#ifdef CONFIG_PPC64BRIDGE
443/* SLB fault on instruction access. */
444 . = 0x480
445 b InstructionSegment
446#endif /* CONFIG_PPC64BRIDGE */
447
448/* External interrupt */ 396/* External interrupt */
449 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) 397 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
450 398
@@ -709,15 +657,9 @@ DataStoreTLBMiss:
709 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE) 657 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
710 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE) 658 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
711 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE) 659 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
712#ifdef CONFIG_POWER4
713 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
714 EXCEPTION(0x1700, Trap_17, altivec_assist_exception, EXC_XFER_EE)
715 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD)
716#else /* !CONFIG_POWER4 */
717 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE) 660 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
718 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD) 661 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
719 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE) 662 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
720#endif /* CONFIG_POWER4 */
721 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE) 663 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
722 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE) 664 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
723 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE) 665 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
@@ -754,28 +696,6 @@ AltiVecUnavailable:
754#endif /* CONFIG_ALTIVEC */ 696#endif /* CONFIG_ALTIVEC */
755 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception) 697 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
756 698
757#ifdef CONFIG_PPC64BRIDGE
758DataAccess:
759 EXCEPTION_PROLOG
760 b DataAccessCont
761
762InstructionAccess:
763 EXCEPTION_PROLOG
764 b InstructionAccessCont
765
766DataSegment:
767 EXCEPTION_PROLOG
768 addi r3,r1,STACK_FRAME_OVERHEAD
769 mfspr r4,SPRN_DAR
770 stw r4,_DAR(r11)
771 EXC_XFER_STD(0x380, unknown_exception)
772
773InstructionSegment:
774 EXCEPTION_PROLOG
775 addi r3,r1,STACK_FRAME_OVERHEAD
776 EXC_XFER_STD(0x480, unknown_exception)
777#endif /* CONFIG_PPC64BRIDGE */
778
779#ifdef CONFIG_ALTIVEC 699#ifdef CONFIG_ALTIVEC
780/* Note that the AltiVec support is closely modeled after the FP 700/* Note that the AltiVec support is closely modeled after the FP
781 * support. Changes to one are likely to be applicable to the 701 * support. Changes to one are likely to be applicable to the
@@ -1048,13 +968,6 @@ __secondary_start_pmac_0:
1048 968
1049 .globl __secondary_start 969 .globl __secondary_start
1050__secondary_start: 970__secondary_start:
1051#ifdef CONFIG_PPC64BRIDGE
1052 mfmsr r0
1053 clrldi r0,r0,1 /* make sure it's in 32-bit mode */
1054 SYNC
1055 MTMSRD(r0)
1056 isync
1057#endif
1058 /* Copy some CPU settings from CPU 0 */ 971 /* Copy some CPU settings from CPU 0 */
1059 bl __restore_cpu_setup 972 bl __restore_cpu_setup
1060 973
@@ -1065,10 +978,6 @@ __secondary_start:
1065 lis r3,-KERNELBASE@h 978 lis r3,-KERNELBASE@h
1066 bl init_idle_6xx 979 bl init_idle_6xx
1067#endif /* CONFIG_6xx */ 980#endif /* CONFIG_6xx */
1068#ifdef CONFIG_POWER4
1069 lis r3,-KERNELBASE@h
1070 bl init_idle_power4
1071#endif /* CONFIG_POWER4 */
1072 981
1073 /* get current_thread_info and current */ 982 /* get current_thread_info and current */
1074 lis r1,secondary_ti@ha 983 lis r1,secondary_ti@ha
@@ -1109,12 +1018,12 @@ __secondary_start:
1109 * Those generic dummy functions are kept for CPUs not 1018 * Those generic dummy functions are kept for CPUs not
1110 * included in CONFIG_6xx 1019 * included in CONFIG_6xx
1111 */ 1020 */
1112#if !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) 1021#if !defined(CONFIG_6xx)
1113_GLOBAL(__save_cpu_setup) 1022_GLOBAL(__save_cpu_setup)
1114 blr 1023 blr
1115_GLOBAL(__restore_cpu_setup) 1024_GLOBAL(__restore_cpu_setup)
1116 blr 1025 blr
1117#endif /* !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) */ 1026#endif /* !defined(CONFIG_6xx) */
1118 1027
1119 1028
1120/* 1029/*
@@ -1132,11 +1041,6 @@ load_up_mmu:
1132 tophys(r6,r6) 1041 tophys(r6,r6)
1133 lwz r6,_SDR1@l(r6) 1042 lwz r6,_SDR1@l(r6)
1134 mtspr SPRN_SDR1,r6 1043 mtspr SPRN_SDR1,r6
1135#ifdef CONFIG_PPC64BRIDGE
1136 /* clear the ASR so we only use the pseudo-segment registers. */
1137 li r6,0
1138 mtasr r6
1139#endif /* CONFIG_PPC64BRIDGE */
1140 li r0,16 /* load up segment register values */ 1044 li r0,16 /* load up segment register values */
1141 mtctr r0 /* for context 0 */ 1045 mtctr r0 /* for context 0 */
1142 lis r3,0x2000 /* Ku = 1, VSID = 0 */ 1046 lis r3,0x2000 /* Ku = 1, VSID = 0 */
@@ -1145,7 +1049,7 @@ load_up_mmu:
1145 addi r3,r3,0x111 /* increment VSID */ 1049 addi r3,r3,0x111 /* increment VSID */
1146 addis r4,r4,0x1000 /* address of next segment */ 1050 addis r4,r4,0x1000 /* address of next segment */
1147 bdnz 3b 1051 bdnz 3b
1148#ifndef CONFIG_POWER4 1052
1149/* Load the BAT registers with the values set up by MMU_init. 1053/* Load the BAT registers with the values set up by MMU_init.
1150 MMU_init takes care of whether we're on a 601 or not. */ 1054 MMU_init takes care of whether we're on a 601 or not. */
1151 mfpvr r3 1055 mfpvr r3
@@ -1158,7 +1062,7 @@ load_up_mmu:
1158 LOAD_BAT(1,r3,r4,r5) 1062 LOAD_BAT(1,r3,r4,r5)
1159 LOAD_BAT(2,r3,r4,r5) 1063 LOAD_BAT(2,r3,r4,r5)
1160 LOAD_BAT(3,r3,r4,r5) 1064 LOAD_BAT(3,r3,r4,r5)
1161#endif /* CONFIG_POWER4 */ 1065
1162 blr 1066 blr
1163 1067
1164/* 1068/*
@@ -1183,7 +1087,7 @@ start_here:
1183 li r0,0 1087 li r0,0
1184 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1) 1088 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
1185/* 1089/*
1186 * Do early bootinfo parsing, platform-specific initialization, 1090 * Do early platform-specific initialization,
1187 * and set up the MMU. 1091 * and set up the MMU.
1188 */ 1092 */
1189 mr r3,r31 1093 mr r3,r31
@@ -1266,9 +1170,6 @@ _GLOBAL(set_context)
1266 li r4,0 1170 li r4,0
1267 isync 1171 isync
12683: 11723:
1269#ifdef CONFIG_PPC64BRIDGE
1270 slbie r4
1271#endif /* CONFIG_PPC64BRIDGE */
1272 mtsrin r3,r4 1173 mtsrin r3,r4
1273 addi r3,r3,0x111 /* next VSID */ 1174 addi r3,r3,0x111 /* next VSID */
1274 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */ 1175 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */
@@ -1355,7 +1256,6 @@ mmu_off:
1355 sync 1256 sync
1356 RFI 1257 RFI
1357 1258
1358#ifndef CONFIG_POWER4
1359/* 1259/*
1360 * Use the first pair of BAT registers to map the 1st 16MB 1260 * Use the first pair of BAT registers to map the 1st 16MB
1361 * of RAM to KERNELBASE. From this point on we can't safely 1261 * of RAM to KERNELBASE. From this point on we can't safely
@@ -1363,7 +1263,6 @@ mmu_off:
1363 */ 1263 */
1364initial_bats: 1264initial_bats:
1365 lis r11,KERNELBASE@h 1265 lis r11,KERNELBASE@h
1366#ifndef CONFIG_PPC64BRIDGE
1367 mfspr r9,SPRN_PVR 1266 mfspr r9,SPRN_PVR
1368 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */ 1267 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1369 cmpwi 0,r9,1 1268 cmpwi 0,r9,1
@@ -1378,7 +1277,6 @@ initial_bats:
1378 mtspr SPRN_IBAT1L,r10 1277 mtspr SPRN_IBAT1L,r10
1379 isync 1278 isync
1380 blr 1279 blr
1381#endif /* CONFIG_PPC64BRIDGE */
1382 1280
13834: tophys(r8,r11) 12814: tophys(r8,r11)
1384#ifdef CONFIG_SMP 1282#ifdef CONFIG_SMP
@@ -1392,11 +1290,6 @@ initial_bats:
1392 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ 1290 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1393#endif /* CONFIG_APUS */ 1291#endif /* CONFIG_APUS */
1394 1292
1395#ifdef CONFIG_PPC64BRIDGE
1396 /* clear out the high 32 bits in the BAT */
1397 clrldi r11,r11,32
1398 clrldi r8,r8,32
1399#endif /* CONFIG_PPC64BRIDGE */
1400 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ 1293 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1401 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */ 1294 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
1402 mtspr SPRN_IBAT0L,r8 1295 mtspr SPRN_IBAT0L,r8
@@ -1429,37 +1322,6 @@ setup_disp_bat:
1429 1322
1430#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1323#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */
1431 1324
1432#else /* CONFIG_POWER4 */
1433/*
1434 * Load up the SDR1 and segment register values now
1435 * since we don't have the BATs.
1436 * Also make sure we are running in 32-bit mode.
1437 */
1438
1439initial_mm_power4:
1440 addis r14,r3,_SDR1@ha /* get the value from _SDR1 */
1441 lwz r14,_SDR1@l(r14) /* assume hash table below 4GB */
1442 mtspr SPRN_SDR1,r14
1443 slbia
1444 lis r4,0x2000 /* set pseudo-segment reg 12 */
1445 ori r5,r4,0x0ccc
1446 mtsr 12,r5
1447#if 0
1448 ori r5,r4,0x0888 /* set pseudo-segment reg 8 */
1449 mtsr 8,r5 /* (for access to serial port) */
1450#endif
1451#ifdef CONFIG_BOOTX_TEXT
1452 ori r5,r4,0x0999 /* set pseudo-segment reg 9 */
1453 mtsr 9,r5 /* (for access to screen) */
1454#endif
1455 mfmsr r0
1456 clrldi r0,r0,1
1457 sync
1458 mtmsr r0
1459 isync
1460 blr
1461
1462#endif /* CONFIG_POWER4 */
1463 1325
1464#ifdef CONFIG_8260 1326#ifdef CONFIG_8260
1465/* Jump into the system reset for the rom. 1327/* Jump into the system reset for the rom.