Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Remove core support for 40x

Now that 40x platforms have gone, remove support
for 40x in the core of powerpc arch.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240628121201.130802-4-mpe@ellerman.id.au

authored by

Christophe Leroy and committed by
Michael Ellerman
732b32da e939da89

+14 -1728
-7
arch/powerpc/include/asm/cputable.h
··· 353 353 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE | CPU_FTR_NOEXECUTE) 354 354 #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON) 355 355 #define CPU_FTRS_8XX (CPU_FTR_NOEXECUTE) 356 - #define CPU_FTRS_40X (CPU_FTR_NOEXECUTE) 357 356 #define CPU_FTRS_44X (CPU_FTR_NOEXECUTE) 358 357 #define CPU_FTRS_440x6 (CPU_FTR_NOEXECUTE | \ 359 358 CPU_FTR_INDEXED_DCR) ··· 506 507 #ifdef CONFIG_PPC_8xx 507 508 CPU_FTRS_8XX | 508 509 #endif 509 - #ifdef CONFIG_40x 510 - CPU_FTRS_40X | 511 - #endif 512 510 #ifdef CONFIG_PPC_47x 513 511 CPU_FTRS_47X | CPU_FTR_476_DD2 | 514 512 #elif defined(CONFIG_44x) ··· 577 581 #endif 578 582 #ifdef CONFIG_PPC_8xx 579 583 CPU_FTRS_8XX & 580 - #endif 581 - #ifdef CONFIG_40x 582 - CPU_FTRS_40X & 583 584 #endif 584 585 #ifdef CONFIG_PPC_47x 585 586 CPU_FTRS_47X &
-7
arch/powerpc/include/asm/mmu.h
··· 16 16 */ 17 17 #define MMU_FTR_HPTE_TABLE ASM_CONST(0x00000001) 18 18 #define MMU_FTR_TYPE_8xx ASM_CONST(0x00000002) 19 - #define MMU_FTR_TYPE_40x ASM_CONST(0x00000004) 20 19 #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) 21 20 #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) 22 21 #define MMU_FTR_TYPE_47x ASM_CONST(0x00000020) ··· 152 153 #ifdef CONFIG_PPC_8xx 153 154 MMU_FTR_TYPE_8xx | 154 155 #endif 155 - #ifdef CONFIG_40x 156 - MMU_FTR_TYPE_40x | 157 - #endif 158 156 #ifdef CONFIG_PPC_47x 159 157 MMU_FTR_TYPE_47x | MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL | 160 158 #elif defined(CONFIG_44x) ··· 197 201 #endif 198 202 #ifdef CONFIG_PPC_8xx 199 203 #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_8xx 200 - #endif 201 - #ifdef CONFIG_40x 202 - #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_40x 203 204 #endif 204 205 #ifdef CONFIG_PPC_47x 205 206 #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_47x
-68
arch/powerpc/include/asm/nohash/32/mmu-40x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_POWERPC_MMU_40X_H_ 3 - #define _ASM_POWERPC_MMU_40X_H_ 4 - 5 - /* 6 - * PPC40x support 7 - */ 8 - 9 - #define PPC40X_TLB_SIZE 64 10 - 11 - /* 12 - * TLB entries are defined by a "high" tag portion and a "low" data 13 - * portion. On all architectures, the data portion is 32-bits. 14 - * 15 - * TLB entries are managed entirely under software control by reading, 16 - * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx 17 - * instructions. 18 - */ 19 - 20 - #define TLB_LO 1 21 - #define TLB_HI 0 22 - 23 - #define TLB_DATA TLB_LO 24 - #define TLB_TAG TLB_HI 25 - 26 - /* Tag portion */ 27 - 28 - #define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */ 29 - #define TLB_PAGESZ_MASK 0x00000380 30 - #define TLB_PAGESZ(x) (((x) & 0x7) << 7) 31 - #define PAGESZ_1K 0 32 - #define PAGESZ_4K 1 33 - #define PAGESZ_16K 2 34 - #define PAGESZ_64K 3 35 - #define PAGESZ_256K 4 36 - #define PAGESZ_1M 5 37 - #define PAGESZ_4M 6 38 - #define PAGESZ_16M 7 39 - #define TLB_VALID 0x00000040 /* Entry is valid */ 40 - 41 - /* Data portion */ 42 - 43 - #define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */ 44 - #define TLB_PERM_MASK 0x00000300 45 - #define TLB_EX 0x00000200 /* Instruction execution allowed */ 46 - #define TLB_WR 0x00000100 /* Writes permitted */ 47 - #define TLB_ZSEL_MASK 0x000000F0 48 - #define TLB_ZSEL(x) (((x) & 0xF) << 4) 49 - #define TLB_ATTR_MASK 0x0000000F 50 - #define TLB_W 0x00000008 /* Caching is write-through */ 51 - #define TLB_I 0x00000004 /* Caching is inhibited */ 52 - #define TLB_M 0x00000002 /* Memory is coherent */ 53 - #define TLB_G 0x00000001 /* Memory is guarded from prefetch */ 54 - 55 - #ifndef __ASSEMBLY__ 56 - 57 - typedef struct { 58 - unsigned int id; 59 - unsigned int active; 60 - void __user *vdso; 61 - } mm_context_t; 62 - 63 - #endif /* !__ASSEMBLY__ */ 64 - 65 - #define mmu_virtual_psize MMU_PAGE_4K 66 - #define mmu_linear_psize MMU_PAGE_256M 67 - 68 - #endif /* _ASM_POWERPC_MMU_40X_H_ */
+1 -3
arch/powerpc/include/asm/nohash/32/pgtable.h
··· 118 118 * (hardware-defined) PowerPC PTE as closely as possible. 119 119 */ 120 120 121 - #if defined(CONFIG_40x) 122 - #include <asm/nohash/32/pte-40x.h> 123 - #elif defined(CONFIG_44x) 121 + #if defined(CONFIG_44x) 124 122 #include <asm/nohash/32/pte-44x.h> 125 123 #elif defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT) 126 124 #include <asm/nohash/pte-e500.h>
-73
arch/powerpc/include/asm/nohash/32/pte-40x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_POWERPC_NOHASH_32_PTE_40x_H 3 - #define _ASM_POWERPC_NOHASH_32_PTE_40x_H 4 - #ifdef __KERNEL__ 5 - 6 - /* 7 - * At present, all PowerPC 400-class processors share a similar TLB 8 - * architecture. The instruction and data sides share a unified, 9 - * 64-entry, fully-associative TLB which is maintained totally under 10 - * software control. In addition, the instruction side has a 11 - * hardware-managed, 4-entry, fully-associative TLB which serves as a 12 - * first level to the shared TLB. These two TLBs are known as the UTLB 13 - * and ITLB, respectively (see "mmu.h" for definitions). 14 - * 15 - * There are several potential gotchas here. The 40x hardware TLBLO 16 - * field looks like this: 17 - * 18 - * 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 19 - * RPN..................... 0 0 EX WR ZSEL....... W I M G 20 - * 21 - * Where possible we make the Linux PTE bits match up with this 22 - * 23 - * - bits 20 and 21 must be cleared, because we use 4k pages (40x can 24 - * support down to 1k pages), this is done in the TLBMiss exception 25 - * handler. 26 - * - We use only zones 0 (for kernel pages) and 1 (for user pages) 27 - * of the 16 available. Bit 24-26 of the TLB are cleared in the TLB 28 - * miss handler. Bit 27 is PAGE_USER, thus selecting the correct 29 - * zone. 30 - * - PRESENT *must* be in the bottom two bits because swap PTEs 31 - * use the top 30 bits. Because 40x doesn't support SMP anyway, M is 32 - * irrelevant so we borrow it for PAGE_PRESENT. Bit 30 33 - * is cleared in the TLB miss handler before the TLB entry is loaded. 34 - * - All other bits of the PTE are loaded into TLBLO without 35 - * modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for 36 - * software PTE bits. We actually use bits 21, 24, 25, and 37 - * 30 respectively for the software bits: ACCESSED, DIRTY, RW, and 38 - * PRESENT. 39 - */ 40 - 41 - #define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */ 42 - #define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */ 43 - #define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */ 44 - #define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */ 45 - #define _PAGE_READ 0x010 /* software: read permission */ 46 - #define _PAGE_SPECIAL 0x020 /* software: Special page */ 47 - #define _PAGE_DIRTY 0x080 /* software: dirty page */ 48 - #define _PAGE_WRITE 0x100 /* hardware: WR, anded with dirty in exception */ 49 - #define _PAGE_EXEC 0x200 /* hardware: EX permission */ 50 - #define _PAGE_ACCESSED 0x400 /* software: R: page referenced */ 51 - 52 - /* No page size encoding in the linux PTE */ 53 - #define _PAGE_PSIZE 0 54 - 55 - /* cache related flags non existing on 40x */ 56 - #define _PAGE_COHERENT 0 57 - 58 - #define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */ 59 - #define _PMD_PRESENT_MASK _PMD_PRESENT 60 - #define _PMD_BAD 0x802 61 - #define _PMD_SIZE_4M 0x0c0 62 - #define _PMD_SIZE_16M 0x0e0 63 - #define _PMD_USER 0 64 - 65 - #define _PTE_NONE_MASK 0 66 - 67 - #define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED) 68 - #define _PAGE_BASE (_PAGE_BASE_NC) 69 - 70 - #include <asm/pgtable-masks.h> 71 - 72 - #endif /* __KERNEL__ */ 73 - #endif /* _ASM_POWERPC_NOHASH_32_PTE_40x_H */
+1 -4
arch/powerpc/include/asm/nohash/mmu.h
··· 2 2 #ifndef _ASM_POWERPC_NOHASH_MMU_H_ 3 3 #define _ASM_POWERPC_NOHASH_MMU_H_ 4 4 5 - #if defined(CONFIG_40x) 6 - /* 40x-style software loaded TLB */ 7 - #include <asm/nohash/32/mmu-40x.h> 8 - #elif defined(CONFIG_44x) 5 + #if defined(CONFIG_44x) 9 6 /* 44x-style software loaded TLB */ 10 7 #include <asm/nohash/32/mmu-44x.h> 11 8 #elif defined(CONFIG_PPC_E500)
+1 -24
arch/powerpc/include/asm/reg.h
··· 233 233 234 234 /* Special Purpose Registers (SPRNs)*/ 235 235 236 - #ifdef CONFIG_40x 237 - #define SPRN_PID 0x3B1 /* Process ID */ 238 - #else 239 236 #define SPRN_PID 0x030 /* Process ID */ 240 237 #ifdef CONFIG_BOOKE 241 238 #define SPRN_PID0 SPRN_PID/* Process ID Register 0 */ 242 - #endif 243 239 #endif 244 240 245 241 #define SPRN_CTR 0x009 /* Count Register */ ··· 523 527 #define SPRN_TSCR 0x399 /* Thread Switch Control Register */ 524 528 525 529 #define SPRN_DEC 0x016 /* Decrement Register */ 526 - #define SPRN_PIT 0x3DB /* Programmable Interval Timer (40x/BOOKE) */ 530 + #define SPRN_PIT 0x3DB /* Programmable Interval Timer (BOOKE) */ 527 531 528 532 #define SPRN_DER 0x095 /* Debug Enable Register */ 529 533 #define DER_RSTE 0x40000000 /* Reset Interrupt */ ··· 1112 1116 * - SPRG2 indicator that we are in RTAS 1113 1117 * - SPRG4 (603 only) pseudo TLB LRU data 1114 1118 * 1115 - * 32-bit 40x: 1116 - * - SPRG0 scratch for exception vectors 1117 - * - SPRG1 scratch for exception vectors 1118 - * - SPRG2 scratch for exception vectors 1119 - * - SPRG4 scratch for exception vectors (not 403) 1120 - * - SPRG5 scratch for exception vectors (not 403) 1121 - * - SPRG6 scratch for exception vectors (not 403) 1122 - * - SPRG7 scratch for exception vectors (not 403) 1123 - * 1124 1119 * 32-bit 440 and FSL BookE: 1125 1120 * - SPRG0 scratch for exception vectors 1126 1121 * - SPRG1 scratch for exception vectors (*) ··· 1201 1214 #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 1202 1215 #define SPRN_SPRG_SCRATCH2 SPRN_SPRG2 1203 1216 #define SPRN_SPRG_603_LRU SPRN_SPRG4 1204 - #endif 1205 - 1206 - #ifdef CONFIG_40x 1207 - #define SPRN_SPRG_SCRATCH0 SPRN_SPRG0 1208 - #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 1209 - #define SPRN_SPRG_SCRATCH2 SPRN_SPRG2 1210 - #define SPRN_SPRG_SCRATCH3 SPRN_SPRG4 1211 - #define SPRN_SPRG_SCRATCH4 SPRN_SPRG5 1212 - #define SPRN_SPRG_SCRATCH5 SPRN_SPRG6 1213 - #define SPRN_SPRG_SCRATCH6 SPRN_SPRG7 1214 1217 #endif 1215 1218 1216 1219 #ifdef CONFIG_BOOKE
+2 -111
arch/powerpc/include/asm/reg_booke.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 /* 3 3 * Contains register definitions common to the Book E PowerPC 4 - * specification. Notice that while the IBM-40x series of CPUs 5 - * are not true Book E PowerPCs, they borrowed a number of features 6 - * before Book E was finalized, and are included here as well. Unfortunately, 7 - * they sometimes used different locations than true Book E CPUs did. 4 + * specification. 8 5 * 9 6 * Copyright 2009-2010 Freescale Semiconductor, Inc. 10 7 */ ··· 39 42 #define MSR_KERNEL (MSR_ | MSR_64BIT) 40 43 #define MSR_USER32 (MSR_ | MSR_PR | MSR_EE) 41 44 #define MSR_USER64 (MSR_USER32 | MSR_64BIT) 42 - #elif defined (CONFIG_40x) 43 - #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE) 44 - #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) 45 45 #else 46 46 #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE) 47 47 #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) ··· 151 157 #define SPRN_TLB3CFG 0x2B3 /* TLB 3 Config Register */ 152 158 #define SPRN_EPR 0x2BE /* External Proxy Register */ 153 159 #define SPRN_CCR1 0x378 /* Core Configuration Register 1 */ 154 - #define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */ 155 160 #define SPRN_MAS7 0x3B0 /* MMU Assist Register 7 */ 156 161 #define SPRN_MMUCR 0x3B2 /* MMU Control Register */ 157 162 #define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */ ··· 159 166 #define SPRN_SGR 0x3B9 /* Storage Guarded Register */ 160 167 #define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */ 161 168 #define SPRN_SLER 0x3BB /* Little-endian real mode */ 162 - #define SPRN_SU0R 0x3BC /* "User 0" real mode (40x) */ 163 169 #define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */ 164 170 #define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */ 165 171 #define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */ ··· 175 183 #define SPRN_SVR 0x3FF /* System Version Register */ 176 184 177 185 /* 178 - * SPRs which have conflicting definitions on true Book E versus classic, 179 - * or IBM 40x. 186 + * SPRs which have conflicting definitions on true Book E versus classic. 180 187 */ 181 - #ifdef CONFIG_BOOKE 182 188 #define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */ 183 189 #define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */ 184 190 #define SPRN_DEAR 0x03D /* Data Error Address Register */ ··· 191 201 #define SPRN_DAC2 0x13D /* Data Address Compare 2 */ 192 202 #define SPRN_TSR 0x150 /* Timer Status Register */ 193 203 #define SPRN_TCR 0x154 /* Timer Control Register */ 194 - #endif /* Book E */ 195 - #ifdef CONFIG_40x 196 - #define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */ 197 - #define SPRN_ESR 0x3D4 /* Exception Syndrome Register */ 198 - #define SPRN_DEAR 0x3D5 /* Data Error Address Register */ 199 - #define SPRN_TSR 0x3D8 /* Timer Status Register */ 200 - #define SPRN_TCR 0x3DA /* Timer Control Register */ 201 - #define SPRN_SRR2 0x3DE /* Save/Restore Register 2 */ 202 - #define SPRN_SRR3 0x3DF /* Save/Restore Register 3 */ 203 - #define SPRN_DBSR 0x3F0 /* Debug Status Register */ 204 - #define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */ 205 - #define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */ 206 - #define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */ 207 - #define SPRN_CSRR0 SPRN_SRR2 /* Critical Save and Restore Register 0 */ 208 - #define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */ 209 - #endif 210 204 #define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */ 211 205 212 206 /* Bit definitions for CCR1. */ ··· 270 296 #endif 271 297 272 298 /* Bit definitions for the DBSR. */ 273 - /* 274 - * DBSR bits which have conflicting definitions on true Book E versus IBM 40x. 275 - */ 276 - #ifdef CONFIG_BOOKE 277 299 #define DBSR_IDE 0x80000000 /* Imprecise Debug Event */ 278 300 #define DBSR_MRR 0x30000000 /* Most Recent Reset */ 279 301 #define DBSR_IC 0x08000000 /* Instruction Completion */ ··· 289 319 #define DBSR_CRET 0x00000020 /* Critical Return Debug Event */ 290 320 #define DBSR_IAC12ATS 0x00000002 /* Instr Address Compare 1/2 Toggle */ 291 321 #define DBSR_IAC34ATS 0x00000001 /* Instr Address Compare 3/4 Toggle */ 292 - #endif 293 - #ifdef CONFIG_40x 294 - #define DBSR_IC 0x80000000 /* Instruction Completion */ 295 - #define DBSR_BT 0x40000000 /* Branch taken */ 296 - #define DBSR_IRPT 0x20000000 /* Exception Debug Event */ 297 - #define DBSR_TIE 0x10000000 /* Trap Instruction debug Event */ 298 - #define DBSR_IAC1 0x04000000 /* Instruction Address Compare 1 Event */ 299 - #define DBSR_IAC2 0x02000000 /* Instruction Address Compare 2 Event */ 300 - #define DBSR_IAC3 0x00080000 /* Instruction Address Compare 3 Event */ 301 - #define DBSR_IAC4 0x00040000 /* Instruction Address Compare 4 Event */ 302 - #define DBSR_DAC1R 0x01000000 /* Data Address Compare 1 Read Event */ 303 - #define DBSR_DAC1W 0x00800000 /* Data Address Compare 1 Write Event */ 304 - #define DBSR_DAC2R 0x00400000 /* Data Address Compare 2 Read Event */ 305 - #define DBSR_DAC2W 0x00200000 /* Data Address Compare 2 Write Event */ 306 - #endif 307 322 308 323 /* Bit definitions related to the ESR. */ 309 324 #define ESR_MCI 0x80000000 /* Machine Check - Instruction */ ··· 310 355 #define ESR_SPV 0x00000080 /* Signal Processing operation */ 311 356 312 357 /* Bit definitions related to the DBCR0. */ 313 - #if defined(CONFIG_40x) 314 - #define DBCR0_EDM 0x80000000 /* External Debug Mode */ 315 - #define DBCR0_IDM 0x40000000 /* Internal Debug Mode */ 316 - #define DBCR0_RST 0x30000000 /* all the bits in the RST field */ 317 - #define DBCR0_RST_SYSTEM 0x30000000 /* System Reset */ 318 - #define DBCR0_RST_CHIP 0x20000000 /* Chip Reset */ 319 - #define DBCR0_RST_CORE 0x10000000 /* Core Reset */ 320 - #define DBCR0_RST_NONE 0x00000000 /* No Reset */ 321 - #define DBCR0_IC 0x08000000 /* Instruction Completion */ 322 - #define DBCR0_ICMP DBCR0_IC 323 - #define DBCR0_BT 0x04000000 /* Branch Taken */ 324 - #define DBCR0_BRT DBCR0_BT 325 - #define DBCR0_EDE 0x02000000 /* Exception Debug Event */ 326 - #define DBCR0_IRPT DBCR0_EDE 327 - #define DBCR0_TDE 0x01000000 /* TRAP Debug Event */ 328 - #define DBCR0_IA1 0x00800000 /* Instr Addr compare 1 enable */ 329 - #define DBCR0_IAC1 DBCR0_IA1 330 - #define DBCR0_IA2 0x00400000 /* Instr Addr compare 2 enable */ 331 - #define DBCR0_IAC2 DBCR0_IA2 332 - #define DBCR0_IA12 0x00200000 /* Instr Addr 1-2 range enable */ 333 - #define DBCR0_IA12X 0x00100000 /* Instr Addr 1-2 range eXclusive */ 334 - #define DBCR0_IA3 0x00080000 /* Instr Addr compare 3 enable */ 335 - #define DBCR0_IAC3 DBCR0_IA3 336 - #define DBCR0_IA4 0x00040000 /* Instr Addr compare 4 enable */ 337 - #define DBCR0_IAC4 DBCR0_IA4 338 - #define DBCR0_IA34 0x00020000 /* Instr Addr 3-4 range Enable */ 339 - #define DBCR0_IA34X 0x00010000 /* Instr Addr 3-4 range eXclusive */ 340 - #define DBCR0_IA12T 0x00008000 /* Instr Addr 1-2 range Toggle */ 341 - #define DBCR0_IA34T 0x00004000 /* Instr Addr 3-4 range Toggle */ 342 - #define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */ 343 - 344 - #define dbcr_iac_range(task) ((task)->thread.debug.dbcr0) 345 - #define DBCR_IAC12I DBCR0_IA12 /* Range Inclusive */ 346 - #define DBCR_IAC12X (DBCR0_IA12 | DBCR0_IA12X) /* Range Exclusive */ 347 - #define DBCR_IAC12MODE (DBCR0_IA12 | DBCR0_IA12X) /* IAC 1-2 Mode Bits */ 348 - #define DBCR_IAC34I DBCR0_IA34 /* Range Inclusive */ 349 - #define DBCR_IAC34X (DBCR0_IA34 | DBCR0_IA34X) /* Range Exclusive */ 350 - #define DBCR_IAC34MODE (DBCR0_IA34 | DBCR0_IA34X) /* IAC 3-4 Mode Bits */ 351 - 352 - /* Bit definitions related to the DBCR1. */ 353 - #define DBCR1_DAC1R 0x80000000 /* DAC1 Read Debug Event */ 354 - #define DBCR1_DAC2R 0x40000000 /* DAC2 Read Debug Event */ 355 - #define DBCR1_DAC1W 0x20000000 /* DAC1 Write Debug Event */ 356 - #define DBCR1_DAC2W 0x10000000 /* DAC2 Write Debug Event */ 357 - 358 - #define dbcr_dac(task) ((task)->thread.debug.dbcr1) 359 - #define DBCR_DAC1R DBCR1_DAC1R 360 - #define DBCR_DAC1W DBCR1_DAC1W 361 - #define DBCR_DAC2R DBCR1_DAC2R 362 - #define DBCR_DAC2W DBCR1_DAC2W 363 - 364 - /* 365 - * Are there any active Debug Events represented in the 366 - * Debug Control Registers? 367 - */ 368 - #define DBCR0_ACTIVE_EVENTS (DBCR0_ICMP | DBCR0_IAC1 | DBCR0_IAC2 | \ 369 - DBCR0_IAC3 | DBCR0_IAC4) 370 - #define DBCR1_ACTIVE_EVENTS (DBCR1_DAC1R | DBCR1_DAC2R | \ 371 - DBCR1_DAC1W | DBCR1_DAC2W) 372 - #define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \ 373 - ((dbcr1) & DBCR1_ACTIVE_EVENTS)) 374 - 375 - #elif defined(CONFIG_BOOKE) 376 358 #define DBCR0_EDM 0x80000000 /* External Debug Mode */ 377 359 #define DBCR0_IDM 0x40000000 /* Internal Debug Mode */ 378 360 #define DBCR0_RST 0x30000000 /* all the bits in the RST field */ ··· 410 518 411 519 #define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \ 412 520 ((dbcr1) & DBCR1_ACTIVE_EVENTS)) 413 - #endif /* #elif defined(CONFIG_BOOKE) */ 414 521 415 522 /* Bit definitions related to the TCR. */ 416 523 #define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */
+1 -6
arch/powerpc/include/asm/time.h
··· 58 58 */ 59 59 static inline u64 get_dec(void) 60 60 { 61 - if (IS_ENABLED(CONFIG_40x)) 62 - return mfspr(SPRN_PIT); 63 - 64 61 return mfspr(SPRN_DEC); 65 62 } 66 63 ··· 68 71 */ 69 72 static inline void set_dec(u64 val) 70 73 { 71 - if (IS_ENABLED(CONFIG_40x)) 72 - mtspr(SPRN_PIT, (u32)val); 73 - else if (IS_ENABLED(CONFIG_BOOKE)) 74 + if (IS_ENABLED(CONFIG_BOOKE)) 74 75 mtspr(SPRN_DEC, val); 75 76 else 76 77 mtspr(SPRN_DEC, val - 1);
-1
arch/powerpc/include/asm/udbg.h
··· 44 44 void __init udbg_init_rtas_console(void); 45 45 void __init udbg_init_btext(void); 46 46 void __init udbg_init_44x_as1(void); 47 - void __init udbg_init_40x_realmode(void); 48 47 void __init udbg_init_cpm(void); 49 48 void __init udbg_init_usbgecko(void); 50 49 void __init udbg_init_memcons(void);
-1
arch/powerpc/kernel/Makefile
··· 123 123 124 124 obj-$(CONFIG_PPC64) += head_64.o 125 125 obj-$(CONFIG_PPC_BOOK3S_32) += head_book3s_32.o 126 - obj-$(CONFIG_40x) += head_40x.o 127 126 obj-$(CONFIG_44x) += head_44x.o 128 127 obj-$(CONFIG_PPC_8xx) += head_8xx.o 129 128 obj-$(CONFIG_PPC_85xx) += head_85xx.o
-4
arch/powerpc/kernel/cpu_specs.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 2 3 - #ifdef CONFIG_40x 4 - #include "cpu_specs_40x.h" 5 - #endif 6 - 7 3 #ifdef CONFIG_PPC_47x 8 4 #include "cpu_specs_47x.h" 9 5 #elif defined(CONFIG_44x)
-280
arch/powerpc/kernel/cpu_specs_40x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) 4 - */ 5 - 6 - static struct cpu_spec cpu_specs[] __initdata = { 7 - { /* STB 04xxx */ 8 - .pvr_mask = 0xffff0000, 9 - .pvr_value = 0x41810000, 10 - .cpu_name = "STB04xxx", 11 - .cpu_features = CPU_FTRS_40X, 12 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 13 - PPC_FEATURE_HAS_4xxMAC, 14 - .mmu_features = MMU_FTR_TYPE_40x, 15 - .icache_bsize = 32, 16 - .dcache_bsize = 32, 17 - .machine_check = machine_check_4xx, 18 - .platform = "ppc405", 19 - }, 20 - { /* NP405L */ 21 - .pvr_mask = 0xffff0000, 22 - .pvr_value = 0x41610000, 23 - .cpu_name = "NP405L", 24 - .cpu_features = CPU_FTRS_40X, 25 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 26 - PPC_FEATURE_HAS_4xxMAC, 27 - .mmu_features = MMU_FTR_TYPE_40x, 28 - .icache_bsize = 32, 29 - .dcache_bsize = 32, 30 - .machine_check = machine_check_4xx, 31 - .platform = "ppc405", 32 - }, 33 - { /* NP4GS3 */ 34 - .pvr_mask = 0xffff0000, 35 - .pvr_value = 0x40B10000, 36 - .cpu_name = "NP4GS3", 37 - .cpu_features = CPU_FTRS_40X, 38 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 39 - PPC_FEATURE_HAS_4xxMAC, 40 - .mmu_features = MMU_FTR_TYPE_40x, 41 - .icache_bsize = 32, 42 - .dcache_bsize = 32, 43 - .machine_check = machine_check_4xx, 44 - .platform = "ppc405", 45 - }, 46 - { /* NP405H */ 47 - .pvr_mask = 0xffff0000, 48 - .pvr_value = 0x41410000, 49 - .cpu_name = "NP405H", 50 - .cpu_features = CPU_FTRS_40X, 51 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 52 - PPC_FEATURE_HAS_4xxMAC, 53 - .mmu_features = MMU_FTR_TYPE_40x, 54 - .icache_bsize = 32, 55 - .dcache_bsize = 32, 56 - .machine_check = machine_check_4xx, 57 - .platform = "ppc405", 58 - }, 59 - { /* 405GPr */ 60 - .pvr_mask = 0xffff0000, 61 - .pvr_value = 0x50910000, 62 - .cpu_name = "405GPr", 63 - .cpu_features = CPU_FTRS_40X, 64 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 65 - PPC_FEATURE_HAS_4xxMAC, 66 - .mmu_features = MMU_FTR_TYPE_40x, 67 - .icache_bsize = 32, 68 - .dcache_bsize = 32, 69 - .machine_check = machine_check_4xx, 70 - .platform = "ppc405", 71 - }, 72 - { /* STBx25xx */ 73 - .pvr_mask = 0xffff0000, 74 - .pvr_value = 0x51510000, 75 - .cpu_name = "STBx25xx", 76 - .cpu_features = CPU_FTRS_40X, 77 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 78 - PPC_FEATURE_HAS_4xxMAC, 79 - .mmu_features = MMU_FTR_TYPE_40x, 80 - .icache_bsize = 32, 81 - .dcache_bsize = 32, 82 - .machine_check = machine_check_4xx, 83 - .platform = "ppc405", 84 - }, 85 - { /* 405LP */ 86 - .pvr_mask = 0xffff0000, 87 - .pvr_value = 0x41F10000, 88 - .cpu_name = "405LP", 89 - .cpu_features = CPU_FTRS_40X, 90 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 91 - .mmu_features = MMU_FTR_TYPE_40x, 92 - .icache_bsize = 32, 93 - .dcache_bsize = 32, 94 - .machine_check = machine_check_4xx, 95 - .platform = "ppc405", 96 - }, 97 - { /* 405EP */ 98 - .pvr_mask = 0xffff0000, 99 - .pvr_value = 0x51210000, 100 - .cpu_name = "405EP", 101 - .cpu_features = CPU_FTRS_40X, 102 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 103 - PPC_FEATURE_HAS_4xxMAC, 104 - .mmu_features = MMU_FTR_TYPE_40x, 105 - .icache_bsize = 32, 106 - .dcache_bsize = 32, 107 - .machine_check = machine_check_4xx, 108 - .platform = "ppc405", 109 - }, 110 - { /* 405EX Rev. A/B with Security */ 111 - .pvr_mask = 0xffff000f, 112 - .pvr_value = 0x12910007, 113 - .cpu_name = "405EX Rev. A/B", 114 - .cpu_features = CPU_FTRS_40X, 115 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 116 - PPC_FEATURE_HAS_4xxMAC, 117 - .mmu_features = MMU_FTR_TYPE_40x, 118 - .icache_bsize = 32, 119 - .dcache_bsize = 32, 120 - .machine_check = machine_check_4xx, 121 - .platform = "ppc405", 122 - }, 123 - { /* 405EX Rev. C without Security */ 124 - .pvr_mask = 0xffff000f, 125 - .pvr_value = 0x1291000d, 126 - .cpu_name = "405EX Rev. C", 127 - .cpu_features = CPU_FTRS_40X, 128 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 129 - PPC_FEATURE_HAS_4xxMAC, 130 - .mmu_features = MMU_FTR_TYPE_40x, 131 - .icache_bsize = 32, 132 - .dcache_bsize = 32, 133 - .machine_check = machine_check_4xx, 134 - .platform = "ppc405", 135 - }, 136 - { /* 405EX Rev. C with Security */ 137 - .pvr_mask = 0xffff000f, 138 - .pvr_value = 0x1291000f, 139 - .cpu_name = "405EX Rev. C", 140 - .cpu_features = CPU_FTRS_40X, 141 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 142 - PPC_FEATURE_HAS_4xxMAC, 143 - .mmu_features = MMU_FTR_TYPE_40x, 144 - .icache_bsize = 32, 145 - .dcache_bsize = 32, 146 - .machine_check = machine_check_4xx, 147 - .platform = "ppc405", 148 - }, 149 - { /* 405EX Rev. D without Security */ 150 - .pvr_mask = 0xffff000f, 151 - .pvr_value = 0x12910003, 152 - .cpu_name = "405EX Rev. D", 153 - .cpu_features = CPU_FTRS_40X, 154 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 155 - PPC_FEATURE_HAS_4xxMAC, 156 - .mmu_features = MMU_FTR_TYPE_40x, 157 - .icache_bsize = 32, 158 - .dcache_bsize = 32, 159 - .machine_check = machine_check_4xx, 160 - .platform = "ppc405", 161 - }, 162 - { /* 405EX Rev. D with Security */ 163 - .pvr_mask = 0xffff000f, 164 - .pvr_value = 0x12910005, 165 - .cpu_name = "405EX Rev. D", 166 - .cpu_features = CPU_FTRS_40X, 167 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 168 - PPC_FEATURE_HAS_4xxMAC, 169 - .mmu_features = MMU_FTR_TYPE_40x, 170 - .icache_bsize = 32, 171 - .dcache_bsize = 32, 172 - .machine_check = machine_check_4xx, 173 - .platform = "ppc405", 174 - }, 175 - { /* 405EXr Rev. A/B without Security */ 176 - .pvr_mask = 0xffff000f, 177 - .pvr_value = 0x12910001, 178 - .cpu_name = "405EXr Rev. A/B", 179 - .cpu_features = CPU_FTRS_40X, 180 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 181 - PPC_FEATURE_HAS_4xxMAC, 182 - .mmu_features = MMU_FTR_TYPE_40x, 183 - .icache_bsize = 32, 184 - .dcache_bsize = 32, 185 - .machine_check = machine_check_4xx, 186 - .platform = "ppc405", 187 - }, 188 - { /* 405EXr Rev. C without Security */ 189 - .pvr_mask = 0xffff000f, 190 - .pvr_value = 0x12910009, 191 - .cpu_name = "405EXr Rev. C", 192 - .cpu_features = CPU_FTRS_40X, 193 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 194 - PPC_FEATURE_HAS_4xxMAC, 195 - .mmu_features = MMU_FTR_TYPE_40x, 196 - .icache_bsize = 32, 197 - .dcache_bsize = 32, 198 - .machine_check = machine_check_4xx, 199 - .platform = "ppc405", 200 - }, 201 - { /* 405EXr Rev. C with Security */ 202 - .pvr_mask = 0xffff000f, 203 - .pvr_value = 0x1291000b, 204 - .cpu_name = "405EXr Rev. C", 205 - .cpu_features = CPU_FTRS_40X, 206 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 207 - PPC_FEATURE_HAS_4xxMAC, 208 - .mmu_features = MMU_FTR_TYPE_40x, 209 - .icache_bsize = 32, 210 - .dcache_bsize = 32, 211 - .machine_check = machine_check_4xx, 212 - .platform = "ppc405", 213 - }, 214 - { /* 405EXr Rev. D without Security */ 215 - .pvr_mask = 0xffff000f, 216 - .pvr_value = 0x12910000, 217 - .cpu_name = "405EXr Rev. D", 218 - .cpu_features = CPU_FTRS_40X, 219 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 220 - PPC_FEATURE_HAS_4xxMAC, 221 - .mmu_features = MMU_FTR_TYPE_40x, 222 - .icache_bsize = 32, 223 - .dcache_bsize = 32, 224 - .machine_check = machine_check_4xx, 225 - .platform = "ppc405", 226 - }, 227 - { /* 405EXr Rev. D with Security */ 228 - .pvr_mask = 0xffff000f, 229 - .pvr_value = 0x12910002, 230 - .cpu_name = "405EXr Rev. D", 231 - .cpu_features = CPU_FTRS_40X, 232 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 233 - PPC_FEATURE_HAS_4xxMAC, 234 - .mmu_features = MMU_FTR_TYPE_40x, 235 - .icache_bsize = 32, 236 - .dcache_bsize = 32, 237 - .machine_check = machine_check_4xx, 238 - .platform = "ppc405", 239 - }, 240 - { 241 - /* 405EZ */ 242 - .pvr_mask = 0xffff0000, 243 - .pvr_value = 0x41510000, 244 - .cpu_name = "405EZ", 245 - .cpu_features = CPU_FTRS_40X, 246 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 247 - PPC_FEATURE_HAS_4xxMAC, 248 - .mmu_features = MMU_FTR_TYPE_40x, 249 - .icache_bsize = 32, 250 - .dcache_bsize = 32, 251 - .machine_check = machine_check_4xx, 252 - .platform = "ppc405", 253 - }, 254 - { /* APM8018X */ 255 - .pvr_mask = 0xffff0000, 256 - .pvr_value = 0x7ff11432, 257 - .cpu_name = "APM8018X", 258 - .cpu_features = CPU_FTRS_40X, 259 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 260 - PPC_FEATURE_HAS_4xxMAC, 261 - .mmu_features = MMU_FTR_TYPE_40x, 262 - .icache_bsize = 32, 263 - .dcache_bsize = 32, 264 - .machine_check = machine_check_4xx, 265 - .platform = "ppc405", 266 - }, 267 - { /* default match */ 268 - .pvr_mask = 0x00000000, 269 - .pvr_value = 0x00000000, 270 - .cpu_name = "(generic 40x PPC)", 271 - .cpu_features = CPU_FTRS_40X, 272 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 273 - PPC_FEATURE_HAS_4xxMAC, 274 - .mmu_features = MMU_FTR_TYPE_40x, 275 - .icache_bsize = 32, 276 - .dcache_bsize = 32, 277 - .machine_check = machine_check_4xx, 278 - .platform = "ppc405", 279 - } 280 - };
-40
arch/powerpc/kernel/entry_32.S
··· 158 158 1: REST_GPR(2, r1) 159 159 REST_GPR(1, r1) 160 160 rfi 161 - #ifdef CONFIG_40x 162 - b . /* Prevent prefetch past rfi */ 163 - #endif 164 161 165 162 3: mtcr r5 166 163 lwz r4,_CTR(r1) ··· 234 237 REST_GPR(12, r11) 235 238 REST_GPR(11, r11) 236 239 rfi 237 - #ifdef CONFIG_40x 238 - b . /* Prevent prefetch past rfi */ 239 - #endif 240 240 _ASM_NOKPROBE_SYMBOL(fast_exception_return) 241 241 242 242 /* aargh, a nonrecoverable interrupt, panic */ ··· 290 296 REST_GPR(0, r1) 291 297 REST_GPR(1, r1) 292 298 rfi 293 - #ifdef CONFIG_40x 294 - b . /* Prevent prefetch past rfi */ 295 - #endif 296 299 297 300 .Lrestore_nvgprs: 298 301 REST_NVGPRS(r1) ··· 337 346 REST_GPR(0, r1) 338 347 REST_GPR(1, r1) 339 348 rfi 340 - #ifdef CONFIG_40x 341 - b . /* Prevent prefetch past rfi */ 342 - #endif 343 349 344 350 1: /* 345 351 * Emulate stack store with update. New r1 value was already calculated ··· 363 375 mfspr r9, SPRN_SPRG_SCRATCH0 364 376 #endif 365 377 rfi 366 - #ifdef CONFIG_40x 367 - b . /* Prevent prefetch past rfi */ 368 - #endif 369 378 _ASM_NOKPROBE_SYMBOL(interrupt_return) 370 379 371 380 #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) ··· 380 395 * time of the critical interrupt. 381 396 * 382 397 */ 383 - #ifdef CONFIG_40x 384 - #define PPC_40x_TURN_OFF_MSR_DR \ 385 - /* avoid any possible TLB misses here by turning off MSR.DR, we \ 386 - * assume the instructions here are mapped by a pinned TLB entry */ \ 387 - li r10,MSR_IR; \ 388 - mtmsr r10; \ 389 - isync; \ 390 - tophys(r1, r1); 391 - #else 392 - #define PPC_40x_TURN_OFF_MSR_DR 393 - #endif 394 398 395 399 #define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \ 396 400 REST_NVGPRS(r1); \ ··· 397 423 mtlr r11; \ 398 424 lwz r10,_CCR(r1); \ 399 425 mtcrf 0xff,r10; \ 400 - PPC_40x_TURN_OFF_MSR_DR; \ 401 426 lwz r9,_DEAR(r1); \ 402 427 lwz r10,_ESR(r1); \ 403 428 mtspr SPRN_DEAR,r9; \ ··· 443 470 #else 444 471 #define RESTORE_MMU_REGS 445 472 #endif 446 - 447 - #ifdef CONFIG_40x 448 - .globl ret_from_crit_exc 449 - ret_from_crit_exc: 450 - lis r9,crit_srr0@ha; 451 - lwz r9,crit_srr0@l(r9); 452 - lis r10,crit_srr1@ha; 453 - lwz r10,crit_srr1@l(r10); 454 - mtspr SPRN_SRR0,r9; 455 - mtspr SPRN_SRR1,r10; 456 - RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI) 457 - _ASM_NOKPROBE_SYMBOL(ret_from_crit_exc) 458 - #endif /* CONFIG_40x */ 459 473 460 474 #ifdef CONFIG_BOOKE 461 475 .globl ret_from_crit_exc
+1 -11
arch/powerpc/kernel/head_32.h
··· 21 21 mtspr SPRN_SPRG_SCRATCH1,r11 22 22 mfspr r10, SPRN_SPRG_THREAD 23 23 .if \handle_dar_dsisr 24 - #ifdef CONFIG_40x 25 - mfspr r11, SPRN_DEAR 26 - #else 27 24 mfspr r11, SPRN_DAR 28 - #endif 29 25 stw r11, DAR(r10) 30 - #ifdef CONFIG_40x 31 - mfspr r11, SPRN_ESR 32 - #else 33 26 mfspr r11, SPRN_DSISR 34 - #endif 35 27 stw r11, DSISR(r10) 36 28 .endif 37 29 mfspr r11, SPRN_SRR0 ··· 88 96 .endif 89 97 lwz r9, SRR1(r12) 90 98 lwz r12, SRR0(r12) 91 - #ifdef CONFIG_40x 92 - rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */ 93 - #elif defined(CONFIG_PPC_8xx) 99 + #ifdef CONFIG_PPC_8xx 94 100 mtspr SPRN_EID, r2 /* Set MSR_RI */ 95 101 #else 96 102 li r10, MSR_KERNEL /* can take exceptions */
-721
arch/powerpc/kernel/head_40x.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 - * Initial PowerPC version. 5 - * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu> 6 - * Rewritten for PReP 7 - * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au> 8 - * Low-level exception handers, MMU support, and rewrite. 9 - * Copyright (c) 1997 Dan Malek <dmalek@jlc.net> 10 - * PowerPC 8xx modifications. 11 - * Copyright (c) 1998-1999 TiVo, Inc. 12 - * PowerPC 403GCX modifications. 13 - * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu> 14 - * PowerPC 403GCX/405GP modifications. 15 - * Copyright 2000 MontaVista Software Inc. 16 - * PPC405 modifications 17 - * PowerPC 403GCX/405GP modifications. 18 - * Author: MontaVista Software, Inc. 19 - * frank_rowand@mvista.com or source@mvista.com 20 - * debbie_chu@mvista.com 21 - * 22 - * Module name: head_4xx.S 23 - * 24 - * Description: 25 - * Kernel execution entry point code. 26 - */ 27 - 28 - #include <linux/init.h> 29 - #include <linux/pgtable.h> 30 - #include <linux/sizes.h> 31 - #include <linux/linkage.h> 32 - 33 - #include <asm/processor.h> 34 - #include <asm/page.h> 35 - #include <asm/mmu.h> 36 - #include <asm/cputable.h> 37 - #include <asm/thread_info.h> 38 - #include <asm/ppc_asm.h> 39 - #include <asm/asm-offsets.h> 40 - #include <asm/ptrace.h> 41 - 42 - #include "head_32.h" 43 - 44 - /* As with the other PowerPC ports, it is expected that when code 45 - * execution begins here, the following registers contain valid, yet 46 - * optional, information: 47 - * 48 - * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.) 49 - * r4 - Starting address of the init RAM disk 50 - * r5 - Ending address of the init RAM disk 51 - * r6 - Start of kernel command line string (e.g. "mem=96m") 52 - * r7 - End of kernel command line string 53 - * 54 - * This is all going to change RSN when we add bi_recs....... -- Dan 55 - */ 56 - __HEAD 57 - _GLOBAL(_stext); 58 - _GLOBAL(_start); 59 - 60 - mr r31,r3 /* save device tree ptr */ 61 - 62 - /* We have to turn on the MMU right away so we get cache modes 63 - * set correctly. 64 - */ 65 - bl initial_mmu 66 - 67 - /* We now have the lower 16 Meg mapped into TLB entries, and the caches 68 - * ready to work. 69 - */ 70 - turn_on_mmu: 71 - lis r0,MSR_KERNEL@h 72 - ori r0,r0,MSR_KERNEL@l 73 - mtspr SPRN_SRR1,r0 74 - lis r0,start_here@h 75 - ori r0,r0,start_here@l 76 - mtspr SPRN_SRR0,r0 77 - rfi /* enables MMU */ 78 - b . /* prevent prefetch past rfi */ 79 - 80 - /* 81 - * This area is used for temporarily saving registers during the 82 - * critical exception prolog. 83 - */ 84 - . = 0xc0 85 - crit_save: 86 - _GLOBAL(crit_r10) 87 - .space 4 88 - _GLOBAL(crit_r11) 89 - .space 4 90 - _GLOBAL(crit_srr0) 91 - .space 4 92 - _GLOBAL(crit_srr1) 93 - .space 4 94 - _GLOBAL(crit_r1) 95 - .space 4 96 - _GLOBAL(crit_dear) 97 - .space 4 98 - _GLOBAL(crit_esr) 99 - .space 4 100 - 101 - /* 102 - * Exception prolog for critical exceptions. This is a little different 103 - * from the normal exception prolog above since a critical exception 104 - * can potentially occur at any point during normal exception processing. 105 - * Thus we cannot use the same SPRG registers as the normal prolog above. 106 - * Instead we use a couple of words of memory at low physical addresses. 107 - * This is OK since we don't support SMP on these processors. 108 - */ 109 - .macro CRITICAL_EXCEPTION_PROLOG trapno name 110 - stw r10,crit_r10@l(0) /* save two registers to work with */ 111 - stw r11,crit_r11@l(0) 112 - mfspr r10,SPRN_SRR0 113 - mfspr r11,SPRN_SRR1 114 - stw r10,crit_srr0@l(0) 115 - stw r11,crit_srr1@l(0) 116 - mfspr r10,SPRN_DEAR 117 - mfspr r11,SPRN_ESR 118 - stw r10,crit_dear@l(0) 119 - stw r11,crit_esr@l(0) 120 - mfcr r10 /* save CR in r10 for now */ 121 - mfspr r11,SPRN_SRR3 /* check whether user or kernel */ 122 - andi. r11,r11,MSR_PR 123 - lis r11,(critirq_ctx-PAGE_OFFSET)@ha 124 - lwz r11,(critirq_ctx-PAGE_OFFSET)@l(r11) 125 - beq 1f 126 - /* COMING FROM USER MODE */ 127 - mfspr r11,SPRN_SPRG_THREAD /* if from user, start at top of */ 128 - lwz r11,TASK_STACK-THREAD(r11) /* this thread's kernel stack */ 129 - 1: stw r1,crit_r1@l(0) 130 - addi r1,r11,THREAD_SIZE-INT_FRAME_SIZE /* Alloc an excpt frm */ 131 - LOAD_REG_IMMEDIATE(r11, MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)) /* re-enable MMU */ 132 - mtspr SPRN_SRR1, r11 133 - lis r11, 1f@h 134 - ori r11, r11, 1f@l 135 - mtspr SPRN_SRR0, r11 136 - rfi 137 - 138 - .text 139 - 1: 140 - \name\()_virt: 141 - lwz r11,crit_r1@l(0) 142 - stw r11,GPR1(r1) 143 - stw r11,0(r1) 144 - mr r11,r1 145 - stw r10,_CCR(r11) /* save various registers */ 146 - stw r12,GPR12(r11) 147 - stw r9,GPR9(r11) 148 - mflr r10 149 - stw r10,_LINK(r11) 150 - lis r9,PAGE_OFFSET@ha 151 - lwz r10,crit_r10@l(r9) 152 - lwz r12,crit_r11@l(r9) 153 - stw r10,GPR10(r11) 154 - stw r12,GPR11(r11) 155 - lwz r12,crit_dear@l(r9) 156 - lwz r9,crit_esr@l(r9) 157 - stw r12,_DEAR(r11) /* since they may have had stuff */ 158 - stw r9,_ESR(r11) /* exception was taken */ 159 - mfspr r12,SPRN_SRR2 160 - mfspr r9,SPRN_SRR3 161 - rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */ 162 - COMMON_EXCEPTION_PROLOG_END \trapno + 2 163 - _ASM_NOKPROBE_SYMBOL(\name\()_virt) 164 - .endm 165 - 166 - /* 167 - * State at this point: 168 - * r9 saved in stack frame, now saved SRR3 & ~MSR_WE 169 - * r10 saved in crit_r10 and in stack frame, trashed 170 - * r11 saved in crit_r11 and in stack frame, 171 - * now phys stack/exception frame pointer 172 - * r12 saved in stack frame, now saved SRR2 173 - * CR saved in stack frame, CR0.EQ = !SRR3.PR 174 - * LR, DEAR, ESR in stack frame 175 - * r1 saved in stack frame, now virt stack/excframe pointer 176 - * r0, r3-r8 saved in stack frame 177 - */ 178 - 179 - /* 180 - * Exception vectors. 181 - */ 182 - #define CRITICAL_EXCEPTION(n, label, hdlr) \ 183 - START_EXCEPTION(n, label); \ 184 - CRITICAL_EXCEPTION_PROLOG n label; \ 185 - prepare_transfer_to_handler; \ 186 - bl hdlr; \ 187 - b ret_from_crit_exc 188 - 189 - /* 190 - * 0x0100 - Critical Interrupt Exception 191 - */ 192 - CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception) 193 - 194 - /* 195 - * 0x0200 - Machine Check Exception 196 - */ 197 - CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception) 198 - 199 - /* 200 - * 0x0300 - Data Storage Exception 201 - * This happens for just a few reasons. U0 set (but we don't do that), 202 - * or zone protection fault (user violation, write to protected page). 203 - * The other Data TLB exceptions bail out to this point 204 - * if they can't resolve the lightweight TLB fault. 205 - */ 206 - START_EXCEPTION(0x0300, DataStorage) 207 - EXCEPTION_PROLOG 0x300 DataStorage handle_dar_dsisr=1 208 - prepare_transfer_to_handler 209 - bl do_page_fault 210 - b interrupt_return 211 - 212 - /* 213 - * 0x0400 - Instruction Storage Exception 214 - * This is caused by a fetch from non-execute or guarded pages. 215 - */ 216 - START_EXCEPTION(0x0400, InstructionAccess) 217 - EXCEPTION_PROLOG 0x400 InstructionAccess 218 - li r5,0 219 - stw r5, _ESR(r11) /* Zero ESR */ 220 - stw r12, _DEAR(r11) /* SRR0 as DEAR */ 221 - prepare_transfer_to_handler 222 - bl do_page_fault 223 - b interrupt_return 224 - 225 - /* 0x0500 - External Interrupt Exception */ 226 - EXCEPTION(0x0500, HardwareInterrupt, do_IRQ) 227 - 228 - /* 0x0600 - Alignment Exception */ 229 - START_EXCEPTION(0x0600, Alignment) 230 - EXCEPTION_PROLOG 0x600 Alignment handle_dar_dsisr=1 231 - prepare_transfer_to_handler 232 - bl alignment_exception 233 - REST_NVGPRS(r1) 234 - b interrupt_return 235 - 236 - /* 0x0700 - Program Exception */ 237 - START_EXCEPTION(0x0700, ProgramCheck) 238 - EXCEPTION_PROLOG 0x700 ProgramCheck handle_dar_dsisr=1 239 - prepare_transfer_to_handler 240 - bl program_check_exception 241 - REST_NVGPRS(r1) 242 - b interrupt_return 243 - 244 - EXCEPTION(0x0800, Trap_08, unknown_exception) 245 - EXCEPTION(0x0900, Trap_09, unknown_exception) 246 - EXCEPTION(0x0A00, Trap_0A, unknown_exception) 247 - EXCEPTION(0x0B00, Trap_0B, unknown_exception) 248 - 249 - /* 0x0C00 - System Call Exception */ 250 - START_EXCEPTION(0x0C00, SystemCall) 251 - SYSCALL_ENTRY 0xc00 252 - /* Trap_0D is commented out to get more space for system call exception */ 253 - 254 - /* EXCEPTION(0x0D00, Trap_0D, unknown_exception) */ 255 - EXCEPTION(0x0E00, Trap_0E, unknown_exception) 256 - EXCEPTION(0x0F00, Trap_0F, unknown_exception) 257 - 258 - /* 0x1000 - Programmable Interval Timer (PIT) Exception */ 259 - START_EXCEPTION(0x1000, DecrementerTrap) 260 - b Decrementer 261 - 262 - /* 0x1010 - Fixed Interval Timer (FIT) Exception */ 263 - START_EXCEPTION(0x1010, FITExceptionTrap) 264 - b FITException 265 - 266 - /* 0x1020 - Watchdog Timer (WDT) Exception */ 267 - START_EXCEPTION(0x1020, WDTExceptionTrap) 268 - b WDTException 269 - 270 - /* 0x1100 - Data TLB Miss Exception 271 - * As the name implies, translation is not in the MMU, so search the 272 - * page tables and fix it. The only purpose of this function is to 273 - * load TLB entries from the page table if they exist. 274 - */ 275 - START_EXCEPTION(0x1100, DTLBMiss) 276 - mtspr SPRN_SPRG_SCRATCH5, r10 /* Save some working registers */ 277 - mtspr SPRN_SPRG_SCRATCH6, r11 278 - mtspr SPRN_SPRG_SCRATCH3, r12 279 - mtspr SPRN_SPRG_SCRATCH4, r9 280 - mfcr r12 281 - mfspr r9, SPRN_PID 282 - rlwimi r12, r9, 0, 0xff 283 - mfspr r10, SPRN_DEAR /* Get faulting address */ 284 - 285 - /* If we are faulting a kernel address, we have to use the 286 - * kernel page tables. 287 - */ 288 - lis r11, PAGE_OFFSET@h 289 - cmplw r10, r11 290 - blt+ 3f 291 - lis r11, swapper_pg_dir@h 292 - ori r11, r11, swapper_pg_dir@l 293 - li r9, 0 294 - mtspr SPRN_PID, r9 /* TLB will have 0 TID */ 295 - b 4f 296 - 297 - /* Get the PGD for the current thread. 298 - */ 299 - 3: 300 - mfspr r11,SPRN_SPRG_THREAD 301 - lwz r11,PGDIR(r11) 302 - #ifdef CONFIG_PPC_KUAP 303 - rlwinm. r9, r9, 0, 0xff 304 - beq 5f /* Kuap fault */ 305 - #endif 306 - 4: 307 - tophys(r11, r11) 308 - rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ 309 - lwz r11, 0(r11) /* Get L1 entry */ 310 - andi. r9, r11, _PMD_PRESENT /* Check if it points to a PTE page */ 311 - beq 2f /* Bail if no table */ 312 - 313 - rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ 314 - lwz r11, 0(r11) /* Get Linux PTE */ 315 - li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_READ 316 - andc. r9, r9, r11 /* Check permission */ 317 - bne 5f 318 - 319 - rlwinm r9, r11, 1, _PAGE_WRITE /* dirty => w */ 320 - and r9, r9, r11 /* hwwrite = dirty & w */ 321 - rlwimi r11, r9, 0, _PAGE_WRITE /* replace w by hwwrite */ 322 - 323 - /* Create TLB tag. This is the faulting address plus a static 324 - * set of bits. These are size, valid, E, U0. 325 - */ 326 - li r9, 0x00c0 327 - rlwimi r10, r9, 0, 20, 31 328 - 329 - b finish_tlb_load 330 - 331 - 2: /* Check for possible large-page pmd entry */ 332 - rlwinm. r9, r11, 2, 22, 24 333 - beq 5f 334 - 335 - /* Create TLB tag. This is the faulting address, plus a static 336 - * set of bits (valid, E, U0) plus the size from the PMD. 337 - */ 338 - ori r9, r9, 0x40 339 - rlwimi r10, r9, 0, 20, 31 340 - 341 - b finish_tlb_load 342 - 343 - 5: 344 - /* The bailout. Restore registers to pre-exception conditions 345 - * and call the heavyweights to help us out. 346 - */ 347 - mtspr SPRN_PID, r12 348 - mtcrf 0x80, r12 349 - mfspr r9, SPRN_SPRG_SCRATCH4 350 - mfspr r12, SPRN_SPRG_SCRATCH3 351 - mfspr r11, SPRN_SPRG_SCRATCH6 352 - mfspr r10, SPRN_SPRG_SCRATCH5 353 - b DataStorage 354 - 355 - /* 0x1200 - Instruction TLB Miss Exception 356 - * Nearly the same as above, except we get our information from different 357 - * registers and bailout to a different point. 358 - */ 359 - START_EXCEPTION(0x1200, ITLBMiss) 360 - mtspr SPRN_SPRG_SCRATCH5, r10 /* Save some working registers */ 361 - mtspr SPRN_SPRG_SCRATCH6, r11 362 - mtspr SPRN_SPRG_SCRATCH3, r12 363 - mtspr SPRN_SPRG_SCRATCH4, r9 364 - mfcr r12 365 - mfspr r9, SPRN_PID 366 - rlwimi r12, r9, 0, 0xff 367 - mfspr r10, SPRN_SRR0 /* Get faulting address */ 368 - 369 - /* If we are faulting a kernel address, we have to use the 370 - * kernel page tables. 371 - */ 372 - lis r11, PAGE_OFFSET@h 373 - cmplw r10, r11 374 - blt+ 3f 375 - lis r11, swapper_pg_dir@h 376 - ori r11, r11, swapper_pg_dir@l 377 - li r9, 0 378 - mtspr SPRN_PID, r9 /* TLB will have 0 TID */ 379 - b 4f 380 - 381 - /* Get the PGD for the current thread. 382 - */ 383 - 3: 384 - mfspr r11,SPRN_SPRG_THREAD 385 - lwz r11,PGDIR(r11) 386 - #ifdef CONFIG_PPC_KUAP 387 - rlwinm. r9, r9, 0, 0xff 388 - beq 5f /* Kuap fault */ 389 - #endif 390 - 4: 391 - tophys(r11, r11) 392 - rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ 393 - lwz r11, 0(r11) /* Get L1 entry */ 394 - andi. r9, r11, _PMD_PRESENT /* Check if it points to a PTE page */ 395 - beq 2f /* Bail if no table */ 396 - 397 - rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ 398 - lwz r11, 0(r11) /* Get Linux PTE */ 399 - li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC 400 - andc. r9, r9, r11 /* Check permission */ 401 - bne 5f 402 - 403 - rlwinm r9, r11, 1, _PAGE_WRITE /* dirty => w */ 404 - and r9, r9, r11 /* hwwrite = dirty & w */ 405 - rlwimi r11, r9, 0, _PAGE_WRITE /* replace w by hwwrite */ 406 - 407 - /* Create TLB tag. This is the faulting address plus a static 408 - * set of bits. These are size, valid, E, U0. 409 - */ 410 - li r9, 0x00c0 411 - rlwimi r10, r9, 0, 20, 31 412 - 413 - b finish_tlb_load 414 - 415 - 2: /* Check for possible large-page pmd entry */ 416 - rlwinm. r9, r11, 2, 22, 24 417 - beq 5f 418 - 419 - /* Create TLB tag. This is the faulting address, plus a static 420 - * set of bits (valid, E, U0) plus the size from the PMD. 421 - */ 422 - ori r9, r9, 0x40 423 - rlwimi r10, r9, 0, 20, 31 424 - 425 - b finish_tlb_load 426 - 427 - 5: 428 - /* The bailout. Restore registers to pre-exception conditions 429 - * and call the heavyweights to help us out. 430 - */ 431 - mtspr SPRN_PID, r12 432 - mtcrf 0x80, r12 433 - mfspr r9, SPRN_SPRG_SCRATCH4 434 - mfspr r12, SPRN_SPRG_SCRATCH3 435 - mfspr r11, SPRN_SPRG_SCRATCH6 436 - mfspr r10, SPRN_SPRG_SCRATCH5 437 - b InstructionAccess 438 - 439 - EXCEPTION(0x1300, Trap_13, unknown_exception) 440 - EXCEPTION(0x1400, Trap_14, unknown_exception) 441 - EXCEPTION(0x1500, Trap_15, unknown_exception) 442 - EXCEPTION(0x1600, Trap_16, unknown_exception) 443 - EXCEPTION(0x1700, Trap_17, unknown_exception) 444 - EXCEPTION(0x1800, Trap_18, unknown_exception) 445 - EXCEPTION(0x1900, Trap_19, unknown_exception) 446 - EXCEPTION(0x1A00, Trap_1A, unknown_exception) 447 - EXCEPTION(0x1B00, Trap_1B, unknown_exception) 448 - EXCEPTION(0x1C00, Trap_1C, unknown_exception) 449 - EXCEPTION(0x1D00, Trap_1D, unknown_exception) 450 - EXCEPTION(0x1E00, Trap_1E, unknown_exception) 451 - EXCEPTION(0x1F00, Trap_1F, unknown_exception) 452 - 453 - /* Check for a single step debug exception while in an exception 454 - * handler before state has been saved. This is to catch the case 455 - * where an instruction that we are trying to single step causes 456 - * an exception (eg ITLB/DTLB miss) and thus the first instruction of 457 - * the exception handler generates a single step debug exception. 458 - * 459 - * If we get a debug trap on the first instruction of an exception handler, 460 - * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is 461 - * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). 462 - * The exception handler was handling a non-critical interrupt, so it will 463 - * save (and later restore) the MSR via SPRN_SRR1, which will still have 464 - * the MSR_DE bit set. 465 - */ 466 - /* 0x2000 - Debug Exception */ 467 - START_EXCEPTION(0x2000, DebugTrap) 468 - CRITICAL_EXCEPTION_PROLOG 0x2000 DebugTrap 469 - 470 - /* 471 - * If this is a single step or branch-taken exception in an 472 - * exception entry sequence, it was probably meant to apply to 473 - * the code where the exception occurred (since exception entry 474 - * doesn't turn off DE automatically). We simulate the effect 475 - * of turning off DE on entry to an exception handler by turning 476 - * off DE in the SRR3 value and clearing the debug status. 477 - */ 478 - mfspr r10,SPRN_DBSR /* check single-step/branch taken */ 479 - andis. r10,r10,DBSR_IC@h 480 - beq+ 2f 481 - 482 - andi. r10,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */ 483 - beq 1f /* branch and fix it up */ 484 - 485 - mfspr r10,SPRN_SRR2 /* Faulting instruction address */ 486 - cmplwi r10,0x2100 487 - bgt+ 2f /* address above exception vectors */ 488 - 489 - /* here it looks like we got an inappropriate debug exception. */ 490 - 1: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */ 491 - lis r10,DBSR_IC@h /* clear the IC event */ 492 - mtspr SPRN_DBSR,r10 493 - /* restore state and get out */ 494 - lwz r10,_CCR(r11) 495 - lwz r0,GPR0(r11) 496 - lwz r1,GPR1(r11) 497 - mtcrf 0x80,r10 498 - mtspr SPRN_SRR2,r12 499 - mtspr SPRN_SRR3,r9 500 - lwz r9,GPR9(r11) 501 - lwz r12,GPR12(r11) 502 - lwz r10,crit_r10@l(0) 503 - lwz r11,crit_r11@l(0) 504 - rfci 505 - b . 506 - 507 - /* continue normal handling for a critical exception... */ 508 - 2: mfspr r4,SPRN_DBSR 509 - stw r4,_ESR(r11) /* DebugException takes DBSR in _ESR */ 510 - prepare_transfer_to_handler 511 - bl DebugException 512 - b ret_from_crit_exc 513 - 514 - /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */ 515 - __HEAD 516 - Decrementer: 517 - EXCEPTION_PROLOG 0x1000 Decrementer 518 - lis r0,TSR_PIS@h 519 - mtspr SPRN_TSR,r0 /* Clear the PIT exception */ 520 - prepare_transfer_to_handler 521 - bl timer_interrupt 522 - b interrupt_return 523 - 524 - /* Fixed Interval Timer (FIT) Exception. (from 0x1010) */ 525 - __HEAD 526 - FITException: 527 - EXCEPTION_PROLOG 0x1010 FITException 528 - prepare_transfer_to_handler 529 - bl unknown_exception 530 - b interrupt_return 531 - 532 - /* Watchdog Timer (WDT) Exception. (from 0x1020) */ 533 - __HEAD 534 - WDTException: 535 - CRITICAL_EXCEPTION_PROLOG 0x1020 WDTException 536 - prepare_transfer_to_handler 537 - bl WatchdogException 538 - b ret_from_crit_exc 539 - 540 - /* Other PowerPC processors, namely those derived from the 6xx-series 541 - * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved. 542 - * However, for the 4xx-series processors these are neither defined nor 543 - * reserved. 544 - */ 545 - 546 - __HEAD 547 - /* Damn, I came up one instruction too many to fit into the 548 - * exception space :-). Both the instruction and data TLB 549 - * miss get to this point to load the TLB. 550 - * r10 - TLB_TAG value 551 - * r11 - Linux PTE 552 - * r9 - available to use 553 - * PID - loaded with proper value when we get here 554 - * Upon exit, we reload everything and RFI. 555 - * Actually, it will fit now, but oh well.....a common place 556 - * to load the TLB. 557 - */ 558 - tlb_4xx_index: 559 - .long 0 560 - finish_tlb_load: 561 - /* 562 - * Clear out the software-only bits in the PTE to generate the 563 - * TLB_DATA value. These are the bottom 2 bits of the RPM, the 564 - * 4 bits of the zone field, and M. 565 - */ 566 - li r9, 0x0cf2 567 - andc r11, r11, r9 568 - rlwimi r11, r10, 8, 24, 27 /* Copy 4 upper address bit into zone */ 569 - 570 - /* load the next available TLB index. */ 571 - lwz r9, tlb_4xx_index@l(0) 572 - addi r9, r9, 1 573 - andi. r9, r9, PPC40X_TLB_SIZE - 1 574 - stw r9, tlb_4xx_index@l(0) 575 - 576 - tlbwe r11, r9, TLB_DATA /* Load TLB LO */ 577 - tlbwe r10, r9, TLB_TAG /* Load TLB HI */ 578 - 579 - /* Done...restore registers and get out of here. 580 - */ 581 - mtspr SPRN_PID, r12 582 - mtcrf 0x80, r12 583 - mfspr r9, SPRN_SPRG_SCRATCH4 584 - mfspr r12, SPRN_SPRG_SCRATCH3 585 - mfspr r11, SPRN_SPRG_SCRATCH6 586 - mfspr r10, SPRN_SPRG_SCRATCH5 587 - rfi /* Should sync shadow TLBs */ 588 - b . /* prevent prefetch past rfi */ 589 - 590 - /* This is where the main kernel code starts. 591 - */ 592 - start_here: 593 - 594 - /* ptr to current */ 595 - lis r2,init_task@h 596 - ori r2,r2,init_task@l 597 - 598 - /* ptr to phys current thread */ 599 - tophys(r4,r2) 600 - addi r4,r4,THREAD /* init task's THREAD */ 601 - mtspr SPRN_SPRG_THREAD,r4 602 - 603 - /* stack */ 604 - lis r1,init_thread_union@ha 605 - addi r1,r1,init_thread_union@l 606 - li r0,0 607 - stwu r0,THREAD_SIZE-STACK_FRAME_MIN_SIZE(r1) 608 - 609 - bl early_init /* We have to do this with MMU on */ 610 - 611 - /* 612 - * Decide what sort of machine this is and initialize the MMU. 613 - */ 614 - #ifdef CONFIG_KASAN 615 - bl kasan_early_init 616 - #endif 617 - li r3,0 618 - mr r4,r31 619 - bl machine_init 620 - bl MMU_init 621 - 622 - /* Go back to running unmapped so we can load up new values 623 - * and change to using our exception vectors. 624 - * On the 4xx, all we have to do is invalidate the TLB to clear 625 - * the old 16M byte TLB mappings. 626 - */ 627 - lis r4,2f@h 628 - ori r4,r4,2f@l 629 - tophys(r4,r4) 630 - lis r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@h 631 - ori r3,r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@l 632 - mtspr SPRN_SRR0,r4 633 - mtspr SPRN_SRR1,r3 634 - rfi 635 - b . /* prevent prefetch past rfi */ 636 - 637 - /* Load up the kernel context */ 638 - 2: 639 - sync /* Flush to memory before changing TLB */ 640 - tlbia 641 - isync /* Flush shadow TLBs */ 642 - 643 - /* set up the PTE pointers for the Abatron bdiGDB. 644 - */ 645 - lis r6, swapper_pg_dir@h 646 - ori r6, r6, swapper_pg_dir@l 647 - lis r5, abatron_pteptrs@h 648 - ori r5, r5, abatron_pteptrs@l 649 - stw r5, 0xf0(0) /* Must match your Abatron config file */ 650 - tophys(r5,r5) 651 - stw r6, 0(r5) 652 - 653 - /* Now turn on the MMU for real! */ 654 - lis r4,MSR_KERNEL@h 655 - ori r4,r4,MSR_KERNEL@l 656 - lis r3,start_kernel@h 657 - ori r3,r3,start_kernel@l 658 - mtspr SPRN_SRR0,r3 659 - mtspr SPRN_SRR1,r4 660 - rfi /* enable MMU and jump to start_kernel */ 661 - b . /* prevent prefetch past rfi */ 662 - 663 - /* Set up the initial MMU state so we can do the first level of 664 - * kernel initialization. This maps the first 32 MBytes of memory 1:1 665 - * virtual to physical and more importantly sets the cache mode. 666 - */ 667 - SYM_FUNC_START_LOCAL(initial_mmu) 668 - tlbia /* Invalidate all TLB entries */ 669 - isync 670 - 671 - /* We should still be executing code at physical address 0x0000xxxx 672 - * at this point. However, start_here is at virtual address 673 - * 0xC000xxxx. So, set up a TLB mapping to cover this once 674 - * translation is enabled. 675 - */ 676 - 677 - lis r3,KERNELBASE@h /* Load the kernel virtual address */ 678 - ori r3,r3,KERNELBASE@l 679 - tophys(r4,r3) /* Load the kernel physical address */ 680 - 681 - iccci r0,r3 /* Invalidate the i-cache before use */ 682 - 683 - /* Load the kernel PID. 684 - */ 685 - li r0,0 686 - mtspr SPRN_PID,r0 687 - sync 688 - 689 - /* Configure and load one entry into TLB slots 63 */ 690 - clrrwi r4,r4,10 /* Mask off the real page number */ 691 - ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */ 692 - 693 - clrrwi r3,r3,10 /* Mask off the effective page number */ 694 - ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M)) 695 - 696 - li r0,63 /* TLB slot 63 */ 697 - 698 - tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ 699 - tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ 700 - 701 - li r0,62 /* TLB slot 62 */ 702 - addis r4,r4,SZ_16M@h 703 - addis r3,r3,SZ_16M@h 704 - tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ 705 - tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ 706 - 707 - isync 708 - 709 - /* Establish the exception vector base 710 - */ 711 - lis r4,KERNELBASE@h /* EVPR only uses the high 16-bits */ 712 - tophys(r0,r4) /* Use the physical address */ 713 - mtspr SPRN_EVPR,r0 714 - 715 - blr 716 - SYM_FUNC_END(initial_mmu) 717 - 718 - _GLOBAL(abort) 719 - mfspr r13,SPRN_DBCR0 720 - oris r13,r13,DBCR0_RST_SYSTEM@h 721 - mtspr SPRN_DBCR0,r13
+1 -2
arch/powerpc/kernel/head_booke.h
··· 145 145 b transfer_to_syscall /* jump to handler */ 146 146 .endm 147 147 148 - /* To handle the additional exception priority levels on 40x and Book-E 148 + /* To handle the additional exception priority levels on Book-E 149 149 * processors we allocate a stack per additional priority level. 150 150 * 151 - * On 40x critical is the only additional level 152 151 * On 44x/e500 we have critical and machine check 153 152 * 154 153 * Additionally we reserve a SPRG for each priority level so we can free up a
-40
arch/powerpc/kernel/misc_32.S
··· 176 176 177 177 #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_PPC_BOOK3S_32 */ 178 178 179 - #ifdef CONFIG_40x 180 - 181 - /* 182 - * Do an IO access in real mode 183 - */ 184 - _GLOBAL(real_readb) 185 - mfmsr r7 186 - rlwinm r0,r7,0,~MSR_DR 187 - sync 188 - mtmsr r0 189 - sync 190 - isync 191 - lbz r3,0(r3) 192 - sync 193 - mtmsr r7 194 - sync 195 - isync 196 - blr 197 - _ASM_NOKPROBE_SYMBOL(real_readb) 198 - 199 - /* 200 - * Do an IO access in real mode 201 - */ 202 - _GLOBAL(real_writeb) 203 - mfmsr r7 204 - rlwinm r0,r7,0,~MSR_DR 205 - sync 206 - mtmsr r0 207 - sync 208 - isync 209 - stb r3,0(r4) 210 - sync 211 - mtmsr r7 212 - sync 213 - isync 214 - blr 215 - _ASM_NOKPROBE_SYMBOL(real_writeb) 216 - 217 - #endif /* CONFIG_40x */ 218 - 219 179 /* 220 180 * Copy a whole page. We use the dcbz instruction on the destination 221 181 * to reduce memory traffic (it eliminates the unnecessary reads of
+1 -1
arch/powerpc/kernel/traps.c
··· 2244 2244 ; 2245 2245 } 2246 2246 2247 - #if defined(CONFIG_BOOKE_WDT) || defined(CONFIG_40x) 2247 + #ifdef CONFIG_BOOKE_WDT 2248 2248 DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException) 2249 2249 { 2250 2250 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
-3
arch/powerpc/kernel/udbg.c
··· 49 49 #elif defined(CONFIG_PPC_EARLY_DEBUG_44x) 50 50 /* PPC44x debug */ 51 51 udbg_init_44x_as1(); 52 - #elif defined(CONFIG_PPC_EARLY_DEBUG_40x) 53 - /* PPC40x debug */ 54 - udbg_init_40x_realmode(); 55 52 #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM) 56 53 udbg_init_cpm(); 57 54 #elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)
-23
arch/powerpc/kernel/udbg_16550.c
··· 274 274 275 275 #endif /* CONFIG_PPC_EARLY_DEBUG_44x */ 276 276 277 - #ifdef CONFIG_PPC_EARLY_DEBUG_40x 278 - 279 - static u8 udbg_uart_in_40x(unsigned int reg) 280 - { 281 - return real_readb((void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR 282 - + reg); 283 - } 284 - 285 - static void udbg_uart_out_40x(unsigned int reg, u8 val) 286 - { 287 - real_writeb(val, (void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR 288 - + reg); 289 - } 290 - 291 - void __init udbg_init_40x_realmode(void) 292 - { 293 - udbg_uart_in = udbg_uart_in_40x; 294 - udbg_uart_out = udbg_uart_out_40x; 295 - udbg_use_uart(); 296 - } 297 - 298 - #endif /* CONFIG_PPC_EARLY_DEBUG_40x */ 299 - 300 277 #ifdef CONFIG_PPC_EARLY_DEBUG_16550 301 278 302 279 static void __iomem *udbg_uart_early_addr;
+4 -4
arch/powerpc/mm/mmu_decl.h
··· 20 20 #include <asm/trace.h> 21 21 22 22 /* 23 - * On 40x and 8xx, we directly inline tlbia and tlbivax 23 + * On 8xx, we directly inline tlbia 24 24 */ 25 - #if defined(CONFIG_40x) || defined(CONFIG_PPC_8xx) 25 + #ifdef CONFIG_PPC_8xx 26 26 static inline void _tlbil_all(void) 27 27 { 28 28 asm volatile ("sync; tlbia; isync" : : : "memory"); ··· 35 35 } 36 36 #define _tlbil_pid_noind(pid) _tlbil_pid(pid) 37 37 38 - #else /* CONFIG_40x || CONFIG_PPC_8xx */ 38 + #else /* CONFIG_PPC_8xx */ 39 39 extern void _tlbil_all(void); 40 40 extern void _tlbil_pid(unsigned int pid); 41 41 #ifdef CONFIG_PPC_BOOK3E_64 ··· 43 43 #else 44 44 #define _tlbil_pid_noind(pid) _tlbil_pid(pid) 45 45 #endif 46 - #endif /* !(CONFIG_40x || CONFIG_PPC_8xx) */ 46 + #endif /* !CONFIG_PPC_8xx */ 47 47 48 48 /* 49 49 * On 8xx, we directly inline tlbie, on others, it's extern
-161
arch/powerpc/mm/nohash/40x.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * This file contains the routines for initializing the MMU 4 - * on the 4xx series of chips. 5 - * -- paulus 6 - * 7 - * Derived from arch/ppc/mm/init.c: 8 - * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 9 - * 10 - * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au) 11 - * and Cort Dougan (PReP) (cort@cs.nmt.edu) 12 - * Copyright (C) 1996 Paul Mackerras 13 - * 14 - * Derived from "arch/i386/mm/init.c" 15 - * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds 16 - */ 17 - 18 - #include <linux/signal.h> 19 - #include <linux/sched.h> 20 - #include <linux/kernel.h> 21 - #include <linux/errno.h> 22 - #include <linux/string.h> 23 - #include <linux/types.h> 24 - #include <linux/ptrace.h> 25 - #include <linux/mman.h> 26 - #include <linux/mm.h> 27 - #include <linux/swap.h> 28 - #include <linux/stddef.h> 29 - #include <linux/vmalloc.h> 30 - #include <linux/init.h> 31 - #include <linux/delay.h> 32 - #include <linux/highmem.h> 33 - #include <linux/memblock.h> 34 - 35 - #include <asm/io.h> 36 - #include <asm/mmu_context.h> 37 - #include <asm/mmu.h> 38 - #include <linux/uaccess.h> 39 - #include <asm/smp.h> 40 - #include <asm/bootx.h> 41 - #include <asm/machdep.h> 42 - #include <asm/setup.h> 43 - 44 - #include <mm/mmu_decl.h> 45 - 46 - /* 47 - * MMU_init_hw does the chip-specific initialization of the MMU hardware. 48 - */ 49 - void __init MMU_init_hw(void) 50 - { 51 - int i; 52 - unsigned long zpr; 53 - 54 - /* 55 - * The Zone Protection Register (ZPR) defines how protection will 56 - * be applied to every page which is a member of a given zone. 57 - * The zone index bits (of ZSEL) in the PTE are used for software 58 - * indicators. We use the 4 upper bits of virtual address to select 59 - * the zone. We set all zones above TASK_SIZE to zero, allowing 60 - * only kernel access as indicated in the PTE. For zones below 61 - * TASK_SIZE, we set a 01 binary (a value of 10 will not work) 62 - * to allow user access as indicated in the PTE. This also allows 63 - * kernel access as indicated in the PTE. 64 - */ 65 - 66 - for (i = 0, zpr = 0; i < TASK_SIZE >> 28; i++) 67 - zpr |= 1 << (30 - i * 2); 68 - 69 - mtspr(SPRN_ZPR, zpr); 70 - 71 - flush_instruction_cache(); 72 - 73 - /* 74 - * Set up the real-mode cache parameters for the exception vector 75 - * handlers (which are run in real-mode). 76 - */ 77 - 78 - mtspr(SPRN_DCWR, 0x00000000); /* All caching is write-back */ 79 - 80 - /* 81 - * Cache instruction and data space where the exception 82 - * vectors and the kernel live in real-mode. 83 - */ 84 - 85 - mtspr(SPRN_DCCR, 0xFFFF0000); /* 2GByte of data space at 0x0. */ 86 - mtspr(SPRN_ICCR, 0xFFFF0000); /* 2GByte of instr. space at 0x0. */ 87 - } 88 - 89 - #define LARGE_PAGE_SIZE_16M (1<<24) 90 - #define LARGE_PAGE_SIZE_4M (1<<22) 91 - 92 - unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top) 93 - { 94 - unsigned long v, s, mapped; 95 - phys_addr_t p; 96 - 97 - v = KERNELBASE; 98 - p = 0; 99 - s = total_lowmem; 100 - 101 - if (IS_ENABLED(CONFIG_KFENCE)) 102 - return 0; 103 - 104 - if (debug_pagealloc_enabled()) 105 - return 0; 106 - 107 - if (strict_kernel_rwx_enabled()) 108 - return 0; 109 - 110 - while (s >= LARGE_PAGE_SIZE_16M) { 111 - pmd_t *pmdp; 112 - unsigned long val = p | _PMD_SIZE_16M | _PAGE_EXEC | _PAGE_RW; 113 - 114 - pmdp = pmd_off_k(v); 115 - *pmdp++ = __pmd(val); 116 - *pmdp++ = __pmd(val); 117 - *pmdp++ = __pmd(val); 118 - *pmdp++ = __pmd(val); 119 - 120 - v += LARGE_PAGE_SIZE_16M; 121 - p += LARGE_PAGE_SIZE_16M; 122 - s -= LARGE_PAGE_SIZE_16M; 123 - } 124 - 125 - while (s >= LARGE_PAGE_SIZE_4M) { 126 - pmd_t *pmdp; 127 - unsigned long val = p | _PMD_SIZE_4M | _PAGE_EXEC | _PAGE_RW; 128 - 129 - pmdp = pmd_off_k(v); 130 - *pmdp = __pmd(val); 131 - 132 - v += LARGE_PAGE_SIZE_4M; 133 - p += LARGE_PAGE_SIZE_4M; 134 - s -= LARGE_PAGE_SIZE_4M; 135 - } 136 - 137 - mapped = total_lowmem - s; 138 - 139 - /* If the size of RAM is not an exact power of two, we may not 140 - * have covered RAM in its entirety with 16 and 4 MiB 141 - * pages. Consequently, restrict the top end of RAM currently 142 - * allocable so that calls to the MEMBLOCK to allocate PTEs for "tail" 143 - * coverage with normal-sized pages (or other reasons) do not 144 - * attempt to allocate outside the allowed range. 145 - */ 146 - memblock_set_current_limit(mapped); 147 - 148 - return mapped; 149 - } 150 - 151 - void setup_initial_memory_limit(phys_addr_t first_memblock_base, 152 - phys_addr_t first_memblock_size) 153 - { 154 - /* We don't currently support the first MEMBLOCK not mapping 0 155 - * physical on those processors 156 - */ 157 - BUG_ON(first_memblock_base != 0); 158 - 159 - /* 40x can only access 16MB at the moment (see head_40x.S) */ 160 - memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000)); 161 - }
-1
arch/powerpc/mm/nohash/Makefile
··· 2 2 3 3 obj-y += mmu_context.o tlb.o tlb_low.o kup.o 4 4 obj-$(CONFIG_PPC_BOOK3E_64) += tlb_low_64e.o book3e_pgtable.o 5 - obj-$(CONFIG_40x) += 40x.o 6 5 obj-$(CONFIG_44x) += 44x.o 7 6 obj-$(CONFIG_PPC_8xx) += 8xx.o 8 7 obj-$(CONFIG_PPC_E500) += e500.o
-2
arch/powerpc/mm/nohash/kup.c
··· 15 15 void setup_kuap(bool disabled) 16 16 { 17 17 if (disabled) { 18 - if (IS_ENABLED(CONFIG_40x)) 19 - disable_kuep = true; 20 18 if (smp_processor_id() == boot_cpuid) 21 19 cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP; 22 20 return;
-3
arch/powerpc/mm/nohash/mmu_context.c
··· 219 219 /* sync */ 220 220 mb(); 221 221 } else if (kuap_is_disabled()) { 222 - if (IS_ENABLED(CONFIG_40x)) 223 - mb(); /* sync */ 224 - 225 222 mtspr(SPRN_PID, id); 226 223 isync(); 227 224 }
+1 -26
arch/powerpc/mm/nohash/tlb_low.S
··· 32 32 #include <asm/asm-compat.h> 33 33 #include <asm/feature-fixups.h> 34 34 35 - #if defined(CONFIG_40x) 36 - 37 - /* 38 - * 40x implementation needs only tlbil_va 39 - */ 40 - _GLOBAL(__tlbil_va) 41 - /* We run the search with interrupts disabled because we have to change 42 - * the PID and I don't want to preempt when that happens. 43 - */ 44 - mfmsr r5 45 - mfspr r6,SPRN_PID 46 - wrteei 0 47 - mtspr SPRN_PID,r4 48 - tlbsx. r3, 0, r3 49 - mtspr SPRN_PID,r6 50 - wrtee r5 51 - bne 1f 52 - sync 53 - /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is 54 - * clear. Since 25 is the V bit in the TLB_TAG, loading this value 55 - * will invalidate the TLB entry. */ 56 - tlbwe r3, r3, TLB_TAG 57 - isync 58 - 1: blr 59 - 60 - #elif defined(CONFIG_PPC_8xx) 35 + #if defined(CONFIG_PPC_8xx) 61 36 62 37 /* 63 38 * Nothing to do for 8xx, everything is inline
-100
arch/powerpc/platforms/4xx/pci.c
··· 1263 1263 1264 1264 #endif /* CONFIG_44x */ 1265 1265 1266 - #ifdef CONFIG_40x 1267 - 1268 - static int __init ppc405ex_pciex_core_init(struct device_node *np) 1269 - { 1270 - /* Nothing to do, return 2 ports */ 1271 - return 2; 1272 - } 1273 - 1274 - static void __init ppc405ex_pcie_phy_reset(struct ppc4xx_pciex_port *port) 1275 - { 1276 - /* Assert the PE0_PHY reset */ 1277 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01010000); 1278 - msleep(1); 1279 - 1280 - /* deassert the PE0_hotreset */ 1281 - if (port->endpoint) 1282 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01111000); 1283 - else 1284 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01101000); 1285 - 1286 - /* poll for phy !reset */ 1287 - /* XXX FIXME add timeout */ 1288 - while (!(mfdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSTA) & 0x00001000)) 1289 - ; 1290 - 1291 - /* deassert the PE0_gpl_utl_reset */ 1292 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x00101000); 1293 - } 1294 - 1295 - static int __init ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port) 1296 - { 1297 - u32 val; 1298 - 1299 - if (port->endpoint) 1300 - val = PTYPE_LEGACY_ENDPOINT; 1301 - else 1302 - val = PTYPE_ROOT_PORT; 1303 - 1304 - mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, 1305 - 1 << 24 | val << 20 | LNKW_X1 << 12); 1306 - 1307 - mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x00000000); 1308 - mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01010000); 1309 - mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET1, 0x720F0000); 1310 - mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET2, 0x70600003); 1311 - 1312 - /* 1313 - * Only reset the PHY when no link is currently established. 1314 - * This is for the Atheros PCIe board which has problems to establish 1315 - * the link (again) after this PHY reset. All other currently tested 1316 - * PCIe boards don't show this problem. 1317 - * This has to be re-tested and fixed in a later release! 1318 - */ 1319 - val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP); 1320 - if (!(val & 0x00001000)) 1321 - ppc405ex_pcie_phy_reset(port); 1322 - 1323 - dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000); /* guarded on */ 1324 - 1325 - port->has_ibpre = 1; 1326 - 1327 - return ppc4xx_pciex_port_reset_sdr(port); 1328 - } 1329 - 1330 - static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port) 1331 - { 1332 - dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0); 1333 - 1334 - /* 1335 - * Set buffer allocations and then assert VRB and TXE. 1336 - */ 1337 - out_be32(port->utl_base + PEUTL_OUTTR, 0x02000000); 1338 - out_be32(port->utl_base + PEUTL_INTR, 0x02000000); 1339 - out_be32(port->utl_base + PEUTL_OPDBSZ, 0x04000000); 1340 - out_be32(port->utl_base + PEUTL_PBBSZ, 0x21000000); 1341 - out_be32(port->utl_base + PEUTL_IPHBSZ, 0x02000000); 1342 - out_be32(port->utl_base + PEUTL_IPDBSZ, 0x04000000); 1343 - out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000); 1344 - out_be32(port->utl_base + PEUTL_PCTL, 0x80800066); 1345 - 1346 - out_be32(port->utl_base + PEUTL_PBCTL, 0x08000000); 1347 - 1348 - return 0; 1349 - } 1350 - 1351 - static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata = 1352 - { 1353 - .want_sdr = true, 1354 - .core_init = ppc405ex_pciex_core_init, 1355 - .port_init_hw = ppc405ex_pciex_init_port_hw, 1356 - .setup_utl = ppc405ex_pciex_init_utl, 1357 - .check_link = ppc4xx_pciex_check_link_sdr, 1358 - }; 1359 - 1360 - #endif /* CONFIG_40x */ 1361 - 1362 1266 #ifdef CONFIG_476FPE 1363 1267 static int __init ppc_476fpe_pciex_core_init(struct device_node *np) 1364 1268 { ··· 1331 1427 if (of_device_is_compatible(np, "ibm,plb-pciex-apm821xx")) 1332 1428 ppc4xx_pciex_hwops = &apm821xx_pcie_hwops; 1333 1429 #endif /* CONFIG_44x */ 1334 - #ifdef CONFIG_40x 1335 - if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) 1336 - ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops; 1337 - #endif 1338 1430 #ifdef CONFIG_476FPE 1339 1431 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe") 1340 1432 || of_device_is_compatible(np, "ibm,plb-pciex-476gtr"))
-1
scripts/head-object-list.txt
··· 27 27 arch/nios2/kernel/head.o 28 28 arch/openrisc/kernel/head.o 29 29 arch/parisc/kernel/head.o 30 - arch/powerpc/kernel/head_40x.o 31 30 arch/powerpc/kernel/head_44x.o 32 31 arch/powerpc/kernel/head_64.o 33 32 arch/powerpc/kernel/head_8xx.o