Skip to content

Commit 8b14e1d

Browse files
chleroympe
authored andcommitted
powerpc: Remove support for PowerPC 601
PowerPC 601 has been retired. Remove all associated specific code. CPU_FTRS_PPC601 has CPU_FTR_COHERENT_ICACHE and CPU_FTR_COMMON. CPU_FTR_COMMON is already present via other CPU_FTRS. None of the remaining CPU selects CPU_FTR_COHERENT_ICACHE. So CPU_FTRS_PPC601 can be removed from the possible features, hence can be removed completely. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/60b725d55e21beec3335175c20b77903ff98284f.1601362098.git.christophe.leroy@csgroup.eu
1 parent f0ed73f commit 8b14e1d

17 files changed

Lines changed: 17 additions & 206 deletions

File tree

‎arch/powerpc/boot/util.S‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
.text
2020

21-
/* udelay (on non-601 processors) needs to know the period of the
21+
/* udelay needs to know the period of the
2222
* timebase in nanoseconds. This used to be hardcoded to be 60ns
2323
* (period of 66MHz/4). Now a variable is used that is initialized to
2424
* 60 for backward compatibility, but it can be overridden as necessary
@@ -37,19 +37,6 @@ timebase_period_ns:
3737
*/
3838
.globl udelay
3939
udelay:
40-
mfspr r4,SPRN_PVR
41-
srwi r4,r4,16
42-
cmpwi 0,r4,1 /* 601 ? */
43-
bne .Ludelay_not_601
44-
00: li r0,86 /* Instructions / microsecond? */
45-
mtctr r0
46-
10: addi r0,r0,0 /* NOP */
47-
bdnz 10b
48-
subic. r3,r3,1
49-
bne 00b
50-
blr
51-
52-
.Ludelay_not_601:
5340
mulli r4,r3,1000 /* nanoseconds */
5441
/* Change r4 to be the number of ticks using:
5542
* (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns

‎arch/powerpc/include/asm/cputable.h‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ static inline void cpu_feature_keys_init(void) { }
295295
#define CPU_FTR_MAYBE_CAN_NAP 0
296296
#endif
297297

298-
#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | \
299-
CPU_FTR_COHERENT_ICACHE)
300298
#define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
301299
CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE | CPU_FTR_NOEXECUTE)
302300
#define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_PPC_LE)
@@ -512,10 +510,8 @@ static inline void cpu_feature_keys_init(void) { }
512510
#else
513511
enum {
514512
CPU_FTRS_POSSIBLE =
515-
#ifdef CONFIG_PPC_BOOK3S_601
516-
CPU_FTRS_PPC601 |
517-
#elif defined(CONFIG_PPC_BOOK3S_32)
518-
CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
513+
#ifdef CONFIG_PPC_BOOK3S_32
514+
CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
519515
CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 |
520516
CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX |
521517
CPU_FTRS_7400_NOTAU | CPU_FTRS_7400 | CPU_FTRS_7450_20 |
@@ -590,9 +586,7 @@ enum {
590586
#else
591587
enum {
592588
CPU_FTRS_ALWAYS =
593-
#ifdef CONFIG_PPC_BOOK3S_601
594-
CPU_FTRS_PPC601 &
595-
#elif defined(CONFIG_PPC_BOOK3S_32)
589+
#ifdef CONFIG_PPC_BOOK3S_32
596590
CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU &
597591
CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 &
598592
CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX &

‎arch/powerpc/include/asm/ppc_asm.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
401401
#define MFTBU(dest) mfspr dest, SPRN_TBRU
402402
#endif
403403

404-
/* tlbsync is not implemented on 601 */
405-
#if !defined(CONFIG_SMP) || defined(CONFIG_PPC_BOOK3S_601)
404+
#ifndef CONFIG_SMP
406405
#define TLBSYNC
407406
#else
408407
#define TLBSYNC tlbsync; sync

‎arch/powerpc/include/asm/ptrace.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,7 @@ static inline void set_trap_norestart(struct pt_regs *regs)
243243
}
244244

245245
#define arch_has_single_step() (1)
246-
#ifndef CONFIG_PPC_BOOK3S_601
247246
#define arch_has_block_step() (true)
248-
#else
249-
#define arch_has_block_step() (false)
250-
#endif
251247
#define ARCH_HAS_USER_SINGLE_STEP_REPORT
252248

253249
/*

‎arch/powerpc/include/asm/time.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct div_result {
3939
};
4040

4141
/* Accessor functions for the timebase (RTC on 601) registers. */
42-
#define __USE_RTC() (IS_ENABLED(CONFIG_PPC_BOOK3S_601))
42+
#define __USE_RTC() (0)
4343

4444
#ifdef CONFIG_PPC64
4545

