Skip to contentSkip to conversation

powerpc/fsl-booke: Add support for FSL 64-bit e5500 core

PATCH Superseded Kumar Gala 2 participants 4 messages Oct 13, 2010

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH v3 1/1 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.

---
* clean up kconfig further to reduce use of E500MC

 arch/powerpc/include/asm/reg_booke.h      |    2 +-
 arch/powerpc/kernel/Makefile              |    3 +++
 arch/powerpc/kernel/cpu_setup_fsl_booke.S |   15 +++++++++++++++
 arch/powerpc/kernel/cputable.c            |   28 ++++++++++++++++++++++++++--
 arch/powerpc/kernel/traps.c               |    7 ++++++-
 arch/powerpc/platforms/85xx/Kconfig       |    4 ++++
 arch/powerpc/platforms/Kconfig.cputype    |    9 +++++++--
 7 files changed, 62 insertions(+), 6 deletions(-)
arch/powerpc/include/asm/reg_booke.h +1 -1
index 667a498..3a2eaba 100644
@@ -203,7 +203,7 @@
 #define PPC47x_MCSR_FPR	0x00800000 /* FPR parity error */
 #define PPC47x_MCSR_IPR	0x00400000 /* Imprecise Machine Check Exception */
 
-#ifdef CONFIG_E500
+#if defined(CONFIG_E500) || defined(CONFIG_PPC_BOOK3E_64)
 /* All e500 */
 #define MCSR_MCP 	0x80000000UL /* Machine Check Input Pin */
 #define MCSR_ICPERR 	0x40000000UL /* I-Cache Parity Error */
arch/powerpc/kernel/Makefile +3 -0
index 1dda701..5175d1e 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_PPC64)		+= setup_64.o sys_ppc32.o \
 				   paca.o nvram_64.o firmware.o
 obj-$(CONFIG_HAVE_HW_BREAKPOINT)	+= hw_breakpoint.o
 obj-$(CONFIG_PPC_BOOK3S_64)	+= cpu_setup_ppc970.o cpu_setup_pa6t.o
+obj-$(CONFIG_PPC_BOOK3E_64)	+= cpu_setup_fsl_booke.o
 obj64-$(CONFIG_RELOCATABLE)	+= reloc_64.o
 obj-$(CONFIG_PPC_BOOK3E_64)	+= exceptions-64e.o idle_book3e.o
 obj-$(CONFIG_PPC64)		+= vdso64/
@@ -55,7 +56,9 @@ obj-$(CONFIG_IBMVIO)		+= vio.o
 obj-$(CONFIG_IBMEBUS)           += ibmebus.o
 obj-$(CONFIG_GENERIC_TBSYNC)	+= smp-tbsync.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
+ifeq ($(CONFIG_PPC32),y)
 obj-$(CONFIG_E500)		+= idle_e500.o
+endif
 obj-$(CONFIG_6xx)		+= idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
 obj-$(CONFIG_TAU)		+= tau_6xx.o
 obj-$(CONFIG_HIBERNATION)	+= swsusp.o suspend.o
arch/powerpc/kernel/cpu_setup_fsl_booke.S +15 -0
index 0adb50a..894e64f 100644
@@ -51,6 +51,7 @@ _GLOBAL(__e500_dcache_setup)
 	isync
 	blr
 
+#ifdef CONFIG_PPC32
 _GLOBAL(__setup_cpu_e200)
 	/* enable dedicated debug exception handling resources (Debug APU) */
 	mfspr	r3,SPRN_HID0
@@ -72,3 +73,17 @@ _GLOBAL(__setup_cpu_e500mc)
 	bl	__setup_e500mc_ivors
 	mtlr	r4
 	blr
