summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubuntu16 <acarrizosa>2020-11-26 09:27:20 +0100
committerubuntu16 <acarrizosa>2020-11-26 09:27:20 +0100
commit088e82c3a83d8e277fbd5d236fdb07f94e0c25fb (patch)
tree83f0488dfd6478190c34a7b74c803b6a2396f7b9
parent4a829111722e5d5e435fcbedb85b33f19cf083cc (diff)
downloadu-boot-imx-088e82c3a83d8e277fbd5d236fdb07f94e0c25fb.zip
u-boot-imx-088e82c3a83d8e277fbd5d236fdb07f94e0c25fb.tar.gz
u-boot-imx-088e82c3a83d8e277fbd5d236fdb07f94e0c25fb.tar.bz2
IGEP0146: Add led and HWtest support
-rw-r--r--board/isee/common/igep0146_led.c67
-rw-r--r--board/isee/common/igep0146_led.h16
-rw-r--r--board/isee/common/led.c45
-rw-r--r--board/isee/igep0146/Kconfig4
-rw-r--r--board/isee/igep0146/Makefile11
-rw-r--r--board/isee/igep0146/igep0146.c99
-rw-r--r--configs/igep0146_imx6ul_512M_defconfig13
-rw-r--r--configs/igep0146_imx6ul_512M_test_defconfig68
-rw-r--r--include/configs/igep0146.h224
9 files changed, 417 insertions, 130 deletions
diff --git a/board/isee/common/igep0146_led.c b/board/isee/common/igep0146_led.c
new file mode 100644
index 0000000..46d7dec
--- /dev/null
+++ b/board/isee/common/igep0146_led.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2019 ISEE 2007 SL
+ * Hector Fernandez <hector@iatec.biz>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+*/
+#include <common.h>
+#include <status_led.h>
+#include <tca642x.h>
+#include "igep0146_led.h"
+
+
+
+#ifdef CONFIG_LED_STATUS_GREEN
+void green_led_off(void)
+{
+ __led_set(IGEP0146_LED_GREEN, 0);
+}
+
+void green_led_on(void)
+{
+ __led_set(IGEP0146_LED_GREEN, 1);
+}
+#endif
+
+#ifdef CONFIG_LED_STATUS_RED
+void red_led_off(void)
+{
+ __led_set(IGEP0146_LED_RED, 0);
+}
+
+void red_led_on(void)
+{
+ __led_set(IGEP0146_LED_RED, 1);
+}
+#endif
+
+void __led_init (led_id_t mask, int state)
+{
+ /* NOTHING */
+}
+
+void __led_toggle (led_id_t mask)
+{
+ /* NOTHING */
+}
+
+void __led_set (led_id_t mask, int state)
+{
+ uint8_t reg_bit;
+
+ switch (mask)
+ {
+ case IGEP0146_LED_RED:
+ reg_bit = 1 << IGEP0146_LED_RED;
+ break;
+
+ case IGEP0146_LED_GREEN:
+ reg_bit = 1 << IGEP0146_LED_GREEN;
+ break;
+
+ default:
+ return;
+ }
+
+ tca642x_set_val(CONFIG_SYS_I2C_TCA642X_ADDR, 0, reg_bit, (state ? reg_bit: 0));
+} \ No newline at end of file
diff --git a/board/isee/common/igep0146_led.h b/board/isee/common/igep0146_led.h
new file mode 100644
index 0000000..fa0ee8a
--- /dev/null
+++ b/board/isee/common/igep0146_led.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2018 ISEE 2007 SL
+ * Aitor Carrizosa <acarrizosa@iatec.biz>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_IGEP0146_LED_H
+#define __CONFIG_IGEP0146_LED_H
+
+/* GPIO Leds */
+#define IGEP0146_LED_RED 7
+#define IGEP0146_LED_GREEN 6
+
+
+#endif \ No newline at end of file
diff --git a/board/isee/common/led.c b/board/isee/common/led.c
index fdc5f7c..97e57ff 100644
--- a/board/isee/common/led.c
+++ b/board/isee/common/led.c
@@ -24,72 +24,31 @@ int gpio_name_to_num(char* name)
return 0;
}
-/* GPIO pins for the LEDs */
-/* GPIO Leds */
-#define IGEP0146_LED_RED_USER0 8
-#define IGEP0146_LED_GREEN_USER1 9
-
#ifdef CONFIG_LED_STATUS_GREEN
void green_led_off(void)
{
-#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0146)
- __led_set(IGEP0146_LED_GREEN_USER1, CONFIG_LED_STATUS_OFF);
- #elif (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0046)
__led_set(gpio_name_to_num("green"), CONFIG_LED_STATUS_OFF);
-#endif
}
void green_led_on(void)
{
-#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0146)
- __led_set(IGEP0146_LED_GREEN_USER1, CONFIG_LED_STATUS_ON);
-#elif (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0046)
__led_set(gpio_name_to_num("green"), CONFIG_LED_STATUS_ON);
-#endif
}
#endif
#ifdef CONFIG_LED_STATUS_RED
void red_led_off(void)
{
-#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0146)
- __led_set(IGEP0146_LED_RED_USER0, CONFIG_LED_STATUS_OFF);
-#elif (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0046)
__led_set(gpio_name_to_num("red"), CONFIG_LED_STATUS_OFF);
-#endif
}
void red_led_on(void)
{
-#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0146)
- __led_set(IGEP0146_LED_RED_USER0, CONFIG_LED_STATUS_ON);
-#elif (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0046)
__led_set(gpio_name_to_num("red"), CONFIG_LED_STATUS_ON);
-#endif
-
}
#endif
-#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0146)
-
-static int get_led_gpio(led_id_t mask)
-{
-#ifdef CONFIG_LED_STATUS0
- if (CONFIG_LED_STATUS_BIT == mask)
- {
- return IGEP0146_LED_RED_USER0;
- }
-#endif
-#ifdef CONFIG_LED_STATUS1
- if (CONFIG_LED_STATUS_BIT1 == mask)
- {
- return IGEP0146_LED_GREEN_USER1;
- }
-#endif
- return 0;
-}
-
-#elif (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0046)
+#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0046)
/* Convert Status from gpio mask */
static int get_led_gpio(led_id_t mask)
{
@@ -139,4 +98,4 @@ void __led_set (led_id_t mask, int state)
{
gpio_direction_output(toggle_gpio, state);
}
-}
+} \ No newline at end of file
diff --git a/board/isee/igep0146/Kconfig b/board/isee/igep0146/Kconfig
index 661f355..e7bf177 100644
--- a/board/isee/igep0146/Kconfig
+++ b/board/isee/igep0146/Kconfig
@@ -11,4 +11,8 @@ config SYS_CONFIG_NAME
config BASE0040
bool "base0040"
+
+config HWTEST
+ bool "ENABLE HWTEST"
+ default false
endif
diff --git a/board/isee/igep0146/Makefile b/board/isee/igep0146/Makefile
index ec7df1c..d33ddc3 100644
--- a/board/isee/igep0146/Makefile
+++ b/board/isee/igep0146/Makefile
@@ -1,11 +1,12 @@
+
+# Copyright (C) IATEC - http://www.iatec.biz
#
-# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
+# Aitor Carrizosa <acarrizosa@iatec.biz>
#
-# (C) Copyright 2011 Freescale Semiconductor, Inc.
+# Source file for IGEP0146 board
#
# SPDX-License-Identifier: GPL-2.0+
-#
-
+
obj-y += igep0146.o
obj-y += ../common/eeprom.o
-obj-$(CONFIG_LED_STATUS) += ../common/led.o \ No newline at end of file
+obj-$(CONFIG_LED_STATUS) += ../common/igep0146_led.o \ No newline at end of file
diff --git a/board/isee/igep0146/igep0146.c b/board/isee/igep0146/igep0146.c
index 936f5a6..445b248 100644
--- a/board/isee/igep0146/igep0146.c
+++ b/board/isee/igep0146/igep0146.c
@@ -1,10 +1,8 @@
/*
- * Copyright (C) 2016 ISEE 2007 SL - http://www.isee.biz
+ * Copyright (C) IATEC - http://www.iatec.biz
*
* Source file for IGEP0146 board
*
- * Author: Jose Miguel Sanchez Sanabria <jsanabria@iseebcn.com>
- *
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -42,19 +40,20 @@
#include "../common/eeprom.h"
#include "../common/igep_common.h"
+#include <tca642x.h>
DECLARE_GLOBAL_DATA_PTR;
-/* MACRO MUX defines */
+/* MUX defines */
+
+#define WEAK_PULLUP (PAD_CTL_PUS_100K_UP | \
+ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \
+ PAD_CTL_SRE_SLOW)
#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
-#define GPIO_LED_PAD_CTRL (PAD_CTL_PUS_22K_UP | \
- PAD_CTL_SPEED_LOW | PAD_CTL_DSE_40ohm | \
- PAD_CTL_SRE_FAST )
-
#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \
PAD_CTL_SPEED_HIGH | \
PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
@@ -85,18 +84,19 @@ DECLARE_GLOBAL_DATA_PTR;
#define I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL)
#endif
+#ifdef CONFIG_BASE0040
/* Audio reset */
#define AUDIO_RESET IMX_GPIO_NR(4, 17)
+#endif
/* Ethernet Phy 1 reset */
#define ETH_PHY_RESET IMX_GPIO_NR(1, 10)
/* eMMC reset */
#define USDHC2_PWR_GPIO IMX_GPIO_NR(4, 10)
-
/* GPIO Leds */
#define IGEP0146_LED_RED IMX_GPIO_NR(1,8)
#define IGEP0146_LED_GREEN IMX_GPIO_NR(1,9)
-
-
+/* Gpio Expander reset */
+#define GPIO_NRST_GPIO IMX_GPIO_NR(1, 1)
/*
There are 4 ranges of Locally Administered Address Ranges that can be used on a local network:
@@ -119,6 +119,24 @@ static struct igep_mf_setup igep0146_eeprom_config = {
.bmac1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
};
+/**
+ * @brief tca642x_init - uEVM default values for the GPIO expander
+ * input reg, output reg, polarity reg, configuration reg
+ */
+struct tca642x_bank_info tca642x_init[] = {
+ { .input_reg = 0x00,
+ .output_reg = 0x00,
+ .polarity_reg = 0x00,
+ .configuration_reg = 0x1f },
+ { .input_reg = 0x00,
+ .output_reg = 0x66,
+ .polarity_reg = 0x00,
+ .configuration_reg = 0x01 },
+ { .input_reg = 0x00,
+ .output_reg = 0x80,
+ .polarity_reg = 0x00,
+ .configuration_reg = 0x0e },
+};
int dram_init(void)
{
@@ -139,13 +157,6 @@ static iomux_v3_cfg_t const uart3_pads[] =
MX6_PAD_UART3_RX_DATA__UART3_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
};
-static iomux_v3_cfg_t const led_pads[] = {
- MX6_PAD_GPIO1_IO08__GPIO1_IO08 | MUX_PAD_CTRL(GPIO_LED_PAD_CTRL),
- /* Warning This GPIO actually controls if we select SD or WiFi through a MUX */
- MX6_PAD_GPIO1_IO09__GPIO1_IO09 | MUX_PAD_CTRL(GPIO_LED_PAD_CTRL),
-
-};
-
#ifdef CONFIG_FEC_MXC
/* ethernet */
static iomux_v3_cfg_t const enet1_pads[] = {
@@ -204,15 +215,12 @@ static iomux_v3_cfg_t const usdhc2_pads[] = {
static iomux_v3_cfg_t const init_pads[] =
{
/* TLV320AIC3106 Audio codec Reset*/
- MX6_PAD_CSI_MCLK__GPIO4_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),
+ /*MX6_PAD_CSI_MCLK__GPIO4_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL), */
+ MX6_PAD_CSI_MCLK__GPIO4_IO17 | MUX_PAD_CTRL(WEAK_PULLUP),
+ /* TCA6424 Gpio Expander Reset */
+ MX6_PAD_GPIO1_IO01__GPIO1_IO01 | MUX_PAD_CTRL(WEAK_PULLUP),
};
-// const uchar igep_mac0 [6] = { 0x02, 0x00, 0x00, 0x00, 0x00, 0xff };
-//const uchar igep_mac0 [6] = { 0xb0, 0xd5, 0xcc, 0xb2, 0xa5, 0xb9 };
-
-// static int igep_eeprom_valid = 0;
-// static struct igep_mf_setup igep0046_eeprom_config;
-
/* i2c */
#ifdef CONFIG_SYS_I2C_MXC
static struct i2c_pads_info i2c_pad_info1 =
@@ -254,19 +262,11 @@ static void setup_iomux_uart(void)
imx_iomux_v3_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads));
}
-static void setup_iomux_leds(void)
-{
- imx_iomux_v3_setup_multiple_pads(led_pads, ARRAY_SIZE(led_pads));
-}
-
-/*
-static void setup_iomux_usdhc(void)
+/*static void setup_iomux_usdhc(void)
{
imx_iomux_v3_setup_multiple_pads(usdhc1_pads, ARRAY_SIZE(usdhc1_pads));
imx_iomux_v3_setup_multiple_pads(usdhc2_pads, ARRAY_SIZE(usdhc2_pads));
-
-}
-*/
+}*/
static void setup_iomux_enet(void)
{
@@ -296,7 +296,7 @@ static int get_mac_address (void)
}
if (!is_valid_ethaddr(enetaddr)){
- printf("MAC Address: Error or not set\n");
+ printf("MAC Address: Error\n");
return -1;
}
@@ -359,7 +359,6 @@ int board_eth_init(bd_t *bis)
ret = fecmxc_initialize_multi(bis, 0, CONFIG_FEC_MXC_PHYADDR, IMX_FEC_BASE);
if (ret)
printf("FEC%d MXC: %s:failed\n", 0, __func__);
-
return 0;
}
@@ -391,9 +390,7 @@ int board_mmc_getcd(struct mmc *mmc)
ret = 1;
break;
}
-
return ret;
-
}
int board_mmc_init(bd_t *bis)
@@ -440,7 +437,6 @@ int checkboard(void)
int board_early_init_f(void)
{
setup_iomux_uart();
- setup_iomux_leds();
setup_iomux_misc();
return 0;
}
@@ -484,6 +480,17 @@ static int load_eeprom (void)
return result;
}
+void reset_gpio_expander(void)
+{
+ /* reset gpio expander */
+ gpio_direction_output(GPIO_NRST_GPIO, 1);
+ mdelay(1);
+ gpio_set_value(GPIO_NRST_GPIO, 0);
+ mdelay(1);
+ gpio_set_value(GPIO_NRST_GPIO, 1);
+ mdelay(2);
+}
+
int board_init(void)
{
@@ -494,20 +501,22 @@ int board_init(void)
reset_audio();
#endif
+ reset_gpio_expander();
+
#ifdef CONFIG_SYS_I2C_MXC
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
- mdelay(1);
+ mdelay(2);
#endif
+ tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
+
+ status_led_set(1, 1);
+
load_eeprom();
set_boardserial();
-#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
- status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
-#endif
-
#ifdef CONFIG_FEC_MXC
setup_phy();
#endif
diff --git a/configs/igep0146_imx6ul_512M_defconfig b/configs/igep0146_imx6ul_512M_defconfig
index 9782a6d..b661377 100644
--- a/configs/igep0146_imx6ul_512M_defconfig
+++ b/configs/igep0146_imx6ul_512M_defconfig
@@ -24,14 +24,15 @@ CONFIG_CMD_MEMTEST=y
# CONFIG_CMD_FLASH is not set
CONFIG_LOCALVERSION=""
+#
# LED Support
#
CONFIG_LED=y
-CONFIG_CMD_LED=y
+CONFIG_CMD_LED=n
# CONFIG_LED_GPIO is not set
CONFIG_LED_STATUS=y
CONFIG_LED_STATUS_OFF=0
-CONFIG_LED_STATUS_BLINKING=1
+# CONFIG_LED_STATUS_BLINKING=1
CONFIG_LED_STATUS_ON=1
# CONFIG_LED_STATUS_GPIO is not set
CONFIG_LED_STATUS_BOARD_SPECIFIC=y
@@ -40,13 +41,13 @@ CONFIG_LED_STATUS_BOARD_SPECIFIC=y
# LEDs parameters
#
CONFIG_LED_STATUS0=y
-CONFIG_LED_STATUS_BIT=8
+CONFIG_LED_STATUS_BIT=7
CONFIG_LED_STATUS_STATE=1
-CONFIG_LED_STATUS_FREQ=500
+CONFIG_LED_STATUS_FREQ=1
CONFIG_LED_STATUS1=y
-CONFIG_LED_STATUS_BIT1=9
+CONFIG_LED_STATUS_BIT1=6
CONFIG_LED_STATUS_STATE1=0
-CONFIG_LED_STATUS_FREQ1=500
+CONFIG_LED_STATUS_FREQ1=1
CONFIG_LED_STATUS2=n
CONFIG_LED_STATUS_BIT2=400
CONFIG_LED_STATUS_STATE2=0
diff --git a/configs/igep0146_imx6ul_512M_test_defconfig b/configs/igep0146_imx6ul_512M_test_defconfig
new file mode 100644
index 0000000..97e79e8
--- /dev/null
+++ b/configs/igep0146_imx6ul_512M_test_defconfig
@@ -0,0 +1,68 @@
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/isee/igep0146/mx6ul_igep0146_1x512.cfg,MX6UL"
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_MX6UL=y
+CONFIG_TARGET_IGEP0146=y
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_OF_LIBFDT=y
+CONFIG_DM=y
+CONFIG_DM_THERMAL=y
+CONFIG_DISPLAY_BOARDINFO=y
+CONFIG_DEFAULT_FDT_FILE="imx6ul-igep-base0040rd102.dtb"
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_MEMTEST=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_LOCALVERSION="
+CONFIG_HWTEST=y
+#
+# LED Support
+#
+CONFIG_LED=y
+CONFIG_CMD_LED=n
+# CONFIG_LED_GPIO is not set
+CONFIG_LED_STATUS=y
+CONFIG_LED_STATUS_OFF=0
+# CONFIG_LED_STATUS_BLINKING=1
+CONFIG_LED_STATUS_ON=1
+# CONFIG_LED_STATUS_GPIO is not set
+CONFIG_LED_STATUS_BOARD_SPECIFIC=y
+
+#
+# LEDs parameters
+#
+CONFIG_LED_STATUS0=y
+CONFIG_LED_STATUS_BIT=7
+CONFIG_LED_STATUS_STATE=1
+CONFIG_LED_STATUS_FREQ=1
+CONFIG_LED_STATUS1=y
+CONFIG_LED_STATUS_BIT1=6
+CONFIG_LED_STATUS_STATE1=0
+CONFIG_LED_STATUS_FREQ1=1
+CONFIG_LED_STATUS2=n
+CONFIG_LED_STATUS_BIT2=400
+CONFIG_LED_STATUS_STATE2=0
+CONFIG_LED_STATUS_FREQ2=500
+CONFIG_LED_STATUS3=n
+CONFIG_LED_STATUS_BIT3=401
+CONFIG_LED_STATUS_STATE3=0
+CONFIG_LED_STATUS_FREQ3=500
+# CONFIG_LED_STATUS4 is not set
+# CONFIG_LED_STATUS5 is not set
+# CONFIG_LED_STATUS_BOOT_ENABLE is not set
+# CONFIG_LED_STATUS_YELLOW_ENABLE is not set
+# CONFIG_LED_STATUS_RED_ENABLE is not set
+CONFIG_LED_STATUS_GREEN_ENABLE=y
+CONFIG_LED_STATUS_GREEN=0
+CONFIG_LED_STATUS_BLUE_ENABLE=y
+CONFIG_LED_STATUS_BLUE=0
+CONFIG_LED_STATUS_CMD=y \ No newline at end of file
diff --git a/include/configs/igep0146.h b/include/configs/igep0146.h
index d814cb0..a0eb754 100644
--- a/include/configs/igep0146.h
+++ b/include/configs/igep0146.h
@@ -1,9 +1,8 @@
/*
- * Copyright (C) 2016 ISEE 2007 SL - http://www.isee.biz
+ * Copyright (C) 2020 IATEC - http://www.iatec.biz
*
- * Header file for IGEP0046 board
+ * Header file for IGEP0146 board
*
- * Author: Jose Miguel Sanchez Sanabria <jsanabria@iseebcn.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -47,6 +46,12 @@
/* GPIO */
#define CONFIG_MXC_GPIO
+/* GPIO Expander */
+#define CONFIG_TCA642X
+#define CONFIG_CMD_TCA642X
+#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 1
+#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22
+
/* UART Configs */
#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE UART3_BASE
@@ -78,7 +83,7 @@
/* Miscellaneous configurable options */
-/*#define CONFIG_AUTOBOOT_KEYED*/
+#define CONFIG_AUTOBOOT_KEYED
#define CONFIG_AUTOBOOT_PROMPT "Press ESC to abort autoboot in %d seconds\n"
#define CONFIG_AUTOBOOT_STOP_STR "\x1b"
#define CONFIG_SYS_LONGHELP
@@ -87,6 +92,10 @@
#define CONFIG_CMDLINE_EDITING
#define CONFIG_STACKSIZE (128 * 1024)
+/* Mach type */
+#define MACH_TYPE_IGEP0146 4521 /* Until the next sync */
+#define CONFIG_MACH_TYPE MACH_TYPE_IGEP0146
+
/* I2C Configs */
#define CONFIG_CMD_I2C
#define CONFIG_SYS_I2C
@@ -126,8 +135,38 @@
#define CONFIG_PHYLIB
#define CONFIG_PHY_SMSC
+
+#if defined(CONFIG_MX6UL)
#define CONFIG_RESET_PHY_R /* Software Reset of PHY */
+#endif
+/* Initial ARP Hangs so configure small timeout */
+
+/* USB Configs */
+/* Host */
+#define CONFIG_USB
+#define CONFIG_USB_EHCI /* EHCI driver */
+#define CONFIG_USB_EHCI_MX6 /* iMX6 EHCI driver */
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* OTG Core Init after Reset*/
+#define CONFIG_USB_HOST_ETHER /* USB Ethernet support */
+#define CONFIG_USB_ETHER_ASIX /* USB Ethernet support hardware adapter */
+#define CONFIG_USB_KEYBOARD /* USB Keyboard support */
+#define CONFIG_USB_STORAGE /* USB Storage support */
+#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) /* MACRO non-ehci registers in the FSL SOC USB controller */
+#define CONFIG_MXC_USB_FLAGS 0 /* MXC Flag for ehci_hcd_init ?? */
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number (core 0 + core 1) */
+
+/* Device */
+#define CONFIG_CI_UDC /* USB ChipIdea Device driver */
+#define CONFIG_USBD_HS /* USB Device High speed support */
+#define CONFIG_USB_GADGET /* USB Device Gadget Layer support */
+#define CONFIG_USB_GADGET_DUALSPEED /* USB Device High speed support Ethernet */
+#define CONFIG_USB_FUNCTION_MASS_STORAGE /* USB Device Mass Storage support */
+#define CONFIG_USB_GADGET_DOWNLOAD /* USB Download Gadget support */
+#define CONFIG_USB_GADGET_VBUS_DRAW 2 /* Maximum VBUS power usage (2-500 mA) */
+#define CONFIG_G_DNL_VENDOR_NUM 0x0525 /* Vendor ID of USB Device */
+#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5 /* Product ID of USB Device */
+#define CONFIG_G_DNL_MANUFACTURER "FSL" /* Manufacturer of USB Device */
/* Environment */
#define CONFIG_ENV_SIZE (128 * 1024)
@@ -137,39 +176,67 @@
/* Commands */
#define CONFIG_CMD_BOOTZ
#undef CONFIG_CMD_IMLS
-#define EMMC_ENV ""
-#define VIDEO_ARGS ""
-#define VIDEO_ARGS_SCRIPT ""
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+#define EMMC_ENV \
+ "emmcdev=1\0" \
+ "update_emmc_firmware=" \
+ "if test ${ip_dyn} = yes; then " \
+ "setenv get_cmd dhcp; " \
+ "else " \
+ "setenv get_cmd tftp; " \
+ "fi; " \
+ "if ${get_cmd} ${update_sd_firmware_filename}; then " \
+ "if mmc dev ${emmcdev} 1; then " \
+ "setexpr fw_sz ${filesize} / 0x200; " \
+ "setexpr fw_sz ${fw_sz} + 1; " \
+ "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+ "fi; " \
+ "fi\0"
+#else
#define EMMC_ENV ""
+#endif
+
+#define VIDEO_ARGS "${video_args}"
+#define VIDEO_ARGS_SCRIPT "run video_args_script; "
+
#ifndef VIDEO_ARGS
#define VIDEO_ARGS ""
+else
+#define VIDEO_ARGS "${video_args}"
#endif
#ifndef VIDEO_ARGS_SCRIPT
#define VIDEO_ARGS_SCRIPT ""
+#else
+#define VIDEO_ARGS_SCRIPT "run video_args_script; "
#endif
+#ifndef CONFIG_HWTEST
+
+/* --------------- Production Environment --------------- */
+
+/* --------------- IGEP0046 Dual --------------- */
+
+#if defined(CONFIG_MX6UL)
+
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootenv=uEnv.txt\0" \
- "bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} - ${fdt_addr};\0" \
"image=zImage\0" \
"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
"fdt_addr=0x83000000\0" \
"boot_fdt=try\0" \
- "ipaddr=192.168.2.110\0" \
+ "bootdir=\0" \
+ "ethaddr=\0" \
"ip_dyn=no\0" \
"console=" CONSOLE_DEV "\0" \
"fdt_high=0xffffffff\0" \
"initrd_high=0xffffffff\0" \
"mmcdev=0\0" \
"mmcpart=1\0" \
- "emmcdev=1\0" \
- "mmcpart=1\0" \
"mmcroot="CONFIG_MMCROOT " rootwait rw\0" \
- "mfgtool_args=setenv bootargs console=${console},${baudrate} root=${emmcroot} \0"\
- "emmcroot=/dev/mmcblk1p2 rootwait rw\0" \
+ "emmcroot=/dev/mmcblk2p2 rootwait rw\0" \
"sataroot=/dev/sda2 rw rootwait\0" \
"emmcdevconf=setenv mmcdev ${emmcdev}\0" \
"emmcrootconf=setenv mmcroot ${emmcroot}\0" \
@@ -199,13 +266,13 @@
"setexpr fb $fb + 1; " \
"done\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=${mmcroot} " \
+ "root=${mmcroot} fec.macaddr=${ethaddr} " \
VIDEO_ARGS "\0" \
- "loadbootenv=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootenv}\0" \
+ "loadbootenv=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}${bootenv}\0" \
"importbootenv=echo Importing environment from mmc ...; " \
"env import -t ${loadaddr} ${filesize}\0" \
- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+ "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}${image}\0" \
+ "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${bootdir}${fdt_file}\0" \
"mmcboot=echo Booting from mmc ...; " \
VIDEO_ARGS_SCRIPT \
"run mmcargs; " \
@@ -223,10 +290,10 @@
"bootz; " \
"fi;\0" \
"sataargs=setenv bootargs console=${console},${baudrate} " \
- "root=${sataroot} " \
+ "root=${sataroot} fec.macaddr=${ethaddr} " \
VIDEO_ARGS "\0" \
- "loadimagesata=fatload sata 0:1 ${loadaddr} ${image}\0" \
- "loadfdtsata=fatload sata 0:1 ${fdt_addr} ${fdt_file}\0" \
+ "loadimagesata=fatload sata 0:1 ${loadaddr} ${bootdir}${image}\0" \
+ "loadfdtsata=fatload sata 0:1 ${fdt_addr} ${bootdir}${fdt_file}\0" \
"sataboot=echo Booting from sata ...; " \
VIDEO_ARGS_SCRIPT \
"run sataargs; " \
@@ -248,9 +315,11 @@
"bootz; " \
"fi;\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
- "root=/dev/nfs " \
- "ip=dhcp nfsroot=${serverip}:${rootnfs},v3,tcp\0" \
+ "root=/dev/nfs fec.macaddr=${ethaddr} " \
+ VIDEO_ARGS "\0" \
+ "ip=dhcp nfsroot=${serverip}:${rootnfs},v3,tcp " \
"netboot=echo Booting from net ...; " \
+ VIDEO_ARGS_SCRIPT \
"run netargs; " \
"ping ${serverip}; " \
"if test ${ip_dyn} = yes; then " \
@@ -258,9 +327,9 @@
"else " \
"setenv get_cmd tftp; " \
"fi; " \
- "${get_cmd} ${image}; " \
+ "${get_cmd} ${bootdir}${image}; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+ "if ${get_cmd} ${fdt_addr} ${bootdir}${fdt_file}; then " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"else " \
"if test ${boot_fdt} = try; then " \
@@ -278,7 +347,7 @@
"mmc dev ${mmcdev};" \
"if mmc rescan; then " \
"if run loadbootenv; then " \
- "echo Loaded environment from ${bootenv};" \
+ "echo Loaded environment from ${bootdir}${bootenv};" \
"run importbootenv;" \
"fi;" \
"if run loadimage; then " \
@@ -291,7 +360,7 @@
"mmc dev ${mmcdev};" \
"if mmc rescan; then " \
"if run loadbootenv; then " \
- "echo Loaded environment from ${bootenv};" \
+ "echo Loaded environment from ${bootdir}${bootenv};" \
"run importbootenv;" \
"fi;" \
"if run loadimage; then " \
@@ -300,11 +369,104 @@
"fi; " \
"run netboot;"
-#endif /* __IGEP0146_CONFIG_H */
-
-
-
-
+#endif
+#else /* defined CONFIG_HWTEST */
+
+/* ------------------ Hardware Test Environment ------------------ */
+
+#define ENV_SET_MODELANDVARIANT \
+ "setmodelandvariant=if printenv bmodel; then " \
+ "if printenv bvariant; then " \
+ "setenv kparams ${kparams} bmodel=${bmodel} bvariant=${bvariant};" \
+ "fi;" \
+ "fi\0 "
+
+#define ENV_NFS_ROOTFS \
+ "netmask=255.255.255.0\0" \
+ "dnsserver=8.8.8.8\0" \
+ "machinename=noname\0" \
+ "ipaddr=0.0.0.0\0" \
+ "serverip=0.0.0.0\0" \
+ "gateway=0.0.0.0\0" \
+ "rootnfs=/\0" \
+ "ipconf=setenv setup_ip ${ipaddr}:${serverip}:${gateway}:${netmask}:${machinename}:eth0:off:${dnsserver}::${serverip}\0" \
+ "netload=if tftpboot ${loadaddr} ${bootfile}; then " \
+ "if tftpboot ${fdt_addr} ${dtbfile}; then " \
+ "bootz ${loadaddr} - ${fdt_addr}; " \
+ "else " \
+ "echo Failed to get DTB file from TFTP; " \
+ "run errorstate; " \
+ "fi; " \
+ "else " \
+ "echo Failed to get kernel image from TFTP; " \
+ "run errorstate; " \
+ "fi\0" \
+ "netargs=run ipconf; " \
+ "setenv bootargs console=${console},${baudrate} root=/dev/nfs rw ip=${setup_ip} " \
+ "nfsroot=${serverip}:${rootnfs},v3,tcp fec.macaddr=${ethaddr} ${kparams} " \
+ VIDEO_ARGS "\0" \
+ "netboot=echo Booting from net ...; " \
+ "run netargs; " \
+ "run netload \0"
+
+#define ENV_ERRORSTATE \
+ "errorstate=led 1 off; " \
+ "led 0 on; " \
+ "sleep 60; " \
+ "reset \0"
+
+
+#define ENV_LOAD_UENV_SD_TEST \
+ "sduenvboot=mmc dev ${mmcdev};" \
+ "if mmc rescan; then " \
+ "if fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootenv}; then " \
+ "echo Loaded ${bootenv} file in RAM...; " \
+ "run importbootenv; " \
+ "else " \
+ "echo Not found ${bootenv} file in SD...; " \
+ "run errorstate; " \
+ "fi; " \
+ "else " \
+ "echo No SD device found; " \
+ "run errorstate; " \
+ "fi\0 "
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console=" CONSOLE_DEV "\0" \
+ "bootenv=uEnv.txt\0" \
+ "bootfile=zImage\0" \
+ "mmcdev=0\0" \
+ "mmcpart=1\0" \
+ "ethaddr=\0" \
+ "dtbfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "fdt_high=0xffffffff\0" \
+ "initrd_high=0xffffffff\0" \
+ "fdt_addr=0x18000000\0" \
+ "importbootenv= echo Importing uEnv.txt variables...; " \
+ "env import -t ${loadaddr} ${filesize}\0" \
+ "video_args_hdmi=setenv video_args $video_args " \
+ "video=mxcfb${fb}:dev=hdmi,1920x1080M@60,if=RGB24\0" \
+ "video_args_lvds=setenv video_args $video_args " \
+ "video=mxcfb${fb}:dev=ldb,1280x720M@60,if=RGB24\0" \
+ "fb=0\0" \
+ "video_interfaces=hdmi lvds\0" \
+ "video_args_script=" \
+ "for v in ${video_interfaces}; do " \
+ "run video_args_${v}; " \
+ "setexpr fb $fb + 1; " \
+ "done\0" \
+ ENV_NFS_ROOTFS \
+ ENV_LOAD_UENV_SD_TEST \
+ ENV_ERRORSTATE \
+ ENV_SET_MODELANDVARIANT
+#define CONFIG_BOOTCOMMAND \
+ "led 1 on;" \
+ "run sduenvboot;" \
+ "run setmodelandvariant;" \
+ VIDEO_ARGS_SCRIPT \
+ "run netboot"
+
+#endif /*CONFIG_HWTEST*/
+#endif /* __IGEP0146_CONFIG_H */ \ No newline at end of file