diff mbox series

[U-Boot,5/6] configs: imx6dl-mamoj: Add DFU support

Message ID 20180319194711.23323-6-jagan@amarulasolutions.com
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series i.MX6DL: Add BTicino Mamoj board support | expand

Commit Message

Jagan Teki March 19, 2018, 7:47 p.m. UTC
Add DFU support for BTicino Mamoj board and update
the same steps in README.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Simone CIANNI <simone.cianni@bticino.it>
Signed-off-by: Raffaele RECALCATI <raffaele.recalcati@bticino.it>
---
 board/bticino/mamoj/README     | 37 +++++++++++++++++++++++++++++++++++++
 configs/imx6dl_mamoj_defconfig |  2 ++
 include/configs/imx6dl-mamoj.h |  4 +++-
 3 files changed, 42 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/board/bticino/mamoj/README b/board/bticino/mamoj/README
index f782516101..84110eafc1 100644
--- a/board/bticino/mamoj/README
+++ b/board/bticino/mamoj/README
@@ -13,6 +13,8 @@  The following methods can be used for booting Mamoj boards:
 
 1. USB SDP boot
 
+2. eMMC boot (via DFU)
+
 1. USB SDP boot:
 ---------------
 
@@ -55,6 +57,41 @@  The following methods can be used for booting Mamoj boards:
 
   We can see U-Boot boot from USB SDP on minicom
 
+2. eMMC boot via DFU:
+--------------------
+
+  Once booted from USB SDP, program the eMMC as below(make sure to connect USB OTG)
+
+  - Change eMMC partition config
+
+     => mmc partconf 2 1 0 0
+
+  - Partition eMMC on host
+
+     => ums 0 mmc 2
+
+    Host will able to detect the eMMC disk as UMS, partition the same.
+
+  - Program SPL
+
+     => setenv dfu_alt_info $dfu_alt_info_spl
+     => dfu 0 mmc 2
+
+     At Host
+
+     # dfu-util -D SPL -a spl
+
+  - Program u-boot-dtb.img
+
+     => setenv dfu_alt_info $dfu_alt_info_uboot
+     => dfu 0 mmc 2
+
+     At Host
+
+     # dfu-util -D u-boot-dtb.img -a u-boot
+
+  Poweroff and Poweron the board and see U-Boot booting from eMMC.
+
 --
 Jagan Teki <jagan@amarulasolutions.com>
 03/20/18
diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index 25ae4299d7..c4a5fa22f9 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -15,6 +15,7 @@  CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_SYS_PROMPT="=> "
 CONFIG_CRC32_VERIFY=y
+CONFIG_CMD_DFU=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -44,5 +45,6 @@  CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
+CONFIG_DFU_MMC=y
 CONFIG_IMX_THERMAL=y
 CONFIG_SYS_I2C_MXC=y
diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h
index 929365af79..0ac238b82d 100644
--- a/include/configs/imx6dl-mamoj.h
+++ b/include/configs/imx6dl-mamoj.h
@@ -15,7 +15,7 @@ 
 #include "mx6_common.h"
 
 /* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN		(16 * SZ_1M)
+#define CONFIG_SYS_MALLOC_LEN		(35 * SZ_1M)
 
 /* Total Size of Environment Sector */
 #define CONFIG_ENV_SIZE			SZ_128K
@@ -37,6 +37,8 @@ 
 	"fdt_addr_r=0x13000000\0"	\
 	"kernel_addr_r=0x10008000\0"	\
 	"fdt_high=0xffffffff\0"		\
+	"dfu_alt_info_spl=spl raw 0x2 0x400\0" \
+	"dfu_alt_info_uboot=u-boot raw 0x8a 0x11400\0" \
 	BOOTENV
 
 #define BOOT_TARGET_DEVICES(func) \