+#endif
+/* Right now, restore and setup are the same thing */
+_GLOBAL(__restore_cpu_e5500)
+_GLOBAL(__setup_cpu_e5500)
+	mflr	r4
+	bl	__e500_icache_setup
+	bl	__e500_dcache_setup
+#ifdef CONFIG_PPC_BOOK3E_64
+	bl	.__setup_base_ivors
+#else
+	bl	__setup_e500mc_ivors
+#endif
+	mtlr	r4
+	blr
arch/powerpc/kernel/cputable.c +26 -2
index 1f9123f..236aa73 100644
@@ -66,6 +66,10 @@ extern void __restore_cpu_ppc970(void);
 extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);
 extern void __restore_cpu_power7(void);
 #endif /* CONFIG_PPC64 */
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)
+extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
+extern void __restore_cpu_e5500(void);
+#endif /* CONFIG_PPC_BOOK3E_64 || CONFIG_E500 */
 
 /* This table only contains "desktop" CPUs, it need to be filled with embedded
  * ones as well...
@@ -1891,7 +1895,28 @@ static struct cpu_spec __initdata cpu_specs[] = {
 		.platform		= "ppc5554",
 	}
 #endif /* CONFIG_E200 */
-#ifdef CONFIG_E500
+#endif /* CONFIG_PPC32 */
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)
+	{	/* e5500 */
+		.pvr_mask		= 0xffff0000,
+		.pvr_value		= 0x80240000,
+		.cpu_name		= "e5500",
+		.cpu_features		= CPU_FTRS_E500MC,
+		.cpu_user_features	= COMMON_USER_BOOKE,
+		.mmu_features		= MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
+			MMU_FTR_USE_TLBILX,
+		.icache_bsize		= 64,
+		.dcache_bsize		= 64,
+		.num_pmcs		= 4,
+		.oprofile_cpu_type	= "ppc/e500mc",
+		.oprofile_type		= PPC_OPROFILE_FSL_EMB,
+		.cpu_setup		= __setup_cpu_e5500,
+		.cpu_restore		= __restore_cpu_e5500,
+		.machine_check		= machine_check_e500mc,
+		.platform		= "ppce5500",
+	},
+#endif
+#if defined(CONFIG_PPC32) & defined(CONFIG_E500)
 	{	/* e500 */
 		.pvr_mask		= 0xffff0000,
 		.pvr_value		= 0x80200000,
@@ -1961,7 +1986,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
 		.platform		= "powerpc",
 	}
 #endif /* CONFIG_E500 */
