Re: [PATCH v2] powerpc/fsl-booke: Add support for FSL 64-bit e5500 core

2010-10-13 Thread Kumar Gala

On Oct 12, 2010, at 3:11 PM, Scott Wood wrote:

 On Tue, 12 Oct 2010 14:55:42 -0500
 Kumar Gala ga...@kernel.crashing.org wrote:
 
 
 On Oct 12, 2010, at 12:33 PM, Scott Wood wrote:
 
 On Tue, 12 Oct 2010 10:50:52 -0500
 Kumar Gala ga...@kernel.crashing.org 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.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 * Updated to remove CONFIG_PPC_E5500 and use E500MC
 
 It still has E500 || E500MC all over the place...
 
 If E500MC is not going to imply E500 that should be consistent for both
 32 and 64 bit -- though I think it would make more sense that E500MC
 does imply E500.
 
 -Scott
 
 I have a problem with Kconfig and getting E500MC option to only exist in the 
 proper cases.
 
 Does having P5020DS (and any future 64-bit-capable board)
 explicitly select E500 as well as PPC_E500MC avoid the issue?

it does, kinda ugly but oh well.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2] powerpc/fsl-booke: Add support for FSL 64-bit e5500 core

2010-10-12 Thread Kumar Gala
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 ga...@kernel.crashing.org
---
* Updated to remove CONFIG_PPC_E5500 and use E500MC

 arch/powerpc/include/asm/reg_booke.h  |3 ++-
 arch/powerpc/kernel/Makefile  |1 +
 arch/powerpc/kernel/cpu_setup_fsl_booke.S |   15 +++
 arch/powerpc/kernel/cputable.c|   26 +-
 arch/powerpc/kernel/traps.c   |8 +++-
 arch/powerpc/platforms/85xx/Kconfig   |4 
 arch/powerpc/platforms/Kconfig.cputype|   19 ---
 7 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/include/asm/reg_booke.h 
b/arch/powerpc/include/asm/reg_booke.h
index 667a498..5e7ab0c 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -203,7 +203,8 @@
 #define PPC47x_MCSR_FPR0x0080 /* FPR parity error */
 #define PPC47x_MCSR_IPR0x0040 /* Imprecise Machine Check Exception 
*/
 
-#ifdef CONFIG_E500
+#if defined(CONFIG_E500) || defined(CONFIG_PPC_E500MC) \
+   || defined(CONFIG_PPC_BOOK3E_64)
 /* All e500 */
 #define MCSR_MCP   0x8000UL /* Machine Check Input Pin */
 #define MCSR_ICPERR0x4000UL /* I-Cache Parity Error */
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 1dda701..ac4aadf 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -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/
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S 
b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
index 0adb50a..894e64f 100644
--- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -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
mtlrr4
blr
+#endif
+/* Right now, restore and setup are the same thing */
+_GLOBAL(__restore_cpu_e5500)
+_GLOBAL(__setup_cpu_e5500)
+   mflrr4
+   bl  __e500_icache_setup
+   bl  __e500_dcache_setup
+#ifdef CONFIG_PPC_BOOK3E_64
+   bl  .__setup_base_ivors
+#else
+   bl  __setup_e500mc_ivors
+#endif
+   mtlrr4
+   blr
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 1f9123f..f93a061 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -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,6 +1895,27 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc5554,
}
 #endif /* CONFIG_E200 */
+#endif /* CONFIG_PPC32 */
+#if defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_E500)
+   {   /* e5500 */
+   .pvr_mask   = 0x,
+   .pvr_value  = 0x8024,
+   .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
 #ifdef CONFIG_E500
{   /* e500 */
.pvr_mask   = 0x,
@@ -1961,7 +1986,6 @@ 

Re: [PATCH v2] powerpc/fsl-booke: Add support for FSL 64-bit e5500 core

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 10:50:52 -0500
Kumar Gala ga...@kernel.crashing.org 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.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 * Updated to remove CONFIG_PPC_E5500 and use E500MC

It still has E500 || E500MC all over the place...

If E500MC is not going to imply E500 that should be consistent for both
32 and 64 bit -- though I think it would make more sense that E500MC
does imply E500.

-Scott

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2] powerpc/fsl-booke: Add support for FSL 64-bit e5500 core

2010-10-12 Thread Kumar Gala

On Oct 12, 2010, at 12:33 PM, Scott Wood wrote:

 On Tue, 12 Oct 2010 10:50:52 -0500
 Kumar Gala ga...@kernel.crashing.org 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.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 * Updated to remove CONFIG_PPC_E5500 and use E500MC
 
 It still has E500 || E500MC all over the place...
 
 If E500MC is not going to imply E500 that should be consistent for both
 32 and 64 bit -- though I think it would make more sense that E500MC
 does imply E500.
 
 -Scott

I have a problem with Kconfig and getting E500MC option to only exist in the 
proper cases.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2] powerpc/fsl-booke: Add support for FSL 64-bit e5500 core

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 14:55:42 -0500
Kumar Gala ga...@kernel.crashing.org wrote:

 
 On Oct 12, 2010, at 12:33 PM, Scott Wood wrote:
 
  On Tue, 12 Oct 2010 10:50:52 -0500
  Kumar Gala ga...@kernel.crashing.org 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.
  
  Signed-off-by: Kumar Gala ga...@kernel.crashing.org
  ---
  * Updated to remove CONFIG_PPC_E5500 and use E500MC
  
  It still has E500 || E500MC all over the place...
  
  If E500MC is not going to imply E500 that should be consistent for both
  32 and 64 bit -- though I think it would make more sense that E500MC
  does imply E500.
  
  -Scott
 
 I have a problem with Kconfig and getting E500MC option to only exist in the 
 proper cases.

Does having P5020DS (and any future 64-bit-capable board)
explicitly select E500 as well as PPC_E500MC avoid the issue?

-Scott

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev