imx: ventana: add EMMC configuration
Prepare for boards with EMMC instead of NAND flash
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
diff --git a/board/gateworks/gw_ventana/README b/board/gateworks/gw_ventana/README
index f3f8998..57c64a1 100644
--- a/board/gateworks/gw_ventana/README
+++ b/board/gateworks/gw_ventana/README
@@ -30,9 +30,14 @@
To build U-Boot for the Gateworks Ventana product family:
- make gwventana_config
+For NAND FLASH based boards:
+ make gwventana_nand_config
make
+For EMMC FLASH based boards:
+ make gwventana_emmc_config
+ make
+
3. Boot source:
---------------
@@ -99,11 +104,11 @@
More details about the i.MX6 BOOT ROM can be found in the IMX6 reference manual.
-3.1. boot from micro-SD
------------------------
+3.1. boot from MMC (eMMC/microSD)
+---------------------------------
When the IMX6 eFUSE settings have been factory programmed to boot from
-micro-SD the SPL will be loaded from offset 0x400 (1KB). Once the SPL is
+MMC the SPL will be loaded from offset 0x400 (1KB). Once the SPL is
booted, it will load and execute U-Boot (u-boot.img) from offset 69KB
on the micro-SD (defined by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR).
@@ -111,11 +116,11 @@
U-Boot from a file on a FAT/EXT filesystem on the micro-SD, we chose to
use raw micro-SD access to keep the code-size and boot time of the SPL down.
-For these reasons a micro-SD that will be used as an IMX6 primary boot
+For these reasons an MMC device that will be used as an IMX6 primary boot
device must be carefully partitioned and prepared.
The following shell commands are executed on a Linux host (adjust DEV to the
-block storage device of your micro-SD):
+block storage device of your MMC, ie /dev/mmcblk0):
DEV=/dev/sdc
# zero out 1MB of device
diff --git a/configs/gwventana_defconfig b/configs/gwventana_emmc_defconfig
similarity index 98%
copy from configs/gwventana_defconfig
copy to configs/gwventana_emmc_defconfig
index adc7ec8..96d76e4 100644
--- a/configs/gwventana_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -4,11 +4,11 @@
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_TARGET_GW_VENTANA=y
+CONFIG_SPL_I2C_SUPPORT=y
CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_POWER_SUPPORT=y
CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_NAND_SUPPORT=y
CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_POWER_SUPPORT=y
CONFIG_VIDEO=y
CONFIG_SPL_STACK_R_ADDR=0x18000000
CONFIG_FIT=y
@@ -22,7 +22,6 @@
CONFIG_SPL=y
CONFIG_SPL_STACK_R=y
CONFIG_SPL_DMA_SUPPORT=y
-CONFIG_SPL_I2C_SUPPORT=y
CONFIG_SPL_OS_BOOT=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Ventana > "
diff --git a/configs/gwventana_defconfig b/configs/gwventana_nand_defconfig
similarity index 99%
rename from configs/gwventana_defconfig
rename to configs/gwventana_nand_defconfig
index adc7ec8..6cc5897 100644
--- a/configs/gwventana_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -4,11 +4,12 @@
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_TARGET_GW_VENTANA=y
+CONFIG_SPL_I2C_SUPPORT=y
CONFIG_SPL_MMC_SUPPORT=y
-CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_SPL_WATCHDOG_SUPPORT=y
CONFIG_SPL_POWER_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_WATCHDOG_SUPPORT=y
CONFIG_VIDEO=y
CONFIG_SPL_STACK_R_ADDR=0x18000000
CONFIG_FIT=y
@@ -22,7 +23,6 @@
CONFIG_SPL=y
CONFIG_SPL_STACK_R=y
CONFIG_SPL_DMA_SUPPORT=y
-CONFIG_SPL_I2C_SUPPORT=y
CONFIG_SPL_OS_BOOT=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Ventana > "
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index d51bcc9..1606f20 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -68,7 +68,7 @@
#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
#endif
-#else
+#elif defined(CONFIG_SPL_NAND_SUPPORT)
/* Enable NAND support */
#define CONFIG_CMD_NAND
#define CONFIG_CMD_NAND_TRIMFFS
@@ -227,9 +227,11 @@
/* Persistent Environment Config */
#ifdef CONFIG_SPI_FLASH
-#define CONFIG_ENV_IS_IN_SPI_FLASH
+ #define CONFIG_ENV_IS_IN_SPI_FLASH
+#elif defined(CONFIG_SPL_NAND_SUPPORT)
+ #define CONFIG_ENV_IS_IN_NAND
#else
-#define CONFIG_ENV_IS_IN_NAND
+ #define CONFIG_ENV_IS_IN_MMC
#endif
#if defined(CONFIG_ENV_IS_IN_MMC)
#define CONFIG_SYS_MMC_ENV_DEV 0