‎arch/powerpc/include/asm/timex.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ typedef unsigned long cycles_t;
1717

1818
static inline cycles_t get_cycles(void)
1919
{
20-
if (IS_ENABLED(CONFIG_PPC_BOOK3S_601))
21-
return 0;
22-
2320
return mftb();
2421
}
2522

‎arch/powerpc/kernel/btext.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,12 @@ void __init btext_prepare_BAT(void)
9595
boot_text_mapped = 0;
9696
return;
9797
}
98-
if (PVR_VER(mfspr(SPRN_PVR)) != 1) {
98+
{
9999
/* 603, 604, G3, G4, ... */
100100
lowbits = addr & ~0xFF000000UL;
101101
addr &= 0xFF000000UL;
102102
disp_BAT[0] = vaddr | (BL_16M<<2) | 2;
103103
disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);
104-
} else {
105-
/* 601 */
106-
lowbits = addr & ~0xFF800000UL;
107-
addr &= 0xFF800000UL;
108-
disp_BAT[0] = vaddr | (_PAGE_NO_CACHE | PP_RWXX) | 4;
109-
disp_BAT[1] = addr | BL_8M | 0x40;
110104
}
111105
logicalDisplayBase = (void *) (vaddr + lowbits);
112106
}

‎arch/powerpc/kernel/entry_32.S‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -811,19 +811,11 @@ _ASM_NOKPROBE_SYMBOL(fast_exception_return)
811811
1: lis r3,exc_exit_restart_end@ha
812812
addi r3,r3,exc_exit_restart_end@l
813813
cmplw r12,r3
814-
#ifdef CONFIG_PPC_BOOK3S_601
815-
bge 2b
816-
#else
817814
bge 3f
818-
#endif
819815
lis r4,exc_exit_restart@ha
820816
addi r4,r4,exc_exit_restart@l
821817
cmplw r12,r4
822-
#ifdef CONFIG_PPC_BOOK3S_601
823-
blt 2b
824-
#else
825818
blt 3f
826-
#endif
827819
lis r3,fee_restarts@ha
828820
tophys(r3,r3)
829821
lwz r5,fee_restarts@l(r3)
@@ -840,7 +832,6 @@ fee_restarts:
840832

841833
/* aargh, a nonrecoverable interrupt, panic */
842834
/* aargh, we don't know which trap this is */
843-
/* but the 601 doesn't implement the RI bit, so assume it's OK */
844835
3:
845836
li r10,-1
846837
stw r10,_TRAP(r11)
@@ -1302,27 +1293,18 @@ nonrecoverable:
13021293
lis r10,exc_exit_restart_end@ha
13031294
addi r10,r10,exc_exit_restart_end@l
13041295
cmplw r12,r10
1305-
#ifdef CONFIG_PPC_BOOK3S_601
1306-
bgelr
1307-
#else
13081296
bge 3f
1309-
#endif
13101297
lis r11,exc_exit_restart@ha
13111298
addi r11,r11,exc_exit_restart@l
13121299
cmplw r12,r11
1313-
#ifdef CONFIG_PPC_BOOK3S_601
1314-
bltlr
1315-
#else
13161300
blt 3f
1317-
#endif
13181301
lis r10,ee_restarts@ha
13191302
lwz r12,ee_restarts@l(r10)
13201303
addi r12,r12,1
13211304
stw r12,ee_restarts@l(r10)
13221305
mr r12,r11 /* restart at exc_exit_restart */
13231306
blr
13241307
3: /* OK, we can't recover, kill this process */
1325-
/* but the 601 doesn't implement the RI bit, so assume it's OK */
13261308
lwz r3,_TRAP(r1)
13271309
andi. r0,r3,1
13281310
beq 5f

‎arch/powerpc/kernel/head_32.S‎

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@
3434

3535
#include "head_32.h"
3636

37-
/* 601 only have IBAT */
38-
#ifdef CONFIG_PPC_BOOK3S_601
39-
#define LOAD_BAT(n, reg, RA, RB) \
40-
li RA,0; \
41-
mtspr SPRN_IBAT##n##U,RA; \
42-
lwz RA,(n*16)+0(reg); \
43-
lwz RB,(n*16)+4(reg); \
44-
mtspr SPRN_IBAT##n##U,RA; \
45-
mtspr SPRN_IBAT##n##L,RB
46-
#else
4737
#define LOAD_BAT(n, reg, RA, RB) \
4838
/* see the comment for clear_bats() -- Cort */ \
4939
li RA,0; \
@@ -57,7 +47,6 @@
5747
lwz RB,(n*16)+12(reg); \
5848
mtspr SPRN_DBAT##n##U,RA; \
5949
mtspr SPRN_DBAT##n##L,RB
60-
#endif
6150

