Skip to content

Commit 4490c06

Browse files
committed
powerpc/fsl-booke: Add support for FSL 64-bit e5500 core
The new e5500 core is similar to the e500mc core but adds 64-bit support. We support running it in 32-bit mode as it is identical to the e500mc. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
1 parent 6db92cc commit 4490c06

6 files changed

Lines changed: 61 additions & 4 deletions

File tree

‎arch/powerpc/kernel/Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ obj-$(CONFIG_IBMVIO) += vio.o
5555
obj-$(CONFIG_IBMEBUS) += ibmebus.o
5656
obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
5757
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
58+
ifeq ($(CONFIG_PPC32),y)
5859
obj-$(CONFIG_E500) += idle_e500.o
60+
endif
5961
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
6062
obj-$(CONFIG_TAU) += tau_6xx.o
6163
obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
@@ -67,7 +69,7 @@ endif
6769
obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o
6870
obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o
6971
obj-$(CONFIG_44x) += cpu_setup_44x.o
70-
obj-$(CONFIG_FSL_BOOKE) += cpu_setup_fsl_booke.o dbell.o
72+
obj-$(CONFIG_PPC_FSL_BOOK3E) += cpu_setup_fsl_booke.o dbell.o
7173
obj-$(CONFIG_PPC_BOOK3E_64) += dbell.o
7274

7375
extra-y := head_$(CONFIG_WORD_SIZE).o

‎arch/powerpc/kernel/cpu_setup_fsl_booke.S‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ _GLOBAL(__e500_dcache_setup)
5151
isync
5252
blr
5353

54+
#ifdef CONFIG_PPC32
5455
_GLOBAL(__setup_cpu_e200)
5556
/* enable dedicated debug exception handling resources (Debug APU) */
5657
mfspr r3,SPRN_HID0
@@ -72,3 +73,17 @@ _GLOBAL(__setup_cpu_e500mc)
7273
bl __setup_e500mc_ivors
7374
mtlr r4
7475
blr
76+
#endif
77+
/* Right now, restore and setup are the same thing */
78+
_GLOBAL(__restore_cpu_e5500)
79+
_GLOBAL(__setup_cpu_e5500)
80+
mflr r4
81+
bl __e500_icache_setup
82+
bl __e500_dcache_setup
83+
#ifdef CONFIG_PPC_BOOK3E_64
84+
bl .__setup_base_ivors
85+
#else
86+
bl __setup_e500mc_ivors
87+
#endif
88+
mtlr r4
89+
blr

‎arch/powerpc/kernel/cputable.c‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ extern void __restore_cpu_ppc970(void);
6666
extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);
6767
extern void __restore_cpu_power7(void);
6868
#endif /* CONFIG_PPC64 */
69+
#if defined(CONFIG_E500)
70+
extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
71+
extern void __restore_cpu_e5500(void);
72+
#endif /* CONFIG_E500 */
6973

7074
/* This table only contains "desktop" CPUs, it need to be filled with embedded
7175
* ones as well...
@@ -1891,7 +1895,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
18911895
.platform = "ppc5554",
18921896
}
18931897
#endif /* CONFIG_E200 */
1898+
#endif /* CONFIG_PPC32 */
18941899
#ifdef CONFIG_E500
1900+
#ifdef CONFIG_PPC32
18951901
{ /* e500 */
18961902
.pvr_mask = 0xffff0000,
18971903
.pvr_value = 0x80200000,
@@ -1946,6 +1952,26 @@ static struct cpu_spec __initdata cpu_specs[] = {
19461952
.machine_check = machine_check_e500mc,
19471953
.platform = "ppce500mc",
19481954
},
1955+
#endif /* CONFIG_PPC32 */
1956+
{ /* e5500 */
1957+
.pvr_mask = 0xffff0000,
1958+
.pvr_value = 0x80240000,
1959+
.cpu_name = "e5500",
1960+
.cpu_features = CPU_FTRS_E500MC,
1961+
.cpu_user_features = COMMON_USER_BOOKE,
1962+
.mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
1963+
MMU_FTR_USE_TLBILX,
1964+
.icache_bsize = 64,
1965+
.dcache_bsize = 64,
1966+
.num_pmcs = 4,
1967+
.oprofile_cpu_type = "ppc/e500mc",
1968+
.oprofile_type = PPC_OPROFILE_FSL_EMB,
1969+
.cpu_setup = __setup_cpu_e5500,
1970+
.cpu_restore = __restore_cpu_e5500,
1971+
.machine_check = machine_check_e500mc,
1972+
.platform = "ppce5500",
1973+
},
1974+
#ifdef CONFIG_PPC32
19491975
{ /* default match */
19501976
.pvr_mask = 0x00000000,
19511977
.pvr_value = 0x00000000,
@@ -1960,8 +1986,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
19601986
.machine_check = machine_check_e500,
19611987
.platform = "powerpc",
19621988
}
1963-
#endif /* CONFIG_E500 */
19641989
#endif /* CONFIG_PPC32 */
1990+
#endif /* CONFIG_E500 */
19651991

19661992
#ifdef CONFIG_PPC_BOOK3E_64
19671993
{ /* This is a default entry to get going, to be replaced by

‎arch/powerpc/kernel/traps.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,11 @@ int machine_check_e500(struct pt_regs *regs)
538538

539539
return 0;
540540
}
541+
542+
int machine_check_generic(struct pt_regs *regs)
543+
{
544+
return 0;
545+
}
541546
#elif defined(CONFIG_E200)
542547
int machine_check_e200(struct pt_regs *regs)
543548
{

‎arch/powerpc/platforms/85xx/Kconfig‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ menuconfig FSL_SOC_BOOKE
1111

1212
if FSL_SOC_BOOKE
1313

14+
if PPC32
15+
1416
config MPC8540_ADS
1517
bool "Freescale MPC8540 ADS"
1618
select DEFAULT_UIMAGE
@@ -167,7 +169,6 @@ config P3041_DS
167169
config P4080_DS
168170
bool "Freescale P4080 DS"
169171
select DEFAULT_UIMAGE
170-
select PPC_FSL_BOOK3E
171172
select PPC_E500MC
172173
select PHYS_64BIT
173174
select SWIOTLB
@@ -176,6 +177,8 @@ config P4080_DS
176177
help
177178
This option enables support for the P4080 DS board
178179

180+
endif # PPC32
181+
179182
endif # FSL_SOC_BOOKE
180183

181184
config TQM85xx

‎arch/powerpc/platforms/Kconfig.cputype‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ config 8xx
125125

126126
config E500
127127
select FSL_EMB_PERFMON
128+
select PPC_FSL_BOOK3E
128129
bool
129130

130131
config PPC_E500MC
@@ -166,9 +167,14 @@ config BOOKE
166167

167168
config FSL_BOOKE
168169
bool
169-
depends on E200 || E500
170+
depends on (E200 || E500) && PPC32
170171
default y
171172

173+
# this is for common code between PPC32 & PPC64 FSL BOOKE
174+
config PPC_FSL_BOOK3E
175+
bool
176+
select FSL_EMB_PERFMON
177+
default y if FSL_BOOKE
172178

173179
config PTE_64BIT
174180
bool

0 commit comments

Comments
 (0)