]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/powerpc/cpu/mpc86xx/cpu.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc86xx / cpu.c
index 9064e780374098c82a5ccb8841ce9ad133ed1253..30518544dd65827e723d054785b1edcc8a3c0017 100644 (file)
@@ -3,23 +3,7 @@
  * Jeff Brown
  * Srikanth Srinivasan (srikanth.srinivasan@freescale.com)
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -48,7 +32,6 @@ checkcpu(void)
 {
        sys_info_t sysinfo;
        uint pvr, svr;
-       uint ver;
        uint major, minor;
        char buf1[32], buf2[32];
        volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
@@ -57,7 +40,6 @@ checkcpu(void)
        uint msscr0 = mfspr(MSSCR0);
 
        svr = get_svr();
-       ver = SVR_SOC_VER(svr);
        major = SVR_MAJ(svr);
        minor = SVR_MIN(svr);
 
@@ -69,7 +51,7 @@ checkcpu(void)
        }
        puts("CPU:   ");
 
-       cpu = gd->cpu;
+       cpu = gd->arch.cpu;
 
        puts(cpu->name);
 
@@ -77,11 +59,10 @@ checkcpu(void)
        puts("Core:  ");
 
        pvr = get_pvr();
-       ver = PVR_E600_VER(pvr);
        major = PVR_E600_MAJ(pvr);
        minor = PVR_E600_MIN(pvr);
 
-       printf("E600 Core %d", (msscr0 & 0x20) ? 1 : 0 );
+       printf("e600 Core %d", (msscr0 & 0x20) ? 1 : 0);
        if (gur->pordevsr & MPC86xx_PORDEVSR_CORE1TE)
                puts("\n    Core1Translation Enabled");
        debug(" (MSSCR0=%x, PORDEVSR=%x)", msscr0, gur->pordevsr);
@@ -91,21 +72,21 @@ checkcpu(void)
        get_sys_info(&sysinfo);
 
        puts("Clock Configuration:\n");
-       printf("       CPU:%-4s MHz, ", strmhz(buf1, sysinfo.freqProcessor));
-       printf("MPX:%-4s MHz\n", strmhz(buf1, sysinfo.freqSystemBus));
+       printf("       CPU:%-4s MHz, ", strmhz(buf1, sysinfo.freq_processor));
+       printf("MPX:%-4s MHz\n", strmhz(buf1, sysinfo.freq_systembus));
        printf("       DDR:%-4s MHz (%s MT/s data rate), ",
-               strmhz(buf1, sysinfo.freqSystemBus / 2),
-               strmhz(buf2, sysinfo.freqSystemBus));
+               strmhz(buf1, sysinfo.freq_systembus / 2),
+               strmhz(buf2, sysinfo.freq_systembus));
 
-       if (sysinfo.freqLocalBus > LCRR_CLKDIV) {
-               printf("LBC:%-4s MHz\n", strmhz(buf1, sysinfo.freqLocalBus));
+       if (sysinfo.freq_localbus > LCRR_CLKDIV) {
+               printf("LBC:%-4s MHz\n", strmhz(buf1, sysinfo.freq_localbus));
        } else {
                printf("LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n",
-                      sysinfo.freqLocalBus);
+                      sysinfo.freq_localbus);
        }
 
-       puts("L1:    D-cache 32 KB enabled\n");
-       puts("       I-cache 32 KB enabled\n");
+       puts("L1:    D-cache 32 KiB enabled\n");
+       puts("       I-cache 32 KiB enabled\n");
 
        puts("L2:    ");
        if (get_l2cr() & 0x80000000) {
@@ -114,7 +95,7 @@ checkcpu(void)
 #elif defined(CONFIG_MPC8641)
                puts("512");
 #endif
-               puts(" KB enabled\n");
+               puts(" KiB enabled\n");
        } else {
                puts("Disabled\n");
        }
@@ -123,8 +104,7 @@ checkcpu(void)
 }
 
 
-void
-do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
        volatile ccsr_gur_t *gur = &immap->im_gur;
@@ -137,6 +117,8 @@ do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        while (1)
                ;
+
+       return 1;
 }
 
 
@@ -149,7 +131,7 @@ get_tbclk(void)
        sys_info_t sys_info;
 
        get_sys_info(&sys_info);
-       return (sys_info.freqSystemBus + 3L) / 4L;
+       return (sys_info.freq_systembus + 3L) / 4L;
 }
 
 
@@ -180,22 +162,9 @@ watchdog_reset(void)
  */
 void mpc86xx_reginfo(void)
 {
-       immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
-       ccsr_lbc_t *lbc = &immap->im_lbc;
-
        print_bats();
        print_laws();
-
-       printf ("Local Bus Controller Registers\n"
-               "\tBR0\t0x%08X\tOR0\t0x%08X \n", in_be32(&lbc->br0), in_be32(&lbc->or0));
-       printf("\tBR1\t0x%08X\tOR1\t0x%08X \n", in_be32(&lbc->br1), in_be32(&lbc->or1));
-       printf("\tBR2\t0x%08X\tOR2\t0x%08X \n", in_be32(&lbc->br2), in_be32(&lbc->or2));
-       printf("\tBR3\t0x%08X\tOR3\t0x%08X \n", in_be32(&lbc->br3), in_be32(&lbc->or3));
-       printf("\tBR4\t0x%08X\tOR4\t0x%08X \n", in_be32(&lbc->br4), in_be32(&lbc->or4));
-       printf("\tBR5\t0x%08X\tOR5\t0x%08X \n", in_be32(&lbc->br5), in_be32(&lbc->or5));
-       printf("\tBR6\t0x%08X\tOR6\t0x%08X \n", in_be32(&lbc->br6), in_be32(&lbc->or6));
-       printf("\tBR7\t0x%08X\tOR7\t0x%08X \n", in_be32(&lbc->br7), in_be32(&lbc->or7));
-
+       print_lbc_regs();
 }
 
 /*