AnsweredAssumed Answered

Need help adding Falcon Mode patch in Yocto

Question asked by Rich Hackl on Jul 8, 2018
Latest reply on Jul 16, 2018 by Rich Hackl

 I am trying to add  Falcon Mode to an existing IMX6 Yocto project  (imx_v2015.04.4.1.15_1.2.0_ga). I have added a u-boot patch referenced in Diego Dorta's blog (Link: How to decrease boot time on iMX6 - i.MXDev Blog ).

 

In the patch the MENU_BUTTON is used to select falcon mode vs u-boot:

Falcon Mode Patch

From 0833cfaa104d226ec9ea64c7fdabba29d59659e5 Mon Sep 17 00:00:00 2001
From: rhackl <rich.hackl@creationtech.com>
Date: Fri, 29 Jun 2018 13:03:15 -0500
Subject: [PATCH] mx6sabresd.c (patch)

---
board/freescale/mx6sxsabresd/mx6sxsabresd.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
index 3b238e7..a4c4067 100644
--- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c
+++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
@@ -90,6 +90,9 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | \
PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)

+#define MENU_BUTTON IMX_GPIO_NR(6, 18)
+#define MOTOR_START IMX_GPIO_NR(6, 16)
+
int dram_init(void)
{
gd->ram_size = PHYS_SDRAM_SIZE;
@@ -120,7 +123,7 @@ static iomux_v3_cfg_t const usdhc3_pads[] = {
MX6_PAD_SD3_DATA3__USDHC3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD3_DATA4__USDHC3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD3_DATA5__USDHC3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
- MX6_PAD_SD3_DATA6__USDHC3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+ MX6_PAD_SD3_DATA6__GPIO6_IO18 | MUX_PAD_CTRL(NO_PAD_CTRL),
MX6_PAD_SD3_DATA7__USDHC3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

/* CD pin */
@@ -1081,6 +1084,20 @@ static struct mx6_ddr3_cfg mem_ddr = {
.trasmin = 3500,
};

+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+ gpio_direction_output(MOTOR_START,0);
+ gpio_direction_input(MENU_BUTTON);
+
+ gpio_set_value(MOTOR_START,gpio_get_value(MENU_BUTTON));
+
+ /* Only enter in Falcon mode if KEY_VOL_UP is pressed */
+ return !gpio_get_value(MENU_BUTTON);
+ return 0;
+}
+#endif
+
static void ccgr_init(void)
{
struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
--
1.9.1

 

I also added a patch for mx6solosabresd_defconfig to enable SPL, etc:

 

mx6solosabresd_defconfig patch

From 2fe3ff5179a47a7ca5967b878a8946942c3ad760 Mon Sep 17 00:00:00 2001
From: rhackl <rich.hackl@creationtech.com>
Date: Fri, 29 Jun 2018 16:01:34 -0500
Subject: [PATCH] mx6solosabresd_defconfig

---
configs/mx6solosabresd_defconfig | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/configs/mx6solosabresd_defconfig b/configs/mx6solosabresd_defconfig
index f3ce9f4..7dfb3db 100644
--- a/configs/mx6solosabresd_defconfig
+++ b/configs/mx6solosabresd_defconfig
@@ -5,3 +5,8 @@ CONFIG_SYS_MALLOC_F=y
CONFIG_SYS_MALLOC_F_LEN=0x400
CONFIG_DM=y
CONFIG_DM_THERMAL=y
+
+CONFIG_SPL=y
+#CONFIG_SPL_BUILD=y
+#CONFIG_SPL_OS_BUILD=y
+CONFIG_CMD_SPL=y
--
1.9.1

 

I have also set SPL_BINARY = "SPL" in u-boot.inc.

 

The problem is that Yocto does not build or deploy SPL and I get errors such as "mx6solosabresd_defconfig/SPL - no such directory". I have confirmed that the "SPL EXPORT" command does get built, however SPL.c itself always fails to build during the bitbake "package u-boot-imx" command.

 

Typical bitbake commands to rebuild

bitbake -c clean u-boot-imx
bitbake -c clean linux-imx
bitbake -v -D -f -c compile linux-imx
bitbake -v -D -f -c package u-boot-imx                                ###errors occur here

bitbake -v -D -f -c deploy u-boot-imx

bitbake -v _D -f -c rootfs humboldt-image

 

Am I missing something simple here? What is the correct way to tell Yocto to build and include SPL in the u-boot image?

Outcomes