[U-Boot] [PATCH] powerpc/85xx: Add recognition of e5500 core

Signed-off-by: Kumar Gala galak@kernel.crashing.org --- arch/powerpc/cpu/mpc85xx/cpu.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index fddeb2f..25fb25c 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -93,18 +93,18 @@ int checkcpu (void) minor = PVR_MIN(pvr);
printf("Core: "); - switch (fam) { - case PVR_FAM(PVR_85xx): - puts("E500"); - break; - default: - puts("Unknown"); - break; + if (PVR_FAM(PVR_85xx)) { + if(PVR_MEM(pvr) <= 0x3) { + puts("E500"); + if (PVR_MEM(pvr) == 0x03) + puts("MC"); + } else { + puts("E5500"); + } + } else { + puts("Unknown"); }
- if (PVR_MEM(pvr) == 0x03) - puts("MC"); - printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr);
get_sys_info(&sysinfo);

The e5500 has a link register stack and segment target address cache. Its safe to enable these bits on older e500 cores as the bits are implemented in the register.
Signed-off-by: Kumar Gala galak@kernel.crashing.org --- arch/powerpc/include/asm/processor.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index 9ec319a..844552c 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h @@ -534,9 +534,11 @@ #define SPRN_MCSRR0 0x23a /* Machine Check Save and Restore Register 0 */ #define SPRN_MCSRR1 0x23b /* Machine Check Save and Restore Register 1 */ #define SPRN_BUCSR 0x3f5 /* Branch Control and Status Register */ +#define BUCSR_STAC_EN 0x01000000 /* Segment target addr cache enable */ +#define BUCSR_LS_EN 0x00400000 /* Link stack enable */ #define BUCSR_BBFI 0x00000200 /* Branch buffer flash invalidate */ #define BUCSR_BPEN 0x00000001 /* Branch prediction enable */ -#define BUCSR_ENABLE (BUCSR_BBFI|BUCSR_BPEN) +#define BUCSR_ENABLE (BUCSR_STAC_EN|BUCSR_LS_EN|BUCSR_BBFI|BUCSR_BPEN) #define SPRN_BBEAR 0x201 /* Branch Buffer Entry Address Register */ #define SPRN_BBTAR 0x202 /* Branch Buffer Target Address Register */ #define SPRN_PID1 0x279 /* Process ID Register 1 */

On Jun 30, 2010, at 4:48 AM, Kumar Gala wrote:
The e5500 has a link register stack and segment target address cache. Its safe to enable these bits on older e500 cores as the bits are implemented in the register.
Signed-off-by: Kumar Gala galak@kernel.crashing.org
arch/powerpc/include/asm/processor.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
applied to 85xx
- k

On Jun 30, 2010, at 4:48 AM, Kumar Gala wrote:
Signed-off-by: Kumar Gala galak@kernel.crashing.org
arch/powerpc/cpu/mpc85xx/cpu.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
applied to 85xx
- k

Dear Kumar Gala,
In message 1277891327-24506-1-git-send-email-galak@kernel.crashing.org you wrote:
Signed-off-by: Kumar Gala galak@kernel.crashing.org
arch/powerpc/cpu/mpc85xx/cpu.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index fddeb2f..25fb25c 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -93,18 +93,18 @@ int checkcpu (void) minor = PVR_MIN(pvr);
printf("Core: ");
- switch (fam) {
- case PVR_FAM(PVR_85xx):
puts("E500");
break;
- default:
puts("Unknown");
break;
- if (PVR_FAM(PVR_85xx)) {
if(PVR_MEM(pvr) <= 0x3) {
puts("E500");
if (PVR_MEM(pvr) == 0x03)
puts("MC");
} else {
puts("E5500");
}
Is it guaranteed that all higher PVR values will always be E5500? Otherwise we should rather not use an "else" here?
Best regards,
Wolfgang Denk

Signed-off-by: Kumar Gala galak@kernel.crashing.org --- * use case statement and handle unknown values
arch/powerpc/cpu/mpc85xx/cpu.c | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index fb8fa5e..fe2b52d 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -95,18 +95,26 @@ int checkcpu (void) minor = PVR_MIN(pvr);
printf("Core: "); - switch (fam) { - case PVR_FAM(PVR_85xx): - puts("E500"); - break; - default: - puts("Unknown"); - break; + if (PVR_FAM(PVR_85xx)) { + switch(PVR_MEM(pvr)) { + case 0x1: + case 0x2: + puts("E500"); + break; + case 0x3: + puts("E500MC"); + break; + case 0x4: + puts("E5500"); + break; + default: + puts("Unknown"); + break; + } + } else { + puts("Unknown"); }
- if (PVR_MEM(pvr) == 0x03) - puts("MC"); - printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr);
get_sys_info(&sysinfo);
participants (2)
-
Kumar Gala
-
Wolfgang Denk