[U-Boot] [PATCH 6/6] configs: imx6dl-mamoj: Add Falcon mode support

Jagan Teki jagan at amarulasolutions.com
Mon Mar 19 19:47:11 UTC 2018


Add Falcon mode support to boot Linux directly after SPL.

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 board/bticino/mamoj/README     | 27 +++++++++++++++++++++++++++
 board/bticino/mamoj/spl.c      | 11 +++++++++++
 configs/imx6dl_mamoj_defconfig |  1 +
 include/configs/imx6dl-mamoj.h | 12 ++++++++++++
 4 files changed, 51 insertions(+)

diff --git a/board/bticino/mamoj/README b/board/bticino/mamoj/README
index 84110eafc1..707c06db58 100644
--- a/board/bticino/mamoj/README
+++ b/board/bticino/mamoj/README
@@ -15,6 +15,8 @@ The following methods can be used for booting Mamoj boards:
 
 2. eMMC boot (via DFU)
 
+3. Falcon mode
+
 1. USB SDP boot:
 ---------------
 
@@ -92,6 +94,31 @@ The following methods can be used for booting Mamoj boards:
 
   Poweroff and Poweron the board and see U-Boot booting from eMMC.
 
+3. Falcon mode:
+--------------
+
+  - Skip 10M space and create dual partitions for eMMC, start sector is 20480
+
+    Partition Map for MMC device 2  --   Partition Type: DOS
+
+    Part    Start Sector    Num Sectors     UUID            Type
+      1     20480           131072          c52e78be-01     83
+      2     151552          7581696         c52e78be-02     83
+
+  - Write uImage
+
+    => fatload mmc 2:1 $kernel_addr_r uImage
+    => mmc write $kernel_addr_r 0x1000 0x4000
+
+  - Write dtb and args
+
+    => setenv bootargs console=ttymxc2,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw quiet
+    => fatload mmc 2:1 $fdt_addr_r imx6dl-mamoj.dtb
+    => spl export fdt $kernel_addr_r - $fdt_addr_r
+    => mmc write 0x13000000 0x800 0x800
+
+  Poweroff and Poweron the board and see Linux booting directly after SPL.
+
 --
 Jagan Teki <jagan at amarulasolutions.com>
 03/20/18
diff --git a/board/bticino/mamoj/spl.c b/board/bticino/mamoj/spl.c
index 82568f7af5..531064995f 100644
--- a/board/bticino/mamoj/spl.c
+++ b/board/bticino/mamoj/spl.c
@@ -27,6 +27,17 @@ static iomux_v3_cfg_t const uart3_pads[] = {
 	IOMUX_PADS(PAD_EIM_D25__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
 };
 
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+	/* break into full u-boot on 'c' */
+	if (serial_tstc() && serial_getc() == 'c')
+		return 1;
+
+	return 0;
+}
+#endif
+
 static int mx6dl_dcd_table[] = {
 	0x020e0774, 0x000C0000, /* MX6_IOM_GRP_DDR_TYPE */
 	0x020e0754, 0x00000000, /* MX6_IOM_GRP_DDRPKE */
diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index c4a5fa22f9..3b1db5bfba 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MX6DL_MAMOJ=y
+CONFIG_SPL_OS_BOOT=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_DEFAULT_DEVICE_TREE="imx6dl-mamoj"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h
index 0ac238b82d..2f5e212b88 100644
--- a/include/configs/imx6dl-mamoj.h
+++ b/include/configs/imx6dl-mamoj.h
@@ -64,6 +64,18 @@
 #define CONFIG_MXC_USB_FLAGS			0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT		2
 
+/* Falcon */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME	"args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME	"uImage"
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR	0x13000000
+#define CONFIG_CMD_SPL_WRITE_SIZE	(128 * SZ_1K)
+
+/* MMC support: args at 1MB kernel at 2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR		0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS		(CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR		0x1000  /* 2MB */
+
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START	0x80000000
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 0x8000000)
-- 
2.14.3



More information about the U-Boot mailing list