common: Drop checkicache() and checkdcache()
authorSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 19:57:38 +0000 (12:57 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2019 23:23:56 +0000 (18:23 -0500)
These are used by only one arch and only within a single file. Drop the
declarations from the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/powerpc/cpu/mpc8xx/cpu.c
include/common.h

index 2b7c5d4301340371b0ea1cf8d4a416fd8a6da7f6..0604433e7265dc7f7801797126079975ae4ddc82 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int check_CPU(long clock, uint pvr, uint immr)
-{
-       immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
-       uint k;
-       char buf[32];
-
-       /* the highest 16 bits should be 0x0050 for a 860 */
-
-       if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
-               return -1;
-
-       k = (immr << 16) |
-           in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
-
-       /*
-        * Some boards use sockets so different CPUs can be used.
-        * We have to check chip version in run time.
-        */
-       switch (k) {
-               /* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
-       case 0x08010004:                /* Rev. A.0 */
-               printf("MPC866xxxZPnnA");
-               break;
-       case 0x08000003:                /* Rev. 0.3 */
-               printf("MPC866xxxZPnn");
-               break;
-       case 0x09000000:                /* 870/875/880/885 */
-               puts("MPC885ZPnn");
-               break;
-
-       default:
-               printf("unknown MPC86x (0x%08x)", k);
-               break;
-       }
-
-       printf(" at %s MHz: ", strmhz(buf, clock));
-
-       print_size(checkicache(), " I-Cache ");
-       print_size(checkdcache(), " D-Cache");
-
-       /* do we have a FEC (860T/P or 852/859/866/885)? */
-
-       out_be32(&immap->im_cpm.cp_fec.fec_addr_low, 0x12345678);
-       if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
-               printf(" FEC present");
-
-       putc('\n');
-
-       return 0;
-}
-
-/* ------------------------------------------------------------------------- */
-
-int checkcpu(void)
-{
-       ulong clock = gd->cpu_clk;
-       uint immr = get_immr(); /* Return full IMMR contents */
-       uint pvr = get_pvr();
-
-       puts("CPU:   ");
-
-       return check_CPU(clock, pvr, immr);
-}
-
 /* ------------------------------------------------------------------------- */
 /* L1 i-cache                                                                */
 
@@ -143,7 +79,7 @@ int checkicache(void)
 /* L1 d-cache                                                                */
 /* call with cache disabled                                                  */
 
-int checkdcache(void)
+static int checkdcache(void)
 {
        immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
        memctl8xx_t __iomem *memctl = &immap->im_memctl;
@@ -175,6 +111,70 @@ int checkdcache(void)
        return lines << 4;
 };
 
+static int check_CPU(long clock, uint pvr, uint immr)
+{
+       immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
+       uint k;
+       char buf[32];
+
+       /* the highest 16 bits should be 0x0050 for a 860 */
+
+       if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
+               return -1;
+
+       k = (immr << 16) |
+           in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
+
+       /*
+        * Some boards use sockets so different CPUs can be used.
+        * We have to check chip version in run time.
+        */
+       switch (k) {
+               /* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
+       case 0x08010004:                /* Rev. A.0 */
+               printf("MPC866xxxZPnnA");
+               break;
+       case 0x08000003:                /* Rev. 0.3 */
+               printf("MPC866xxxZPnn");
+               break;
+       case 0x09000000:                /* 870/875/880/885 */
+               puts("MPC885ZPnn");
+               break;
+
+       default:
+               printf("unknown MPC86x (0x%08x)", k);
+               break;
+       }
+
+       printf(" at %s MHz: ", strmhz(buf, clock));
+
+       print_size(checkicache(), " I-Cache ");
+       print_size(checkdcache(), " D-Cache");
+
+       /* do we have a FEC (860T/P or 852/859/866/885)? */
+
+       out_be32(&immap->im_cpm.cp_fec.fec_addr_low, 0x12345678);
+       if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
+               printf(" FEC present");
+
+       putc('\n');
+
+       return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int checkcpu(void)
+{
+       ulong clock = gd->cpu_clk;
+       uint immr = get_immr(); /* Return full IMMR contents */
+       uint pvr = get_pvr();
+
+       puts("CPU:   ");
+
+       return check_CPU(clock, pvr, immr);
+}
+
 /* ------------------------------------------------------------------------- */
 
 void upmconfig(uint upm, uint *table, uint size)
index 48eb22362794fe7bf85c976d209e3b45f39dc2c5..423f1023ad1b2be3f50fe85a74bb81a9a67a66c0 100644 (file)
@@ -195,8 +195,6 @@ void        trap_init     (ulong);
 
 void s_init(void);
 
-int    checkicache   (void);
-int    checkdcache   (void);
 void   upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong  get_tbclk     (void);
 void   reset_misc    (void);