Mender with RZ/G2L-Hummingboard

Hi,

I’m developing a new Mender integration with Yocto for a RZ/G2L SOM with the Solidrun Hummingboard Pro. I’m quite new to this (Yocto and Mender) and I’m having some trouble making it work.

I’ve built a functional image, but when I’m unable to build it with Mender. At first, we tried to do it with the auto-patcher, but the image won’t start. I’ve applied the manual u-boot configuration, but same result, the image won’t start, not even the bootloaders.
Finally, I’ve tried with meta-meder-community and it’s rzg2l with SMARC, but won’t work either.

I’m working to apply a patch to the defconfig and .h file. This is what I have right now:

rzg2l-solidrun.h:

diff --git a/mnt/yocto/solidrun/build/tmp/work/rzg2l_hummingboard-poky-linux/u-boot/1_v2021.10+gitAUTOINC+cb93dca45a-r0/git/include/configs/rzg2l-solidrun.h b/rz-edit.h
index b96b351..beab6e7 100644
--- a/include/configs/rzg2l-solidrun.h
+++ b/include/configs/rzg2l-solidrun.h
@@ -84,7 +84,12 @@
     "kernel_comp_addr_r=" KERNEL_COMP_ADDR_R "\0" \
     "kernel_comp_size=" KERNEL_COMP_SIZE "\0" \
     "sdio_toggle=gpio toggle gpio-221; gpio toggle gpio-390; mmc rescan 1\0" \
-BOOTENV
+
+/* Mender integration */
+#define CONFIG_ENV_SIZE                0X20000
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_ENV
+

 /* For board */
 /* Ethernet RAVB */

rzg2l-solidrun_defconfig:

diff --git a/configs/rzg2l-solidrun_defconfig b/configs/rzg2l-solidrun_defconfig
index 1639f4d..7358d51 100644
--- a/configs/rzg2l-solidrun_defconfig
+++ b/configs/rzg2l-solidrun_defconfig
@@ -3,7 +3,9 @@ CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
 CONFIG_ENV_SIZE=0x20000
-CONFIG_ENV_OFFSET=0x300000
+CONFIG_ENV_OFFSET=0xFFFE0000
+CONFIG_ENV_OFFSET_REDUND=0xFFFC0000
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_DM_GPIO=y
 CONFIG_RCAR_GEN3=y
 CONFIG_R9A07G044L=y
@@ -16,7 +18,7 @@ CONFIG_SPL=n
 CONFIG_FIT=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOARD_LATE_INIT=y
-CONFIG_BOOTARGS="rw rootwait root=/dev/mmcblk0p2"
+CONFIG_BOOTARGS="rw rootwait"
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_DEFAULT_FDT_FILE="rzg2l-hummingboard-ripple.dtb"
 CONFIG_VERSION_VARIABLE=y
@@ -76,7 +78,7 @@ CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_MMC_ENV_DEV=0
-CONFIG_SYS_MMC_ENV_PART=1
+CONFIG_SYS_MMC_ENV_PART=2
 CONFIG_SYS_I2C_RZG2L_RIIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DISTRO_DEFAULTS=y
@@ -89,3 +91,6 @@ CONFIG_TFTP_TSIZE=y
 CONFIG_PROT_TCP=y
 CONFIG_PROT_TCP_SACK=y
 CONFIG_CMD_WGET=y
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
+

Any help will be appreciated, at least to know where to look at.

Kind regards,
Ton

Hi @tonrigat,

This seems to be some i.MX based board, and they usually expect a specific storage layout concerning the boot loader. So that’s probably what you need to set up accordingly. I don’t know about the SoC in question, but for an i.MX8-variant which already is supported, it looks like this:

MENDER_IMAGE_BOOTLOADER_FILE = "imx-boot"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "64"
MENDER_UBOOT_STORAGE_INTERFACE = "mmc"
MENDER_UBOOT_STORAGE_DEVICE = "1"
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
IMAGE_BOOT_FILES:append = "boot.scr"

(see meta-mender-community/kas/olimex-imx8mp-evb.yml at 3ee37a7e9fe81d812acf485f74bed5c878014c12 · mendersoftware/meta-mender-community · GitHub).

Those settings are usually derived from the original .wks file.

Greetz,
Josef