diff mbox series

[8/9] board: gateworks: venice: add board model to dt

Message ID 20210727221941.10420-8-tharvey@gateworks.com
State Accepted
Commit 2eb85647c0e76a3be9616d67765eb8fa74ea7481
Delegated to: Stefano Babic
Headers show
Series [1/9] configs: imx8mm_venice_defconfig: remove unused SPL features | expand

Commit Message

Tim Harvey July 27, 2021, 10:19 p.m. UTC
Add the specific board model from EEPROM config to the device-tree to
make it easier to access from Linux userspace.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/venice/imx8mm_venice.c | 8 ++++++++
 configs/imx8mm_venice_defconfig        | 1 +
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/board/gateworks/venice/imx8mm_venice.c b/board/gateworks/venice/imx8mm_venice.c
index ca01e75d0d..2a97d55d32 100644
--- a/board/gateworks/venice/imx8mm_venice.c
+++ b/board/gateworks/venice/imx8mm_venice.c
@@ -152,3 +152,11 @@  int board_mmc_get_env_dev(int devno)
 {
 	return devno;
 }
+
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+	/* set board model dt prop */
+	fdt_setprop_string(blob, 0, "board", gsc_get_model());
+
+	return 0;
+}
diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig
index f1efdc60a4..58b00a6813 100644
--- a/configs/imx8mm_venice_defconfig
+++ b/configs/imx8mm_venice_defconfig
@@ -27,6 +27,7 @@  CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set