-#endif /* CONFIG_PPC32 */
 
 #ifdef CONFIG_PPC_BOOK3E_64
 	{	/* This is a default entry to get going, to be replaced by
arch/powerpc/kernel/traps.c +6 -1
index a45a63c..5e0985f 100644
@@ -418,7 +418,7 @@ int machine_check_47x(struct pt_regs *regs)
 
 	return 0;
 }
-#elif defined(CONFIG_E500)
+#elif defined(CONFIG_E500) || defined(CONFIG_PPC_BOOK3E_64)
 int machine_check_e500mc(struct pt_regs *regs)
 {
 	unsigned long mcsr = mfspr(SPRN_MCSR);
@@ -538,6 +538,11 @@ int machine_check_e500(struct pt_regs *regs)
 
 	return 0;
 }
+
+int machine_check_generic(struct pt_regs *regs)
+{
+	return 0;
+}
 #elif defined(CONFIG_E200)
 int machine_check_e200(struct pt_regs *regs)
 {
arch/powerpc/platforms/85xx/Kconfig +4 -0
index 5bde1f2..ae25527 100644
@@ -11,6 +11,8 @@ menuconfig FSL_SOC_BOOKE
 
 if FSL_SOC_BOOKE
 
+if PPC32
+
 config MPC8540_ADS
 	bool "Freescale MPC8540 ADS"
 	select DEFAULT_UIMAGE
@@ -177,6 +179,8 @@ config P4080_DS
 	help
 	  This option enables support for the P4080 DS board
 
+endif # PPC32
+
 endif # FSL_SOC_BOOKE
 
 config TQM85xx
arch/powerpc/platforms/Kconfig.cputype +7 -2
index d361f81..b946223 100644
@@ -129,8 +129,8 @@ config E500
 
 config PPC_E500MC
 	bool "e500mc Support"
-	select PPC_FPU
 	depends on E500
+	select PPC_FPU
 
 config PPC_FPU
 	bool
@@ -166,9 +166,14 @@ config BOOKE
 
 config FSL_BOOKE
 	bool
-	depends on E200 || E500
+	depends on (E200 || E500) && PPC32
 	default y
 
+# this is for common code between PPC32 & PPC64 FSL BOOKE
+config PPC_FSL_BOOK3E
+	bool
+	select FSL_EMB_PERFMON
+	default y if FSL_BOOKE
 
 config PTE_64BIT
 	bool
Signature · 1 line
1.7.2.3
author
#1 lore raw

PATCH v3 1/1 powerpc/fsl-booke: Add p5020 DS board support

The P5020DS is in the same family of boards as the P4080 DS and thus shares the corenet_ds code.

---
* Updated based on e5500 support patch

 arch/powerpc/platforms/85xx/Kconfig    |   13 ++++++
 arch/powerpc/platforms/85xx/Makefile   |    1 +
 arch/powerpc/platforms/85xx/p5020_ds.c |   69 ++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/85xx/p5020_ds.c
arch/powerpc/platforms/85xx/Kconfig +13 -0
index ae25527..2830e0a 100644
@@ -181,6 +181,19 @@ config P4080_DS
 
 endif # PPC32
 
+config P5020_DS
+	bool "Freescale P5020 DS"
+	select DEFAULT_UIMAGE
+	select PPC_FSL_BOOK3E
+	select E500
+	select PPC_E500MC
+	select PHYS_64BIT
+	select SWIOTLB
+	select MPC8xxx_GPIO
+	select HAS_RAPIDIO
+	help
+	  This option enables support for the P5020 DS board
+
 endif # FSL_SOC_BOOKE
 
 config TQM85xx
arch/powerpc/platforms/85xx/Makefile +1 -0
index c3ac071..dd70db7 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
 obj-$(CONFIG_P1022_DS)    += p1022_ds.o
 obj-$(CONFIG_P3041_DS)    += p3041_ds.o corenet_ds.o
 obj-$(CONFIG_P4080_DS)    += p4080_ds.o corenet_ds.o
+obj-$(CONFIG_P5020_DS)    += p5020_ds.o corenet_ds.o
 obj-$(CONFIG_STX_GP3)	  += stx_gp3.o
 obj-$(CONFIG_TQM85xx)	  += tqm85xx.o
 obj-$(CONFIG_SBC8560)     += sbc8560.o
arch/powerpc/platforms/85xx/p5020_ds.c new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#2 lore raw
In reply to Kumar Gala
Quoted 7 lines · On Wed, 13 Oct 2010 08:17:11 -0500 Kumar Gala <[email protected]> wrote:

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.

---
* clean up kconfig further to reduce use of E500MC

Looks better, just a few nits:

arch/powerpc/include/asm/reg_booke.h line 209

Quoted 5 lines
arch/powerpc/include/asm/reg_booke.h +1 -1
-#ifdef CONFIG_E500
+#if defined(CONFIG_E500) || defined(CONFIG_PPC_BOOK3E_64)
 /* All e500 */
 #define MCSR_MCP 	0x80000000UL /* Machine Check Input Pin */
 #define MCSR_ICPERR 	0x40000000UL /* I-Cache Parity Error */

Is this really supposed to be here for all 64-bit book3e? Likewise in the C code.

Quoted 1 line

+obj-$(CONFIG_PPC_BOOK3E_64) += cpu_setup_fsl_booke.o

CONFIG_PPC_FSL_BOOK3E?

arch/powerpc/kernel/cputable.c extern void __restore_cpu_ppc970(void); · line 72

Quoted 8 lines
arch/powerpc/kernel/cputable.c +4 -0
@@ -66,6 +66,10 @@ extern void __restore_cpu_ppc970(void);
 extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);
 extern void __restore_cpu_power7(void);
 #endif /* CONFIG_PPC64 */
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)
+extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
+extern void __restore_cpu_e5500(void);
+#endif /* CONFIG_PPC_BOOK3E_64 || CONFIG_E500 */

CONFIG_E500 should be sufficient. Not sure why these need to be ifdeffed at all, though it seems to be existing practice here.

arch/powerpc/kernel/cputable.c static struct cpu_spec __initdata cpu_specs[] = { · line 1899

Quoted 9 lines
arch/powerpc/kernel/cputable.c +2 -1
 /* This table only contains "desktop" CPUs, it need to be filled with embedded
  * ones as well...
@@ -1891,7 +1895,28 @@ static struct cpu_spec __initdata cpu_specs[] = {
 		.platform		= "ppc5554",
 	}
 #endif /* CONFIG_E200 */
-#ifdef CONFIG_E500
+#endif /* CONFIG_PPC32 */
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)

