]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/powerpc/cpu/mpc8xx/cpu.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc8xx / cpu.c
index 2eb848bd0ef23f59902235f3d1993d4059a35b5c..1550045e6c79d3fcd1f1d77e52fa1b344eba8611 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000-2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * 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 <commproc.h>
 #include <netdev.h>
 #include <asm/cache.h>
+#include <linux/compiler.h>
+#include <asm/io.h>
 
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
-#include <libfdt_env.h>
 #include <fdt_support.h>
 #endif
 
@@ -77,7 +62,8 @@ static int check_CPU (long clock, uint pvr, uint immr)
        if ((pvr >> 16) != 0x0050)
                return -1;
 
-       k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
+       k = (immr << 16) |
+               immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)];
        m = 0;
        suf = "";
 
@@ -185,7 +171,7 @@ static int check_CPU (long clock, uint pvr, uint immr)
        uint k, m;
        char buf[32];
        char pre = 'X';
-       char *mid = "xx";
+       __maybe_unused char *mid = "xx";
        char *suf;
 
        /* the highest 16 bits should be 0x0050 for a 8xx */
@@ -193,7 +179,8 @@ static int check_CPU (long clock, uint pvr, uint immr)
        if ((pvr >> 16) != 0x0050)
                return -1;
 
-       k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
+       k = (immr << 16) |
+               immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)];
        m = 0;
 
        switch (k) {
@@ -252,7 +239,8 @@ static int check_CPU (long clock, uint pvr, uint immr)
        if ((pvr >> 16) != 0x0050)
                return -1;
 
-       k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
+       k = (immr << 16) |
+               in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
        m = 0;
 
        switch (k) {
@@ -311,7 +299,8 @@ static int check_CPU (long clock, uint pvr, uint immr)
        if ((pvr >> 16) != 0x0050)
                return -1;
 
-       k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
+       k = (immr << 16) |
+               immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)];
        m = 0;
 
        switch (k) {
@@ -478,7 +467,7 @@ void upmconfig (uint upm, uint * table, uint size)
 
 #ifndef CONFIG_LWMON
 
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong msr, addr;
 
@@ -521,7 +510,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  * and thus too short to reset the external hardware. So we  use  the
  * watchdog to reset the board.
  */
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        /* prevent triggering the watchdog */
        disable_interrupts ();