imx: ventana: add support for GW5905
[platform/kernel/u-boot.git] / board / gateworks / gw_ventana / eeprom.c
index 2c07a84..13ccf2b 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2014 Gateworks Corporation
  * Author: Tim Harvey <tharvey@gateworks.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
  */
 
 #include <common.h>
@@ -100,8 +99,10 @@ read_eeprom(int bus, struct ventana_board_info *info)
        case '9':
                if (info->model[4] == '0' && info->model[5] == '3')
                        type = GW5903;
-               if (info->model[4] == '0' && info->model[5] == '4')
+               else if (info->model[4] == '0' && info->model[5] == '4')
                        type = GW5904;
+               else if (info->model[4] == '0' && info->model[5] == '5')
+                       type = GW5905;
                break;
        }
        return type;
@@ -119,7 +120,7 @@ struct ventana_eeprom_config econfig[] = {
        { /* Sentinel */ }
 };
 
-#ifdef CONFIG_CMD_EECONFIG
+#if defined(CONFIG_CMD_EECONFIG) && !defined(CONFIG_SPL_BUILD)
 static struct ventana_eeprom_config *get_config(const char *name)
 {
        struct ventana_eeprom_config *cfg = econfig;
@@ -135,7 +136,7 @@ static struct ventana_eeprom_config *get_config(const char *name)
 static u8 econfig_bytes[sizeof(ventana_info.config)];
 static int econfig_init = -1;
 
-int do_econfig(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_econfig(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        struct ventana_eeprom_config *cfg;
        struct ventana_board_info *info = &ventana_info;