]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
powerpc/85xx: Cleanup handling of PVR detection for e500/e500mc/e5500
authorKumar Gala <galak@kernel.crashing.org>
Mon, 25 Jul 2011 14:28:39 +0000 (09:28 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 29 Jul 2011 13:53:39 +0000 (08:53 -0500)
At some point we broke the detection of e500v1 class cores.  Fix that
and simply the code to just utilize PVR_VER() to have a single case
statement.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/cpu/mpc85xx/cpu.c
arch/powerpc/include/asm/processor.h

index ce59c2580a1ef83cb9b1cc00506ede9ad85e8953..976e86ef414cb6fa600854d4de3c11e824f8a331 100644 (file)
@@ -46,7 +46,6 @@ int checkcpu (void)
 {
        sys_info_t sysinfo;
        uint pvr, svr;
-       uint fam;
        uint ver;
        uint major, minor;
        struct cpu_type *cpu;
@@ -94,30 +93,25 @@ int checkcpu (void)
        printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr);
 
        pvr = get_pvr();
-       fam = PVR_FAM(pvr);
        ver = PVR_VER(pvr);
        major = PVR_MAJ(pvr);
        minor = PVR_MIN(pvr);
 
        printf("Core:  ");
-       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 {
+       switch(ver) {
+       case PVR_VER_E500_V1:
+       case PVR_VER_E500_V2:
+               puts("E500");
+               break;
+       case PVR_VER_E500MC:
+               puts("E500MC");
+               break;
+       case PVR_VER_E5500:
+               puts("E5500");
+               break;
+       default:
                puts("Unknown");
+               break;
        }
 
        printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr);
index 9c4651a6b8fb2be66aa41eae31f09d75b4f64370..0c4cc2554bde04bcdd0d8a171154bf15e724e192 100644 (file)
 #define PVR_85xx       0x80200000
 #define PVR_85xx_REV1  (PVR_85xx | 0x0010)
 #define PVR_85xx_REV2  (PVR_85xx | 0x0020)
+#define PVR_VER_E500_V1        0x8020
+#define PVR_VER_E500_V2        0x8021
+#define PVR_VER_E500MC 0x8023
+#define PVR_VER_E5500  0x8024
 
 #define PVR_86xx       0x80040000