[PATCH v3 13/19] imx: kontron-sl-mx8mm: Prepare for other i.MX8MM SoM types

2022-10-21 Thread sbabic
> From: Frieder Schrempf 
> This sets an env variable 'som_type' from the board code. It can
> later be used by environment scripts, e. g. to select the proper
> devicetree for the board.
> Signed-off-by: Frieder Schrempf 
> Reviewed-by: Fabio Estevam 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


[PATCH v3 13/19] imx: kontron-sl-mx8mm: Prepare for other i.MX8MM SoM types

2022-08-24 Thread Frieder Schrempf
From: Frieder Schrempf 

This sets an env variable 'som_type' from the board code. It can
later be used by environment scripts, e. g. to select the proper
devicetree for the board.

Signed-off-by: Frieder Schrempf 
Reviewed-by: Fabio Estevam 
---
Changes in v3:
* use "sl" instead of deprected "n801x" identifier

Changes in v2:
* add missing CONFIG_BOARD_LATE_INIT
---
 board/kontron/sl-mx8mm/sl-mx8mm.c  | 6 ++
 configs/kontron-sl-mx8mm_defconfig | 1 +
 2 files changed, 7 insertions(+)

diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c 
b/board/kontron/sl-mx8mm/sl-mx8mm.c
index 416c4cbb407..6e73edeb232 100644
--- a/board/kontron/sl-mx8mm/sl-mx8mm.c
+++ b/board/kontron/sl-mx8mm/sl-mx8mm.c
@@ -121,6 +121,12 @@ int board_init(void)
return 0;
 }
 
+int board_late_init(void)
+{
+   env_set("som_type", "sl");
+   return 0;
+}
+
 enum env_location env_get_location(enum env_operation op, int prio)
 {
enum boot_device boot_dev = get_boot_device();
diff --git a/configs/kontron-sl-mx8mm_defconfig 
b/configs/kontron-sl-mx8mm_defconfig
index 5dcee988478..a5c48a3fbca 100644
--- a/configs/kontron-sl-mx8mm_defconfig
+++ b/configs/kontron-sl-mx8mm_defconfig
@@ -31,6 +31,7 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOARD_TYPES=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x91
 CONFIG_SPL_BSS_MAX_SIZE=0x2000
-- 
2.37.2