powerpc/8xx: Some cleanup
Subsystems (2)
cover powerpc/8xx: Some cleanup
This serie does some cleanup in the area of the 8xx.
In the same spirit as what Michael did for 4xx, move 8xx specific stuff into platforms/8xx
Then try to reduce the amount of #ifdefs specific to 8xx
Remove the CONFIG_8xx which is redundant with CONFIG_PPC_8xx
Plus some misc cleanups
Christophe Leroy (12):
powerpc/8xx: Simplify CONFIG_8xx checks in Makefile powerpc/8xx: Move 8xx machine check handlers into platforms/8xx powerpc/8xx: Remove SoftwareEmulation()
powerpc/cpm1: link to CONFIG_CPM1 instead of CONFIG_8xx powerpc/8xx: Move mpc8xx_pic.c from sysdev to platform/8xx powerpc/time: refactor MFTB() to limit number of ifdefs powerpc/kconfig: Simplify PCI_QSPAN selection powerpc/8xx: Getting rid of remaining use of CONFIG_8xx powerpc/8xx: remove CONFIG_8xx
powerpc/8xx: Use symbolic PVR value
powerpc/8xx: Use symbolic names for DSISR bits in DSI powerpc/8xx: Remove cpu dependent macro instructions from head_8xx
arch/powerpc/Kconfig | 8 ++--
arch/powerpc/Makefile | 2 +-
arch/powerpc/boot/Makefile | 4 +-
arch/powerpc/boot/ppc_asm.h | 8 ++++
arch/powerpc/boot/util.S | 24 +++---------
arch/powerpc/include/asm/cache.h | 2 +-
arch/powerpc/include/asm/cputable.h | 4 +-
arch/powerpc/include/asm/fs_pd.h | 2 +-
arch/powerpc/include/asm/nohash/32/pgtable.h | 2 +-
arch/powerpc/include/asm/ppc_asm.h | 14 +++++--
arch/powerpc/include/asm/reg.h | 16 ++++----
arch/powerpc/include/asm/timex.h | 6 +--
arch/powerpc/kernel/Makefile | 2 +-
arch/powerpc/kernel/cputable.c | 6 +--
arch/powerpc/kernel/head_8xx.S | 9 ++---
arch/powerpc/kernel/irq.c | 2 +-
arch/powerpc/kernel/kgdb.c | 4 +-
arch/powerpc/kernel/traps.c | 43 ----------------------
arch/powerpc/kernel/vdso32/gettimeofday.S | 12 ++----
arch/powerpc/mm/fault.c | 4 +-
arch/powerpc/mm/mem.c | 2 +-
arch/powerpc/mm/mmu_decl.h | 10 ++---
arch/powerpc/mm/tlb_nohash_low.S | 2 +-
arch/powerpc/platforms/8xx/Kconfig | 1 -
arch/powerpc/platforms/8xx/Makefile | 2 +-
arch/powerpc/platforms/8xx/m8xx_setup.c | 2 +-
arch/powerpc/platforms/8xx/machine_check.c | 37 +++++++++++++++++++
.../{sysdev/mpc8xx_pic.c => platforms/8xx/pic.c} | 2 +-
.../{sysdev/mpc8xx_pic.h => platforms/8xx/pic.h} | 0
arch/powerpc/platforms/Kconfig.cputype | 7 +---
arch/powerpc/sysdev/Makefile | 2 +-
arch/powerpc/sysdev/fsl_soc.c | 2 +-
arch/powerpc/sysdev/fsl_soc.h | 2 +-
33 files changed, 109 insertions(+), 136 deletions(-)
create mode 100644 arch/powerpc/platforms/8xx/machine_check.c
rename arch/powerpc/{sysdev/mpc8xx_pic.c => platforms/8xx/pic.c} (99%)
rename arch/powerpc/{sysdev/mpc8xx_pic.h => platforms/8xx/pic.h} (100%)Signature · 1 line
2.13.3
PATCH 1/12 powerpc/8xx: Simplify CONFIG_8xx checks in Makefile
The entire 8xx directory is omitted if CONFIG_8xx is not enabled, so within the 8xx/Makefile CONFIG_8xx is always y. So convert obj-$(CONFIG_8xx) to the more obvious obj-y.
---
This serie applies on top of Michael's serie begining with '[1/9] powerpc/47x:
Guard 47x cputable entries with CONFIG_PPC_47x' added to bundle mce'
arch/powerpc/platforms/8xx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/8xx/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the PowerPC 8xx linux kernel. # -obj-$(CONFIG_PPC_8xx) += m8xx_setup.o +obj-y += m8xx_setup.o obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o obj-$(CONFIG_PPC_EP88XC) += ep88xc.o
Signature · 1 line
2.13.3
PATCH 2/12 powerpc/8xx: Move 8xx machine check handlers into platforms/8xx
In reply to Christophe LeroyIn the same spirit as what was done for 4xx and 44x, move the 8xx machine check into platforms/8xx
--- arch/powerpc/kernel/traps.c | 25 -------------------- arch/powerpc/platforms/8xx/Makefile | 2 +- arch/powerpc/platforms/8xx/machine_check.c | 37 ++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 arch/powerpc/platforms/8xx/machine_check.c
arch/powerpc/kernel/traps.c +0 -25
@@ -558,31 +558,6 @@ int machine_check_e200(struct pt_regs *regs) return 0; } -#elif defined(CONFIG_PPC_8xx) -int machine_check_8xx (struct pt_regs *regs) -{ -unsigned long reason = regs->msr; - -pr_err ("Machine check in kernel mode.\n" ); -pr_err ("Caused by (from SRR1=%lx): " , reason); -if (reason &0x40000000 ) -pr_err ("Fetch error at address %lx\n" , regs->nip); -else -pr_err ("Data access error at address %lx\n" , regs->dar); - -#ifdef CONFIG_PCI -/* the qspan pci read routines can cause machine checks -- Cort -* -* yuck !!! that totally needs to go away ! There are better ways -* to deal with that than having a wart in the mcheck handler. -* -- BenH -*/ -bad_page_fault (regs, regs->dar,SIGBUS ); -return 1 ; -#else -return 0 ; -#endif -}#elif defined(CONFIG_PPC32)int machine_check_generic (struct pt_regs *regs) {
arch/powerpc/platforms/8xx/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the PowerPC 8xx linux kernel. # -obj-y += m8xx_setup.o +obj-y += m8xx_setup.o machine_check.o obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o obj-$(CONFIG_PPC_EP88XC) += ep88xc.o
arch/powerpc/platforms/8xx/machine_check.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version +* 2 of the License, or (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/printk.h> +#include <linux/ptrace.h> + +#include <asm/reg.h> + +int machine_check_8xx (struct pt_regs *regs) +{ +unsigned long reason = regs->msr; + +pr_err ("Machine check in kernel mode.\n" ); +pr_err ("Caused by (from SRR1=%lx): " , reason); +if (reason &0x40000000 ) +pr_err ("Fetch error at address %lx\n" , regs->nip); +else +pr_err ("Data access error at address %lx\n" , regs->dar); + +#ifdef CONFIG_PCI +/* the qspan pci read routines can cause machine checks -- Cort +* +* yuck !!! that totally needs to go away ! There are better ways +* to deal with that than having a wart in the mcheck handler. +* -- BenH +*/ +bad_page_fault (regs, regs->dar,SIGBUS ); +return 1 ; +#else +return 0 ; +#endif +}
Signature · 1 line
2.13.3
PATCH 3/12 powerpc/8xx: Remove SoftwareEmulation()
In reply to Christophe LeroySince commit aa42c69c67f82 ("[POWERPC] Add support for FP emulation for the e300c2 core"), program_check_exception() can be called for math emulation. In that case, 'reason' is 0.
On the 8xx, there is a Software Emulation interrupt which is called for all unimplemented and illegal instructions. This interrupt calls SoftwareEmulation() which does almost the same as program_check_exception() called with reason = 0.
The Software Emulation interrupt sets all reason bits to 0, it is therefore possible to call program_check_exception() directly from the interrupt handler.
--- arch/powerpc/kernel/head_8xx.S | 2 +- arch/powerpc/kernel/traps.c | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-)
arch/powerpc/kernel/head_8xx.S +1 -1
@@ -300,7 +300,7 @@ SystemCall: /* On the MPC8xx, this is a software emulation interrupt. It occurs * for all unimplemented and illegal instructions. */ - EXCEPTION(0x1000, SoftEmu, SoftwareEmulation, EXC_XFER_STD) + EXCEPTION(0x1000, SoftEmu, program_check_exception, EXC_XFER_STD) . = 0x1100 /*
arch/powerpc/kernel/traps.c +0 -18
@@ -1518,24 +1518,6 @@ void performance_monitor_exception(struct pt_regs *regs)perf_irq (regs); } -#ifdef CONFIG_8xx -void SoftwareEmulation (struct pt_regs *regs) -{ -CHECK_FULL_REGS (regs); - -if (!user_mode (regs)) { -debugger (regs); -die ("Kernel Mode Unimplemented Instruction or SW FPU Emulation" , - regs,SIGFPE ); - } - -if (!emulate_math (regs)) -return ; - -_exception (SIGILL , regs,ILL_ILLOPC , regs->nip); -} -#endif /* CONFIG_8xx */ -#ifdef CONFIG_PPC_ADV_DEBUG_REGS static void handle_debug (struct pt_regs *regs,unsigned long debug_status) {
Signature · 1 line
2.13.3
PATCH 4/12 powerpc/cpm1: link to CONFIG_CPM1 instead of CONFIG_8xx
In reply to Christophe LeroyTo remain consistent with what is done with CPM2, let's link CPM1 related parts to CONFIG_CPM1 instead of CONFIG_8xx
When something depends on both CPM1 and CPM2 we associate it with CONFIG_CPM
--- arch/powerpc/sysdev/Makefile | 3 ++- arch/powerpc/sysdev/fsl_soc.c | 2 +- arch/powerpc/sysdev/fsl_soc.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
arch/powerpc/sysdev/Makefile +2 -1
@@ -41,10 +41,11 @@ obj-$(CONFIG_XILINX_PCI) += xilinx_pci.o obj-$(CONFIG_OF_RTC) += of_rtc.o obj-$(CONFIG_CPM) += cpm_common.o +obj-$(CONFIG_CPM1) += cpm1.o obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o obj-$(CONFIG_QUICC_ENGINE) += cpm_common.o obj-$(CONFIG_PPC_DCR) += dcr.o -obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o +obj-$(CONFIG_PPC_8xx) += mpc8xx_pic.o obj-$(CONFIG_UCODE_PATCH) += micropatch.o obj-$(CONFIG_PPC_MPC512x) += mpc5xxx_clocks.o
arch/powerpc/sysdev/fsl_soc.c +1 -1
@@ -98,7 +98,7 @@ u32 fsl_get_sys_freq(void) }EXPORT_SYMBOL (fsl_get_sys_freq); -#if defined(CONFIG_CPM2 ) || defined(CONFIG_QUICC_ENGINE ) || defined(CONFIG_8xx) +#if defined(CONFIG_CPM ) || defined(CONFIG_QUICC_ENGINE )u32 get_brgfreq (void ) {
arch/powerpc/sysdev/fsl_soc.h +1 -1
@@ -7,7 +7,7 @@struct spi_device ;extern phys_addr_t get_immrbase (void ); -#if defined(CONFIG_CPM2 ) || defined(CONFIG_QUICC_ENGINE ) || defined(CONFIG_8xx) +#if defined(CONFIG_CPM ) || defined(CONFIG_QUICC_ENGINE )extern u32 get_brgfreq (void );extern u32 get_baudrate (void );#else
Signature · 1 line
2.13.3
PATCH 5/12 powerpc/8xx: Move mpc8xx_pic.c from sysdev to platform/8xx
In reply to Christophe Leroympc8xx_pic.c is dedicated to the 8xx, so move it to platform/8xx
---
arch/powerpc/platforms/8xx/Makefile | 2 +-
arch/powerpc/platforms/8xx/m8xx_setup.c | 2 +-
arch/powerpc/{sysdev/mpc8xx_pic.c => platforms/8xx/pic.c} | 2 +-
arch/powerpc/{sysdev/mpc8xx_pic.h => platforms/8xx/pic.h} | 0
arch/powerpc/sysdev/Makefile | 1 -
5 files changed, 3 insertions(+), 4 deletions(-)
rename arch/powerpc/{sysdev/mpc8xx_pic.c => platforms/8xx/pic.c} (99%)
rename arch/powerpc/{sysdev/mpc8xx_pic.h => platforms/8xx/pic.h} (100%)arch/powerpc/platforms/8xx/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the PowerPC 8xx linux kernel. # -obj-y += m8xx_setup.o machine_check.o +obj-y += m8xx_setup.o machine_check.o pic.o obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o obj-$(CONFIG_PPC_EP88XC) += ep88xc.o
arch/powerpc/platforms/8xx/m8xx_setup.c +1 -1
@@ -23,7 +23,7 @@#include <asm/fs_pd.h> #include <mm/mmu_decl.h> -#include <sysdev/mpc8xx_pic.h> +#include "pic.h" #include "mpc8xx.h"
arch/powerpc/platforms/8xx/pic.c renamed from arch/powerpc/sysdev/mpc8xx_pic.c +1 -1
@@ -9,7 +9,7 @@#include <asm/io.h> #include <asm/8xx_immap.h> -#include "mpc8xx_pic.h" +#include "pic.h" #define PIC_VEC_SPURRIOUS 15
arch/powerpc/platforms/8xx/pic.h renamed from arch/powerpc/sysdev/mpc8xx_pic.h +0 -0
arch/powerpc/sysdev/Makefile +0 -1
@@ -45,7 +45,6 @@ obj-$(CONFIG_CPM1) += cpm1.o obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o obj-$(CONFIG_QUICC_ENGINE) += cpm_common.o obj-$(CONFIG_PPC_DCR) += dcr.o -obj-$(CONFIG_PPC_8xx) += mpc8xx_pic.o obj-$(CONFIG_UCODE_PATCH) += micropatch.o obj-$(CONFIG_PPC_MPC512x) += mpc5xxx_clocks.o
Signature · 1 line
2.13.3
PATCH 6/12 powerpc/time: refactor MFTB() to limit number of ifdefs
In reply to Christophe LeroyThe 8xx cannot access the TBL and TBU registers using mfspr/mtspr It must be accessed using mftb/mftbu
Due to this, there is a number of places with #ifdef CONFIG_8xx
This patch defines new macros MFTBL(x) and MFTBU(x) on the same model as MFTB(x) and tries to make use of them as much as possible.
In arch/powerpc/include/asm/timex.h, we also remove the ifdef for the asm() operands as the compiler doesn't mind unused operands
--- arch/powerpc/boot/ppc_asm.h | 8 ++++++++ arch/powerpc/boot/util.S | 24 +++++------------------- arch/powerpc/include/asm/ppc_asm.h | 12 +++++++++--- arch/powerpc/include/asm/timex.h | 4 ---- arch/powerpc/kernel/vdso32/gettimeofday.S | 12 +++--------- 5 files changed, 25 insertions(+), 35 deletions(-)
arch/powerpc/boot/ppc_asm.h +8 -0
@@ -80,4 +80,12 @@ .long 0xa6037b7d; /* mtsrr1 r11 */ \ .long 0x2400004c /* rfid */ +#ifdef CONFIG_PPC_8xx +#define MFTBL (dest) mftb dest +#define MFTBU (dest) mftbu dest +#else +#define MFTBL (dest) mfspr dest, SPRN_TBRL +#define MFTBU (dest) mfspr dest, SPRN_TBRU +#endif +#endif /* _PPC64_PPC_ASM_H */
arch/powerpc/boot/util.S +5 -19
@@ -71,32 +71,18 @@ udelay: add r4,r4,r5 addi r4,r4,-1 divw r4,r4,r5 /* BUS ticks */ -#ifdef CONFIG_8xx -1: mftbu r5 - mftb r6 - mftbu r7 -#else -1: mfspr r5, SPRN_TBRU - mfspr r6, SPRN_TBRL - mfspr r7, SPRN_TBRU -#endif +1: MFTBU(r5) + MFTBL(r6) + MFTBU(r7) cmpw 0,r5,r7 bne 1b /* Get [synced] base time */ addc r9,r6,r4 /* Compute end time */ addze r8,r5 -#ifdef CONFIG_8xx -2: mftbu r5 -#else -2: mfspr r5, SPRN_TBRU -#endif +2: MFTBU(r5) cmpw 0,r5,r8 blt 2b bgt 3f -#ifdef CONFIG_8xx - mftb r6 -#else - mfspr r6, SPRN_TBRL -#endif + MFTBL(r6) cmpw 0,r6,r9 blt 2b 3: blr
arch/powerpc/include/asm/ppc_asm.h +9 -3
@@ -378,10 +378,16 @@ BEGIN_FTR_SECTION_NESTED(96); \ cmpwi dest,0; \ beq-90b ; \ END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) -#elif defined(CONFIG_8xx) -#define MFTB (dest) mftb dest#else -#define MFTB (dest) mfspr dest, SPRN_TBRL +#define MFTB (dest) MFTBL(dest) +#endif + +#ifdef CONFIG_PPC_8xx +#define MFTBL (dest) mftb dest +#define MFTBU (dest) mftbu dest +#else +#define MFTBL (dest) mfspr dest, SPRN_TBRL +#define MFTBU (dest) mfspr dest, SPRN_TBRU#endif #ifndef CONFIG_SMP
arch/powerpc/include/asm/timex.h +0 -4
@@ -45,11 +45,7 @@ static inline cycles_t get_cycles(void) " .long 0\n" " .long 0\n" ".previous" -#ifdef CONFIG_8xx - : "=r" (ret) : "i" (CPU_FTR_601)); -#else : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL)); -#endif return ret;#endif }
arch/powerpc/kernel/vdso32/gettimeofday.S +3 -9
@@ -232,15 +232,9 @@ __do_get_tspec: lwz r6,(CFG_TB_ORIG_STAMP+4)(r9) /* Get a stable TB value */ -#ifdef CONFIG_8xx -2: mftbu r3 - mftbl r4 - mftbu r0 -#else -2: mfspr r3, SPRN_TBRU - mfspr r4, SPRN_TBRL - mfspr r0, SPRN_TBRU -#endif +2: MFTBU(r3) + MFTBL(r4) + MFTBU(r0) cmplw cr0,r3,r0 bne- 2b
Signature · 1 line
2.13.3
PATCH 8/12 powerpc/8xx: Getting rid of remaining use of CONFIG_8xx
In reply to Christophe LeroyTwo config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
arch/powerpc/platforms/Kconfig.cputype has contained the following comment about CONFIG_8xx item for some years:
"# this is temp to handle compat with arch=ppc"
arch/powerpc is now the only place with remaining use ofCONFIG_8xx: get rid of them.
--- arch/powerpc/Kconfig | 4 ++-- arch/powerpc/Makefile | 2 +- arch/powerpc/boot/Makefile | 4 ++-- arch/powerpc/include/asm/cache.h | 2 +- arch/powerpc/include/asm/cputable.h | 4 ++-- arch/powerpc/include/asm/fs_pd.h | 2 +- arch/powerpc/include/asm/nohash/32/pgtable.h | 2 +- arch/powerpc/include/asm/ppc_asm.h | 2 +- arch/powerpc/include/asm/reg.h | 10 +++++----- arch/powerpc/include/asm/timex.h | 2 +- arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/cputable.c | 4 ++-- arch/powerpc/kernel/irq.c | 2 +- arch/powerpc/kernel/kgdb.c | 4 ++-- arch/powerpc/mm/fault.c | 2 +- arch/powerpc/mm/mem.c | 2 +- arch/powerpc/mm/mmu_decl.h | 10 +++++----- arch/powerpc/mm/tlb_nohash_low.S | 2 +- arch/powerpc/platforms/8xx/Kconfig | 1 - arch/powerpc/platforms/Kconfig.cputype | 2 +- 20 files changed, 32 insertions(+), 33 deletions(-)
arch/powerpc/Kconfig +2 -2
@@ -394,7 +394,7 @@ config HUGETLB_PAGE_SIZE_VARIABLE config MATH_EMULATION bool "Math emulation" - depends on 4xx || 8xx || PPC_MPC832x || BOOKE + depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE ---help--- Some PowerPC chips designed for embedded applications do not have a floating-point unit and therefore do not implement the
@@ -956,7 +956,7 @@ config PPC_PCI_CHOICE config PCI bool "PCI support" if PPC_PCI_CHOICE - default y if !40x && !CPM2 && !8xx && !PPC_83xx \ + default y if !40x && !CPM2 && !PPC_8xx && !PPC_83xx \ && !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON default PCI_QSPAN if PPC_8xx select GENERIC_PCI_IOMAP
arch/powerpc/Makefile +1 -1
@@ -250,7 +250,7 @@ KBUILD_AFLAGS += $(aflags-y) KBUILD_CFLAGS += $(cflags-y) head-y := arch/powerpc/kernel/head_$(BITS).o -head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o +head-$(CONFIG_PPC_8xx) := arch/powerpc/kernel/head_8xx.o head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
arch/powerpc/boot/Makefile +2 -2
@@ -115,7 +115,7 @@ src-wlib-y += crtsavres.S endif src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c -src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c +src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
@@ -132,7 +132,7 @@ src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \ treeboot-iss4xx.c treeboot-currituck.c \ treeboot-akebono.c \ simpleboot.c fixed-head.S virtex.c -src-plat-$(CONFIG_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c +src-plat-$(CONFIG_PPC_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c src-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx.c src-plat-$(CONFIG_PPC_82xx) += cuboot-pq2.c fixed-head.S ep8248e.c cuboot-824x.c src-plat-$(CONFIG_PPC_83xx) += cuboot-83xx.c fixed-head.S redboot-83xx.c
arch/powerpc/include/asm/cache.h +1 -1
@@ -5,7 +5,7 @@/* bytes per L1 cache line */ -#if defined(CONFIG_8xx) || defined(CONFIG_403GCX ) +#if defined(CONFIG_PPC_8xx) || defined(CONFIG_403GCX )#define L1_CACHE_SHIFT 4#define MAX_COPY_PREFETCH 1#elif defined(CONFIG_PPC_E500MC )
arch/powerpc/include/asm/cputable.h +2 -2
@@ -513,7 +513,7 @@ enum {#else CPU_FTRS_GENERIC_32 |#endif -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx CPU_FTRS_8XX |#endif #ifdef CONFIG_40x
@@ -565,7 +565,7 @@ enum {#else CPU_FTRS_GENERIC_32 &#endif -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx CPU_FTRS_8XX &#endif #ifdef CONFIG_40x
arch/powerpc/include/asm/fs_pd.h +1 -1
@@ -26,7 +26,7 @@#define cpm2_unmap (addr) do {} while(0)#endif -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx#include <asm/8xx_immap.h> extern immap_t __iomem *mpc8xx_immr;
arch/powerpc/include/asm/nohash/32/pgtable.h +1 -1
@@ -121,7 +121,7 @@ extern int icache_44x_need_flush;#include <asm/nohash/pte-book3e.h> #elif defined(CONFIG_FSL_BOOKE )#include <asm/nohash/32/pte-fsl-booke.h> -#elif defined(CONFIG_8xx) +#elif defined(CONFIG_PPC_8xx)#include <asm/nohash/32/pte-8xx.h> #endif
arch/powerpc/include/asm/ppc_asm.h +1 -1
@@ -417,7 +417,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)* and they must be used. */ -#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) +#if !defined(CONFIG_4xx) && !defined(CONFIG_PPC_8xx)#define tlbia \ li r4,1024; \ mtctr r4; \
arch/powerpc/include/asm/reg.h +5 -5
@@ -22,9 +22,9 @@#include <asm/reg_fsl_emb.h> #endif -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx#include <asm/reg_8xx.h> -#endif /* CONFIG_8xx */ +#endif /* CONFIG_PPC_8xx */ #define MSR_SF_LG 63/* Enable 64 bit mode */ #define MSR_ISF_LG 61/* Interrupt 64b mode valid on 630 */
@@ -135,7 +135,7 @@#define MSR_KERNEL (MSR_ | MSR_64BIT)#define MSR_USER32 (MSR_ | MSR_PR | MSR_EE)#define MSR_USER64 (MSR_USER32 | MSR_64BIT) -#elif defined(CONFIG_PPC_BOOK3S_32 ) || defined(CONFIG_8xx) +#elif defined(CONFIG_PPC_BOOK3S_32 ) || defined(CONFIG_PPC_8xx)/* Default MSR for kernel mode. */ #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR)#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
@@ -1164,7 +1164,7 @@#endif #endif -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx#define SPRN_SPRG_SCRATCH0 SPRN_SPRG0#define SPRN_SPRG_SCRATCH1 SPRN_SPRG1#define SPRN_SPRG_SCRATCH2 SPRN_SPRG2
@@ -1363,7 +1363,7 @@ static inline void msr_check_and_clear(unsigned long bits)#else /* __powerpc64__ */ -#if defined(CONFIG_8xx) +#if defined(CONFIG_PPC_8xx)#define mftbl () ({unsigned long rval; \ asm volatile("mftbl %0" : "=r" (rval)); rval;})#define mftbu () ({unsigned long rval; \
arch/powerpc/include/asm/timex.h +1 -1
@@ -29,7 +29,7 @@ static inline cycles_t get_cycles(void) ret =0 ; __asm__ __volatile__( -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx "97: mftb %0\n" #else "97: mfspr %0, %2\n"
arch/powerpc/kernel/Makefile +1 -1
@@ -84,7 +84,7 @@ extra-y := head_$(BITS).o extra-$(CONFIG_40x) := head_40x.o extra-$(CONFIG_44x) := head_44x.o extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o -extra-$(CONFIG_8xx) := head_8xx.o +extra-$(CONFIG_PPC_8xx) := head_8xx.o extra-y += vmlinux.lds obj-$(CONFIG_RELOCATABLE) += reloc_$(BITS).o
arch/powerpc/kernel/cputable.c +2 -2
@@ -1259,7 +1259,7 @@ static struct cpu_spec __initdata cpu_specs[] = { .platform = "ppc603", },#endif /* CONFIG_PPC_BOOK3S_32 */ -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xx {/* 8xx */ .pvr_mask = 0xffff0000, .pvr_value = 0x00500000,
@@ -1274,7 +1274,7 @@ static struct cpu_spec __initdata cpu_specs[] = { .machine_check = machine_check_8xx, .platform = "ppc823", }, -#endif /* CONFIG_8xx */ +#endif /* CONFIG_PPC_8xx */ #ifdef CONFIG_40x {/* 403GC */ .pvr_mask = 0xffffff00,
arch/powerpc/kernel/irq.c +1 -1
@@ -24,7 +24,7 @@* mask register (of which only 16 are defined), hence the weird shifting * and complement of the cached_irq_mask. I want to be able to stuff * this right into the SIU SMASK register. -* Many of the prep/chrp functions are conditional compiled on CONFIG_8xx +* Many of the prep/chrp functions are conditional compiled on CONFIG_PPC_8xx * to reduce code space and undefined function references. */
arch/powerpc/kernel/kgdb.c +2 -2
@@ -67,9 +67,9 @@ static struct hard_trap_info#endif #else /* ! (defined(CONFIG_40x) || defined(CONFIG_BOOKE)) */ { 0x0d00, 0x05 /* SIGTRAP */ }, /* single-step */ -#if defined(CONFIG_8xx) +#if defined(CONFIG_PPC_8xx) { 0x1000, 0x04 /* SIGILL */ }, /* software emulation */ -#else /* ! CONFIG_8xx */ +#else /* ! CONFIG_PPC_8xx */ { 0x0f00, 0x04 /* SIGILL */ }, /* performance monitor */ { 0x0f20, 0x08 /* SIGFPE */ }, /* altivec unavailable */ { 0x1300, 0x05 /* SIGTRAP */ }, /* instruction address break */
arch/powerpc/mm/fault.c +1 -1
@@ -391,7 +391,7 @@ static void sanity_check_fault(bool is_write, unsigned long error_code) { }#define page_fault_is_bad (__err) (0)#else #define page_fault_is_write (__err) ((__err) & DSISR_ISSTORE) -#if defined(CONFIG_8xx) +#if defined(CONFIG_PPC_8xx)#define page_fault_is_bad (__err) ((__err) & 0x10000000)#elif defined(CONFIG_PPC64 )#define page_fault_is_bad (__err) ((__err) & DSISR_BAD_FAULT_64S)
arch/powerpc/mm/mem.c +1 -1
@@ -436,7 +436,7 @@ void flush_dcache_icache_page(struct page *page) return; }#endif -#if defined(CONFIG_8xx) || defined(CONFIG_PPC64 ) +#if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC64 )/* On 8xx there is no need to kmap since highmem is not supported */ __flush_dcache_icache (page_address (page));#else
arch/powerpc/mm/mmu_decl.h +5 -5
@@ -27,7 +27,7 @@/* * On 40x and 8xx, we directly inline tlbia and tlbivax */ -#if defined(CONFIG_40x) || defined(CONFIG_8xx) +#if defined(CONFIG_40x) || defined(CONFIG_PPC_8xx)static inline void _tlbil_all (void ) { asmvolatile ("sync; tlbia; isync" : : :"memory" );
@@ -38,7 +38,7 @@ static inline void _tlbil_pid(unsigned int pid) }#define _tlbil_pid_noind (pid) _tlbil_pid(pid) -#else /* CONFIG_40x || CONFIG_8xx */ +#else /* CONFIG_40x || CONFIG_PPC_8xx */ extern void _tlbil_all (void );extern void _tlbil_pid (unsigned int pid);#ifdef CONFIG_PPC_BOOK3E
@@ -46,12 +46,12 @@ extern void _tlbil_pid_noind(unsigned int pid);#else #define _tlbil_pid_noind (pid) _tlbil_pid(pid)#endif -#endif /* !(CONFIG_40x || CONFIG_8xx) */ +#endif /* !(CONFIG_40x || CONFIG_PPC_8xx) */ /* * On 8xx, we directly inline tlbie, on others, it's extern */ -#ifdef CONFIG_8xx +#ifdef CONFIG_PPC_8xxstatic inline void _tlbil_va (unsigned long address,unsigned int pid,unsigned int tsize,unsigned int ind) {
@@ -67,7 +67,7 @@ static inline void _tlbil_va(unsigned long address, unsigned int pid, {__tlbil_va (address, pid); } -#endif /* CONFIG_8xx */ +#endif /* CONFIG_PPC_8xx */ #if defined(CONFIG_PPC_BOOK3E ) || defined(CONFIG_PPC_47x) extern void _tlbivax_bcast(unsigned long address, unsigned int pid,
arch/powerpc/mm/tlb_nohash_low.S +1 -1
@@ -60,7 +60,7 @@ _GLOBAL(__tlbil_va) isync 1: blr -#elif defined(CONFIG_8xx) +#elif defined(CONFIG_PPC_8xx) /* * Nothing to do for 8xx, everything is inline
arch/powerpc/platforms/8xx/Kconfig +0 -1
@@ -5,7 +5,6 @@ config CPM1 choice prompt "8xx Machine Type" depends on PPC_8xx - depends on 8xx default MPC885ADS config MPC8XXFADS
arch/powerpc/platforms/Kconfig.cputype +1 -1
@@ -375,7 +375,7 @@ config NR_CPUS config NOT_COHERENT_CACHE bool - depends on 4xx || 8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON + depends on 4xx || PPC_8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON default n if PPC_47x default y
Signature · 1 line
2.13.3
PATCH 7/12 powerpc/kconfig: Simplify PCI_QSPAN selection
In reply to Christophe Leroy4xx, CPM2 and 8xx cannot be selected at the same time, so no need to test 8xx && !4xx && !CPM2. Testing 8xx is enough.
--- arch/powerpc/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/Kconfig +2 -2
@@ -958,7 +958,7 @@ config PCI bool "PCI support" if PPC_PCI_CHOICE default y if !40x && !CPM2 && !8xx && !PPC_83xx \ && !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON - default PCI_QSPAN if !4xx && !CPM2 && 8xx + default PCI_QSPAN if PPC_8xx select GENERIC_PCI_IOMAP help Find out whether your system includes a PCI bus. PCI is the name of
@@ -974,7 +974,7 @@ config PCI_SYSCALL config PCI_QSPAN bool "QSpan PCI" - depends on !4xx && !CPM2 && 8xx + depends on PPC_8xx select PPC_I8259 help Say Y here if you have a system based on a Motorola 8xx-series
Signature · 1 line
2.13.3
PATCH 9/12 powerpc/8xx: remove CONFIG_8xx
In reply to Christophe LeroyTwo config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
arch/powerpc/platforms/Kconfig.cputype has contained the following comment about CONFIG_8xx item for some years:
"# this is temp to handle compat with arch=ppc"
There is no more users of CONFIG_8xx, so remove it.
--- arch/powerpc/platforms/Kconfig.cputype | 5 ----- 1 file changed, 5 deletions(-)
arch/powerpc/platforms/Kconfig.cputype +0 -5
@@ -32,7 +32,6 @@ config PPC_85xx config PPC_8xx bool "Freescale 8xx" select FSL_SOC - select 8xx select PPC_LIB_RHEAP select SYS_SUPPORTS_HUGETLBFS
@@ -149,10 +148,6 @@ config 6xx depends on PPC32 && PPC_BOOK3S select PPC_HAVE_PMU_SUPPORT -# this is temp to handle compat with arch=ppc -config 8xx - bool - config E500 select FSL_EMB_PERFMON select PPC_FSL_BOOK3E
Signature · 1 line
2.13.3
PATCH 10/12 powerpc/8xx: Use symbolic PVR value
In reply to Christophe LeroyFor the 8xx, PVR values defined in arch/powerpc/include/asm/reg.h are nowhere used.
Remove all defines and add PVR_8xx
Use it in arch/powerpc/kernel/cputable.c
--- arch/powerpc/include/asm/reg.h | 6 ++---- arch/powerpc/kernel/cputable.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/reg.h +2 -4
@@ -1247,10 +1247,8 @@* differentiated by the version number in the Communication Processor * Module (CPM). */ -#define PVR_821 0x00500000 -#define PVR_823 PVR_821 -#define PVR_850 PVR_821 -#define PVR_860 PVR_821 +#define PVR_8xx 0x00500000 +#define PVR_8240 0x00810100#define PVR_8245 0x80811014#define PVR_8260 PVR_8240
arch/powerpc/kernel/cputable.c +1 -1
@@ -1262,7 +1262,7 @@ static struct cpu_spec __initdata cpu_specs[] = {#ifdef CONFIG_PPC_8xx {/* 8xx */ .pvr_mask = 0xffff0000, - .pvr_value = 0x00500000, + .pvr_value = PVR_8xx, .cpu_name = "8xx",/* CPU_FTR_MAYBE_CAN_DOZE is possible, * if the 8xx code is there.... */
Signature · 1 line
2.13.3
PATCH 11/12 powerpc/8xx: Use symbolic names for DSISR bits in DSI
In reply to Christophe LeroyUse symbolic names for DSISR bits in DSI
--- arch/powerpc/kernel/head_8xx.S | 2 +- arch/powerpc/mm/fault.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/head_8xx.S +1 -1
@@ -595,7 +595,7 @@ DARFixed:/* Return from dcbx instruction bug workaround */ mfspr r5,SPRN_DSISR stw r5,_DSISR(r11) mfspr r4,SPRN_DAR - andis. r10,r5,0x4000 + andis. r10,r5,DSISR_NOHPTE@h beq+ 1f tlbie r4 dtlbie:
arch/powerpc/mm/fault.c +1 -1
@@ -392,7 +392,7 @@ static void sanity_check_fault(bool is_write, unsigned long error_code) { }#else #define page_fault_is_write (__err) ((__err) & DSISR_ISSTORE)#if defined(CONFIG_PPC_8xx) -#define page_fault_is_bad (__err) ((__err) & 0x10000000) +#define page_fault_is_bad (__err) ((__err) & DSISR_NOEXEC_OR_G)#elif defined(CONFIG_PPC64 )#define page_fault_is_bad (__err) ((__err) & DSISR_BAD_FAULT_64S)#else
Signature · 1 line
2.13.3
PATCH 12/12 powerpc/8xx: Remove cpu dependent macro instructions from head_8xx
In reply to Christophe Leroyhead_8xx is dedicated to 8xx so no need to use macros that depends on the CPU
--- arch/powerpc/kernel/head_8xx.S | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/powerpc/kernel/head_8xx.S +1 -4
@@ -123,7 +123,6 @@ turn_on_mmu: lis r0,start_here@h ori r0,r0,start_here@l mtspr SPRN_SRR0,r0 - SYNC rfi /* enables MMU */ /*
@@ -170,7 +169,7 @@ turn_on_mmu: stw r1,0(r11); \ tovirt(r1,r11); /* set new kernel sp */ \ li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \ - MTMSRD(r10); /* (except for mach check in rtas) */ \ + mtmsr r10; \ stw r0,GPR0(r11); \ SAVE_4GPRS(3, r11); \ SAVE_2GPRS(7, r11)
@@ -915,10 +914,8 @@ start_here: rfi /* Load up the kernel context */ 2: - SYNC /* Force all PTE updates to finish */ tlbia /* Clear all TLB entries */ sync /* wait for tlbia/tlbie to finish */ - TLBSYNC /* ... on all CPUs */ /* set up the PTE pointers for the Abatron bdiGDB. */
Signature · 1 line
2.13.3
Re: [01/12] powerpc/8xx: Simplify CONFIG_8xx checks in Makefile
In reply to Christophe LeroyQuoted 5 lines · Christophe Leroy
The entire 8xx directory is omitted if
CONFIG_8xxis not enabled, so within the 8xx/MakefileCONFIG_8xxis always y. So convert obj-$(CONFIG_8xx) to the more obvious obj-y.Signed-off-by Christophe Leroy <[email protected]>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0e23e7b32bfdaaa8892d8383114f84
cheers