6251
__HEAD
6352
.stabs "arch/powerpc/kernel/",N_SO,0,0,0f
@@ -432,7 +421,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_FPU_UNAVAILABLE)
432421
SystemCall:
433422
SYSCALL_ENTRY 0xc00
434423

435-
/* Single step - not used on 601 */
436424
EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
437425
EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_STD)
438426

@@ -974,8 +962,7 @@ load_up_mmu:
974962
lwz r6,_SDR1@l(r6)
975963
mtspr SPRN_SDR1,r6
976964

977-
/* Load the BAT registers with the values set up by MMU_init.
978-
MMU_init takes care of whether we're on a 601 or not. */
965+
/* Load the BAT registers with the values set up by MMU_init. */
979966
lis r3,BATS@ha
980967
addi r3,r3,BATS@l
981968
tophys(r3,r3)
@@ -1152,7 +1139,6 @@ EXPORT_SYMBOL(switch_mmu_context)
11521139
clear_bats:
11531140
li r10,0
11541141

1155-
#ifndef CONFIG_PPC_BOOK3S_601
11561142
mtspr SPRN_DBAT0U,r10
11571143
mtspr SPRN_DBAT0L,r10
11581144
mtspr SPRN_DBAT1U,r10
@@ -1161,7 +1147,6 @@ clear_bats:
11611147
mtspr SPRN_DBAT2L,r10
11621148
mtspr SPRN_DBAT3U,r10
11631149
mtspr SPRN_DBAT3L,r10
1164-
#endif
11651150
mtspr SPRN_IBAT0U,r10
11661151
mtspr SPRN_IBAT0L,r10
11671152
mtspr SPRN_IBAT1U,r10
@@ -1252,26 +1237,9 @@ mmu_off:
12521237
sync
12531238
RFI
12541239

1255-
/*
1256-
* On 601, we use 3 BATs to map up to 24M of RAM at _PAGE_OFFSET
1257-
* (we keep one for debugging) and on others, we use one 256M BAT.
1258-
*/
1240+
/* We use one BAT to map up to 256M of RAM at _PAGE_OFFSET */
12591241
initial_bats:
12601242
lis r11,PAGE_OFFSET@h
1261-
#ifdef CONFIG_PPC_BOOK3S_601
1262-
ori r11,r11,4 /* set up BAT registers for 601 */
1263-
li r8,0x7f /* valid, block length = 8MB */
1264-
mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */
1265-
mtspr SPRN_IBAT0L,r8 /* lower BAT register */
1266-
addis r11,r11,0x800000@h
1267-
addis r8,r8,0x800000@h
1268-
mtspr SPRN_IBAT1U,r11
1269-
mtspr SPRN_IBAT1L,r8
1270-
addis r11,r11,0x800000@h
1271-
addis r8,r8,0x800000@h
1272-
mtspr SPRN_IBAT2U,r11
1273-
mtspr SPRN_IBAT2L,r8
1274-
#else
12751243
tophys(r8,r11)
12761244
#ifdef CONFIG_SMP
12771245
ori r8,r8,0x12 /* R/W access, M=1 */
@@ -1280,11 +1248,10 @@ initial_bats:
12801248
#endif /* CONFIG_SMP */
12811249
ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
12821250

1283-
mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1251+
mtspr SPRN_DBAT0L,r8 /* N.B. 6xx have valid */
12841252
mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
12851253
mtspr SPRN_IBAT0L,r8
12861254
mtspr SPRN_IBAT0U,r11
1287-
#endif
12881255
isync
12891256
blr
12901257

@@ -1302,13 +1269,8 @@ setup_disp_bat:
13021269
beqlr
13031270
lwz r11,0(r8)
13041271
lwz r8,4(r8)
1305-
#ifndef CONFIG_PPC_BOOK3S_601
13061272
mtspr SPRN_DBAT3L,r8
13071273
mtspr SPRN_DBAT3U,r11
1308-
#else
1309-
mtspr SPRN_IBAT3L,r8
1310-
mtspr SPRN_IBAT3U,r11
1311-
#endif
13121274
blr
13131275
#endif /* CONFIG_BOOTX_TEXT */
13141276

‎arch/powerpc/kernel/setup_32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,6 @@ __init void initialize_cache_info(void)
223223
dcache_bsize = cur_cpu_spec->dcache_bsize;
224224
icache_bsize = cur_cpu_spec->icache_bsize;
225225
ucache_bsize = 0;
226-
if (IS_ENABLED(CONFIG_PPC_BOOK3S_601) || IS_ENABLED(CONFIG_E200))
226+
if (IS_ENABLED(CONFIG_E200))
227227
ucache_bsize = icache_bsize = dcache_bsize;
228228
}

0 commit comments

Comments
 (0)