Just E500 should work.

arch/powerpc/kernel/traps.c int machine_check_e500(struct pt_regs *regs) · line 545

Quoted 9 lines
arch/powerpc/kernel/traps.c +5 -0
@@ -538,6 +538,11 @@ int machine_check_e500(struct pt_regs *regs)
 
 	return 0;
 }
+
+int machine_check_generic(struct pt_regs *regs)
+{
+	return 0;
+}

Hmm, it seems that either the cputable entry that references this should not be built in if we don't support those chips, or the real implementation shouldn't be under an #else if we are going to support multiplatform coexistence with them.

-Scott

author
#3 lore raw
Quoted 5 lines · Scott Wood

On Wed, 13 Oct 2010 08:17:11 -0500
Kumar Gala <[email protected]> wrote:
=20

Quoted 2 lines

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

Quoted 8 lines
Quoted 5 lines

e500mc.
=20

---
* clean up kconfig further to reduce use of E500MC

=20
Looks better, just a few nits:
=20

Quoted 8 lines
Quoted 5 lines
arch/powerpc/include/asm/reg_booke.h +1 -1
-#ifdef CONFIG_E500
+#if defined(CONFIG_E500) || defined(CONFIG_PPC_BOOK3E_64)

/* All e500 */
#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */

=20
Is this really supposed to be here for all 64-bit book3e? Likewise in the C code.

This is a question I need to ask BenH about. If we intend or desire to = have a single kernel image that works on all 64-bit book3e parts or not.

Quoted 4 lines

=20

Quoted 1 line

+obj-$(CONFIG_PPC_BOOK3E_64) +=3D cpu_setup_fsl_booke.o

=20
CONFIG_PPC_FSL_BOOK3E?

will fix.

Quoted 2 lines
Quoted 2 lines
(quoted diff) +0 -0
@@ -66,6 +66,10 @@ extern void __restore_cpu_ppc970(void);

extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* =

spec);

Quoted 4 lines

Review

Quoted 4 lines

extern void __restore_cpu_power7(void);
#endif /* CONFIG_PPC64 */

(quoted diff) +2 -0
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)
+extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* =

spec);

Quoted 5 lines

arch/powerpc/kernel/cputable.c extern void __restore_cpu_ppc970(void); · line 72

Quoted 2 lines
arch/powerpc/kernel/cputable.c +2 -0
+extern void __restore_cpu_e5500(void);
+#endif /* CONFIG_PPC_BOOK3E_64 || CONFIG_E500 */

=20
CONFIG_E500 should be sufficient. Not sure why these need to be ifdeffed at all, though it seems to be existing practice here.

again, about if we want a generic ppc64e build or not, but I'm now = thinking that would end up setting CONFIG_E500 anyways.

Quoted 1 line
Quoted 1 line

/* This table only contains "desktop" CPUs, it need to be filled with =

embedded

Quoted 2 lines

Review static struct cpu_spec __initdata cpu_specs[] =

Quoted 2 lines

* ones as well...

(quoted diff) +0 -0
@@ -1891,7 +1895,28 @@ static struct cpu_spec __initdata cpu_specs[] =

=3D {

Quoted 9 lines

arch/powerpc/kernel/cputable.c static struct cpu_spec __initdata cpu_specs[] = { · line 1899

Quoted 6 lines
arch/powerpc/kernel/cputable.c +2 -1
 		.platform		=3D "ppc5554",
 	}
 #endif /* CONFIG_E200 */
-#ifdef CONFIG_E500
+#endif /* CONFIG_PPC32 */
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)

=20
Just E500 should work.
=20

Quoted 14 lines

arch/powerpc/kernel/traps.c int machine_check_e500(struct pt_regs *regs) · line 545

Quoted 9 lines
(quoted diff) +0 -0
@@ -538,6 +538,11 @@ int machine_check_e500(struct pt_regs *regs)

=20

	return 0;
}
arch/powerpc/kernel/traps.c +5 -0
+
+int machine_check_generic(struct pt_regs *regs)
+{
+	return 0;
+}

=20
Hmm, it seems that either the cputable entry that references this should not be built in if we don't support those chips, or the real implementation shouldn't be under an #else if we are going to support multiplatform coexistence with them.

- k=