Merge branch 'master' of git://git.denx.de/u-boot-i2c
[kernel/u-boot.git] / board / keymile / km_arm / km_arm.c
index 0c4dddc..481876b 100644 (file)
@@ -9,23 +9,7 @@
  * (C) Copyright 2010
  * Heiko Schocher, DENX Software Engineering, hs@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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -54,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define MASK_RBI_DEFECT_16     0x01
 
 /* Multi-Purpose Pins Functionality configuration */
-u32 kwmpp_config[] = {
+static const u32 kwmpp_config[] = {
        MPP0_NF_IO2,
        MPP1_NF_IO3,
        MPP2_NF_IO4,
@@ -63,7 +47,7 @@ u32 kwmpp_config[] = {
        MPP5_NF_IO7,
        MPP6_SYSRST_OUTn,
        MPP7_PEX_RST_OUTn,
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        MPP8_GPIO,              /* SDA */
        MPP9_GPIO,              /* SCL */
 #endif
@@ -160,7 +144,7 @@ int ethernet_present(void)
 }
 #endif
 
-int initialize_unit_leds(void)
+static int initialize_unit_leds(void)
 {
        /*
         * Init the unit LEDs per default they all are
@@ -181,7 +165,7 @@ int initialize_unit_leds(void)
 }
 
 #if defined(CONFIG_BOOTCOUNT_LIMIT)
-void set_bootcount_addr(void)
+static void set_bootcount_addr(void)
 {
        uchar buf[32];
        unsigned int bootcountaddr;
@@ -193,15 +177,6 @@ void set_bootcount_addr(void)
 
 int misc_init_r(void)
 {
-       char *str;
-       int mach_type;
-
-       str = getenv("mach_type");
-       if (str != NULL) {
-               mach_type = simple_strtoul(str, NULL, 10);
-               printf("Overwriting MACH_TYPE with %d!!!\n", mach_type);
-               gd->bd->bi_arch_number = mach_type;
-       }
 #if defined(CONFIG_KM_MGCOGE3UN)
        char *wait_for_ne;
        wait_for_ne = getenv("waitforne");
@@ -243,7 +218,7 @@ int misc_init_r(void)
 
 int board_early_init_f(void)
 {
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        u32 tmp;
 
        /* set the 2 bitbang i2c pins as output gpios */
@@ -258,11 +233,6 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       /*
-        * arch number of board
-        */
-       gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD;
-
        /* address of boot parameters */
        gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
 
@@ -274,7 +244,7 @@ int board_init(void)
        kw_gpio_set_valid(KM_FLASH_GPIO_PIN, 1);
        kw_gpio_direction_output(KM_FLASH_GPIO_PIN, 1);
 
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
        /*
         * Reinit the GPIO for I2C Bitbang driver so that the now
         * available gpio framework is consistent. The calls to
@@ -454,7 +424,7 @@ int hush_init_var(void)
 }
 #endif
 
-#if defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_SYS_I2C_SOFT)
 void set_sda(int state)
 {
        I2C_ACTIVE;