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

powerpc/config: Add CONFIG_BOOKE_OR_40x

We have many functionnalities common to 40x and BOOKE, it leads to
many places with #if defined(CONFIG_BOOKE) || defined(CONFIG_40x).

We are going to add a few more with KUAP for booke/40x, so create
a new symbol which is defined when either BOOKE or 40x is defined.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/9a3dbd60924cb25c9f944d3d8205ac5a0d15e229.1634627931.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
047a6fd4 25ae981f

+21 -16
+4 -4
arch/powerpc/include/asm/hw_irq.h
··· 61 61 62 62 static inline void __hard_irq_enable(void) 63 63 { 64 - if (IS_ENABLED(CONFIG_BOOKE) || IS_ENABLED(CONFIG_40x)) 64 + if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 65 65 wrtee(MSR_EE); 66 66 else if (IS_ENABLED(CONFIG_PPC_8xx)) 67 67 wrtspr(SPRN_EIE); ··· 73 73 74 74 static inline void __hard_irq_disable(void) 75 75 { 76 - if (IS_ENABLED(CONFIG_BOOKE) || IS_ENABLED(CONFIG_40x)) 76 + if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 77 77 wrtee(0); 78 78 else if (IS_ENABLED(CONFIG_PPC_8xx)) 79 79 wrtspr(SPRN_EID); ··· 85 85 86 86 static inline void __hard_EE_RI_disable(void) 87 87 { 88 - if (IS_ENABLED(CONFIG_BOOKE) || IS_ENABLED(CONFIG_40x)) 88 + if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 89 89 wrtee(0); 90 90 else if (IS_ENABLED(CONFIG_PPC_8xx)) 91 91 wrtspr(SPRN_NRI); ··· 97 97 98 98 static inline void __hard_RI_enable(void) 99 99 { 100 - if (IS_ENABLED(CONFIG_BOOKE) || IS_ENABLED(CONFIG_40x)) 100 + if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 101 101 return; 102 102 103 103 if (IS_ENABLED(CONFIG_PPC_8xx))
+1 -1
arch/powerpc/include/asm/irq.h
··· 36 36 37 37 struct pt_regs; 38 38 39 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 39 + #ifdef CONFIG_BOOKE_OR_40x 40 40 /* 41 41 * Per-cpu stacks for handling critical, debug and machine check 42 42 * level interrupts.
+1 -1
arch/powerpc/include/asm/ptrace.h
··· 291 291 292 292 static inline bool cpu_has_msr_ri(void) 293 293 { 294 - return !IS_ENABLED(CONFIG_BOOKE) && !IS_ENABLED(CONFIG_40x); 294 + return !IS_ENABLED(CONFIG_BOOKE_OR_40x); 295 295 } 296 296 297 297 static inline bool regs_is_unrecoverable(struct pt_regs *regs)
+2 -2
arch/powerpc/include/asm/reg.h
··· 18 18 #include <asm/feature-fixups.h> 19 19 20 20 /* Pickup Book E specific registers. */ 21 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 21 + #ifdef CONFIG_BOOKE_OR_40x 22 22 #include <asm/reg_booke.h> 23 - #endif /* CONFIG_BOOKE || CONFIG_40x */ 23 + #endif 24 24 25 25 #ifdef CONFIG_FSL_EMB_PERFMON 26 26 #include <asm/reg_fsl_emb.h>
+1 -1
arch/powerpc/kernel/asm-offsets.c
··· 54 54 #endif 55 55 56 56 #ifdef CONFIG_PPC32 57 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 57 + #ifdef CONFIG_BOOKE_OR_40x 58 58 #include "head_booke.h" 59 59 #endif 60 60 #endif
+1 -1
arch/powerpc/kernel/entry_32.S
··· 105 105 stw r11, 0(r1) 106 106 mflr r12 107 107 stw r12, _LINK(r1) 108 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 108 + #ifdef CONFIG_BOOKE_OR_40x 109 109 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */ 110 110 #endif 111 111 lis r12,STACK_FRAME_REGS_MARKER@ha /* exception frame marker */
+1 -1
arch/powerpc/kernel/irq.c
··· 811 811 ppc_md.init_IRQ(); 812 812 } 813 813 814 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 814 + #ifdef CONFIG_BOOKE_OR_40x 815 815 void *critirq_ctx[NR_CPUS] __read_mostly; 816 816 void *dbgirq_ctx[NR_CPUS] __read_mostly; 817 817 void *mcheckirq_ctx[NR_CPUS] __read_mostly;
+2 -2
arch/powerpc/kernel/kgdb.c
··· 48 48 { 0x0800, 0x08 /* SIGFPE */ }, /* fp unavailable */ 49 49 { 0x0900, 0x0e /* SIGALRM */ }, /* decrementer */ 50 50 { 0x0c00, 0x14 /* SIGCHLD */ }, /* system call */ 51 - #if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 51 + #ifdef CONFIG_BOOKE_OR_40x 52 52 { 0x2002, 0x05 /* SIGTRAP */ }, /* debug */ 53 53 #if defined(CONFIG_FSL_BOOKE) 54 54 { 0x2010, 0x08 /* SIGFPE */ }, /* spe unavailable */ ··· 67 67 { 0x2010, 0x08 /* SIGFPE */ }, /* fp unavailable */ 68 68 { 0x2020, 0x08 /* SIGFPE */ }, /* ap unavailable */ 69 69 #endif 70 - #else /* ! (defined(CONFIG_40x) || defined(CONFIG_BOOKE)) */ 70 + #else /* !CONFIG_BOOKE_OR_40x */ 71 71 { 0x0d00, 0x05 /* SIGTRAP */ }, /* single-step */ 72 72 #if defined(CONFIG_PPC_8xx) 73 73 { 0x1000, 0x04 /* SIGILL */ }, /* software emulation */
+1 -1
arch/powerpc/kernel/setup.h
··· 29 29 static inline void setup_tlb_core_data(void) { } 30 30 #endif 31 31 32 - #if defined(CONFIG_PPC_BOOK3E) || defined(CONFIG_BOOKE) || defined(CONFIG_40x) 32 + #ifdef CONFIG_BOOKE_OR_40x 33 33 void exc_lvl_early_init(void); 34 34 #else 35 35 static inline void exc_lvl_early_init(void) { }
+1 -1
arch/powerpc/kernel/setup_32.c
··· 175 175 } 176 176 #endif 177 177 178 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 178 + #ifdef CONFIG_BOOKE_OR_40x 179 179 void __init exc_lvl_early_init(void) 180 180 { 181 181 unsigned int i, hw_cpu;
+1 -1
arch/powerpc/kernel/time.c
··· 770 770 771 771 static void start_cpu_decrementer(void) 772 772 { 773 - #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 773 + #ifdef CONFIG_BOOKE_OR_40x 774 774 unsigned int tcr; 775 775 776 776 /* Clear any pending timer interrupts */
+5
arch/powerpc/platforms/Kconfig.cputype
··· 287 287 depends on E500 || 44x || PPC_BOOK3E 288 288 default y 289 289 290 + config BOOKE_OR_40x 291 + bool 292 + depends on BOOKE || 40x 293 + default y 294 + 290 295 config FSL_BOOKE 291 296 bool 292 297 depends on E500 && PPC32