imx: ventana: remove setup of I2C3 from SPL
[pandora-u-boot.git] / board / gateworks / gw_ventana / gw_ventana.c
index 61298ab..c0b0cc9 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2013 Gateworks Corporation
  *
  * Author: Tim Harvey <tharvey@gateworks.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
  */
 
 #include <common.h>
@@ -22,6 +21,7 @@
 #include <asm/setup.h>
 #include <dm.h>
 #include <dm/platform_data/serial_mxc.h>
+#include <environment.h>
 #include <hwconfig.h>
 #include <i2c.h>
 #include <fdt_support.h>
@@ -267,11 +267,11 @@ int mv88e61xx_hw_reset(struct phy_device *phydev)
        phydev->speed = SPEED_1000;
        phydev->duplex = DUPLEX_FULL;
 
-       /* LED configuration: 7:4-green (8=Activity)  3:0 amber (9=10Link) */
-       bus->write(bus, 0x10, 0, 0x16, 0x8089);
-       bus->write(bus, 0x11, 0, 0x16, 0x8089);
-       bus->write(bus, 0x12, 0, 0x16, 0x8089);
-       bus->write(bus, 0x13, 0, 0x16, 0x8089);
+       /* LED configuration: 7:4-green (8=Activity)  3:0 amber (8=Link) */
+       bus->write(bus, 0x10, 0, 0x16, 0x8088);
+       bus->write(bus, 0x11, 0, 0x16, 0x8088);
+       bus->write(bus, 0x12, 0, 0x16, 0x8088);
+       bus->write(bus, 0x13, 0, 0x16, 0x8088);
 
        return 0;
 }
@@ -298,11 +298,11 @@ int board_eth_init(bd_t *bis)
 #endif
 
        /* default to the first detected enet dev */
-       if (!getenv("ethprime")) {
+       if (!env_get("ethprime")) {
                struct eth_device *dev = eth_get_dev_by_index(0);
                if (dev) {
                        env_set("ethprime", dev->name);
-                       printf("set ethprime to %s\n", getenv("ethprime"));
+                       printf("set ethprime to %s\n", env_get("ethprime"));
                }
        }
 
@@ -579,7 +579,7 @@ void board_pci_fixup_dev(struct pci_controller *hose, pci_dev_t dev,
  */
 void get_board_serial(struct tag_serialnr *serialnr)
 {
-       char *serial = getenv("serial#");
+       char *serial = env_get("serial#");
 
        if (serial) {
                serialnr->high = 0;
@@ -631,7 +631,9 @@ int board_init(void)
 #ifdef CONFIG_MXC_SPI
        setup_spi();
 #endif
-       setup_ventana_i2c();
+       setup_ventana_i2c(0);
+       setup_ventana_i2c(1);
+       setup_ventana_i2c(2);
 
 #ifdef CONFIG_SATA
        setup_sata();
@@ -658,7 +660,7 @@ int checkboard(void)
        int quiet; /* Quiet or minimal output mode */
 
        quiet = 0;
-       p = getenv("quiet");
+       p = env_get("quiet");
        if (p)
                quiet = simple_strtol(p, NULL, 10);
        else
@@ -746,7 +748,7 @@ int misc_init_r(void)
                for (i = 0; i < (sizeof(str)-1) && info->model[i]; i++)
                        str[i] = tolower(info->model[i]);
                env_set("model", str);
-               if (!getenv("fdt_file")) {
+               if (!env_get("fdt_file")) {
                        sprintf(fdt, "%s-%s.dtb", cputype, str);
                        env_set("fdt_file", fdt);
                }
@@ -770,11 +772,11 @@ int misc_init_r(void)
 
                /* initialize env from EEPROM */
                if (test_bit(EECONFIG_ETH0, info->config) &&
-                   !getenv("ethaddr")) {
+                   !env_get("ethaddr")) {
                        eth_env_set_enetaddr("ethaddr", info->mac0);
                }
                if (test_bit(EECONFIG_ETH1, info->config) &&
-                   !getenv("eth1addr")) {
+                   !env_get("eth1addr")) {
                        eth_env_set_enetaddr("eth1addr", info->mac1);
                }
 
@@ -788,7 +790,7 @@ int misc_init_r(void)
        }
 
        /* Set a non-initialized hwconfig based on board configuration */
-       if (!strcmp(getenv("hwconfig"), "_UNKNOWN_")) {
+       if (!strcmp(env_get("hwconfig"), "_UNKNOWN_")) {
                buf[0] = 0;
                if (gpio_cfg[board_type].rs232_en)
                        strcat(buf, "rs232;");
@@ -1035,7 +1037,7 @@ int fdt_fixup_sky2(void *blob, int np, struct pci_dev *dev)
        int j;
 
        sprintf(mac, "eth1addr");
-       tmp = getenv(mac);
+       tmp = env_get(mac);
        if (tmp) {
                for (j = 0; j < 6; j++) {
                        mac_addr[j] = tmp ?
@@ -1114,12 +1116,12 @@ int ft_board_setup(void *blob, bd_t *bd)
 {
        struct ventana_board_info *info = &ventana_info;
        struct ventana_eeprom_config *cfg;
-       struct node_info nodes[] = {
+       static const struct node_info nodes[] = {
                { "sst,w25q256",          MTD_DEV_TYPE_NOR, },  /* SPI flash */
                { "fsl,imx6q-gpmi-nand",  MTD_DEV_TYPE_NAND, }, /* NAND flash */
        };
-       const char *model = getenv("model");
-       const char *display = getenv("display");
+       const char *model = env_get("model");
+       const char *display = env_get("display");
        int i;
        char rev = 0;
 
@@ -1131,7 +1133,7 @@ int ft_board_setup(void *blob, bd_t *bd)
                }
        }
 
-       if (getenv("fdt_noauto")) {
+       if (env_get("fdt_noauto")) {
                puts("   Skiping ft_board_setup (fdt_noauto defined)\n");
                return 0;
        }
@@ -1152,15 +1154,15 @@ int ft_board_setup(void *blob, bd_t *bd)
        printf("   Adjusting FDT per EEPROM for %s...\n", model);
 
        /* board serial number */
-       fdt_setprop(blob, 0, "system-serial", getenv("serial#"),
-                   strlen(getenv("serial#")) + 1);
+       fdt_setprop(blob, 0, "system-serial", env_get("serial#"),
+                   strlen(env_get("serial#")) + 1);
 
        /* board (model contains model from device-tree) */
        fdt_setprop(blob, 0, "board", info->model,
                    strlen((const char *)info->model) + 1);
 
        /* set desired digital video capture format */
-       ft_sethdmiinfmt(blob, getenv("hdmiinfmt"));
+       ft_sethdmiinfmt(blob, env_get("hdmiinfmt"));
 
        /*
         * Board model specific fixups
@@ -1315,7 +1317,7 @@ int ft_board_setup(void *blob, bd_t *bd)
        }
 
 #if defined(CONFIG_CMD_PCI)
-       if (!getenv("nopcifixup"))
+       if (!env_get("nopcifixup"))
                ft_board_pci_fixup(blob, bd);
 #endif
 
@@ -1324,7 +1326,7 @@ int ft_board_setup(void *blob, bd_t *bd)
         *  remove nodes by alias path if EEPROM config tells us the
         *  peripheral is not loaded on the board.
         */
-       if (getenv("fdt_noconfig")) {
+       if (env_get("fdt_noconfig")) {
                puts("   Skiping periperhal config (fdt_noconfig defined)\n");
                return 0;
        }