Merge branch 'master' of git://git.denx.de/u-boot-arm
[platform/kernel/u-boot.git] / board / keymile / km_arm / km_arm.c
index eda9199..35402c8 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>
@@ -62,8 +46,12 @@ static const u32 kwmpp_config[] = {
        MPP4_NF_IO6,
        MPP5_NF_IO7,
        MPP6_SYSRST_OUTn,
+#if defined(KM_PCIE_RESET_MPP7)
+       MPP7_GPO,
+#else
        MPP7_PEX_RST_OUTn,
-#if defined(CONFIG_SOFT_I2C)
+#endif
+#if defined(CONFIG_SYS_I2C_SOFT)
        MPP8_GPIO,              /* SDA */
        MPP9_GPIO,              /* SCL */
 #endif
@@ -118,7 +106,7 @@ static const u32 kwmpp_config[] = {
 /*
  * Wait for startup OK from mgcoge3ne
  */
-int startup_allowed(void)
+static int startup_allowed(void)
 {
        unsigned char buf;
 
@@ -160,7 +148,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
@@ -180,8 +168,7 @@ int initialize_unit_leds(void)
        return 0;
 }
 
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
-void set_bootcount_addr(void)
+static void set_bootcount_addr(void)
 {
        uchar buf[32];
        unsigned int bootcountaddr;
@@ -189,7 +176,6 @@ void set_bootcount_addr(void)
        sprintf((char *)buf, "0x%x", bootcountaddr);
        setenv("bootcountaddr", (char *)buf);
 }
-#endif
 
 int misc_init_r(void)
 {
@@ -226,15 +212,13 @@ int misc_init_r(void)
 
        initialize_unit_leds();
        set_km_env();
-#if defined(CONFIG_BOOTCOUNT_LIMIT)
        set_bootcount_addr();
-#endif
        return 0;
 }
 
 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 */
@@ -260,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
@@ -338,15 +322,15 @@ void reset_phy(void)
                return;
 
        /* RGMII clk transition on data stable */
-       if (!miiphy_read(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG, &reg))
+       if (miiphy_read(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG, &reg))
                printf("Error reading PHY spec ctrl reg\n");
-       if (!miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG,
-               reg | PHY_RGMII_CLK_STABLE | PHY_CLSA))
+       if (miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_SPEC_CTRL_REG,
+                        reg | PHY_RGMII_CLK_STABLE | PHY_CLSA))
                printf("Error writing PHY spec ctrl reg\n");
 
        /* leds setup */
-       if (!miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_LED_SEL_REG,
-               PHY_LED0_LINK | PHY_LED1_ACT | PHY_LED2_INT))
+       if (miiphy_write(name, CONFIG_PHY_BASE_ADR, PHY_LED_SEL_REG,
+                        PHY_LED0_LINK | PHY_LED1_ACT | PHY_LED2_INT))
                printf("Error writing PHY LED reg\n");
 
        /* reset the phy */
@@ -359,7 +343,7 @@ void reset_phy(void)
 #if defined(CONFIG_KM_NUSA)
 struct mv88e_sw_reg extsw_conf[] = {
        /*
-        * port 0, PIGGY4, autoneg 
+        * port 0, PIGGY4, autoneg
         * first the fix for the 1000Mbits Autoneg, this is from
         * a Marvell errata, the regs are undocumented
         */
@@ -440,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;