Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
[platform/kernel/u-boot.git] / board / esd / du440 / du440.c
index 111cce5..b168b24 100644 (file)
@@ -2,20 +2,7 @@
  * (C) Copyright 2008
  * Matthias Fuchs, esd gmbh, matthias.fuchs@esd-electronics.com
  *
- * 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>
@@ -24,7 +11,7 @@
 #include <asm/bitops.h>
 #include <command.h>
 #include <i2c.h>
-#include <ppc440.h>
+#include <asm/ppc440.h>
 #include "du440.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -265,8 +252,8 @@ int misc_init_r(void)
         * This fix will make the MAL burst disabling patch for the Linux
         * EMAC driver obsolete.
         */
-       reg = mfdcr(PLB4_ACR) & ~PLB4_ACR_WRP;
-       mtdcr(PLB4_ACR, reg);
+       reg = mfdcr(PLB4A0_ACR) & ~PLB4Ax_ACR_WRP_MASK;
+       mtdcr(PLB4A0_ACR, reg);
 
        /*
         * release IO-RST#
@@ -350,7 +337,7 @@ int checkboard(void)
 
        puts("Board: DU440");
 
-       if (getenv_r("serial#", serno, sizeof(serno)) > 0) {
+       if (getenv_f("serial#", serno, sizeof(serno)) > 0) {
                puts(", serial# ");
                puts(serno);
        }
@@ -385,7 +372,6 @@ int last_stage_init(void)
        return 0;
 }
 
-#if defined(CONFIG_I2C_MULTI_BUS)
 /*
  * read field strength from I2C ADC
  */
@@ -409,7 +395,7 @@ int dcf77_status(void)
        return mv;
 }
 
-int do_dcf77(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dcf77(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int mv;
        u32 pin, pinold;
@@ -490,7 +476,7 @@ int usbhub_init(void)
        return ret;
 }
 
-int do_hubinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_hubinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        usbhub_init();
        return 0;
@@ -500,7 +486,6 @@ U_BOOT_CMD(
        "Initialize USB hub",
        ""
 );
-#endif /* CONFIG_I2C_MULTI_BUS */
 
 #define CONFIG_SYS_BOOT_EEPROM_PAGE_WRITE_BITS 3
 int boot_eeprom_write (unsigned dev_addr,
@@ -573,7 +558,7 @@ int boot_eeprom_write (unsigned dev_addr,
        return rcode;
 }
 
-int do_setup_boot_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setup_boot_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong sdsdp[4];
 
@@ -673,7 +658,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
        return state;
 }
 
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int query = argc == 1;
        int state = 0;
@@ -727,7 +712,7 @@ static int pld_interrupt(u32 arg)
        return rc;
 }
 
-int do_waitpwrirq(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_waitpwrirq(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        got_pldirq = 0;
 
@@ -795,7 +780,7 @@ int dvi_init(void)
        return ret;
 }
 
-int do_dviinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dviinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        dvi_init();
        return 0;
@@ -810,7 +795,7 @@ U_BOOT_CMD(
  * TODO: 'time' command might be useful for others as well.
  *       Move to 'common' directory.
  */
-int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        unsigned long long start, end;
        char c, cmd[CONFIG_SYS_CBSIZE];
@@ -831,7 +816,7 @@ int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        *d = '\0';
 
        start = get_ticks();
-       ret = run_command (cmd, 0);
+       ret = run_command(cmd, 0);
        end = get_ticks();
 
        printf("ticks=%ld\n", (ulong)(end - start));
@@ -874,7 +859,7 @@ unsigned int prng(unsigned int max)
        return Y;
 }
 
-int do_gfxdemo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_gfxdemo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        unsigned int color;
        unsigned int x, y, dx, dy;