Skip to content
Snippets Groups Projects
Commit 5072b37a authored by Dmitry Petrov's avatar Dmitry Petrov
Browse files

[IMX8MM][MYON2] auto apply of board rev overlay

The commit introduces a new routine for loading and applying the overlay
of the device tree, depending on the detected revision of the board.
This routine is stored in the "fdt_overlay_board_rev" env variable.

In order to execute this code after the loading of the dtb, we overwrite
the command "fdt_overlay_load2ram" (MACRO_ENV_FDT_LOAD_OVERLAY_BASE).
parent 0e8b1e04
No related branches found
No related tags found
No related merge requests found
...@@ -65,15 +65,5 @@ Device tree overlays ...@@ -65,15 +65,5 @@ Device tree overlays
There are few version/revision of Myon II i.MX8MM modules. They may have different hardware components (e.g. audio codecs), There are few version/revision of Myon II i.MX8MM modules. They may have different hardware components (e.g. audio codecs),
and to enable these components in Linux, there are device tree overlays. and to enable these components in Linux, there are device tree overlays.
The DT overlay can be set with the "seco_config" command in U-Boot, for example: The DT overlay will be applied automatically if the board revision is detected and device tree overlay for that revision
exists on the boot partition.
MX SECO U-Boot > seco_config
__________________________________________________
Choose FDT overlay option for board revision.
__________________________________________________
1) not use
2) V1R4
3) V2R1
> 2
...@@ -114,14 +114,6 @@ video_mode_t video_mode_list_novideo [] = { ...@@ -114,14 +114,6 @@ video_mode_t video_mode_list_novideo [] = {
#ifdef CONFIG_OF_LIBFDT_OVERLAY #ifdef CONFIG_OF_LIBFDT_OVERLAY
/* *********************************** FDT OVERLAY *********************************** */ /* *********************************** FDT OVERLAY *********************************** */
overlay_list_t overlay_peripheral_list[] = { overlay_list_t overlay_peripheral_list[] = {
{
.title = "board revision",
.options = {
{ "not use", "" }, // default
{ "V1R4", STR(ENV_DTBO_MYON2_IMX8MM_V1R4) },
{ "V2R1", STR(ENV_DTBO_MYON2_IMX8MM_V2R1) },
},
},
{ {
.title = "display", .title = "display",
.options = { .options = {
......
...@@ -325,6 +325,35 @@ ...@@ -325,6 +325,35 @@
#define ENV_BOOT_TYPE booti #define ENV_BOOT_TYPE booti
#ifdef CONFIG_OF_LIBFDT_OVERLAY
#define ENV_DEVICE_CONFIG \
"fdt_overlay_board_rev= echo \"Applying board revision specific overlay...\"; " \
"if itest.s ${board_rev} == \"????\"; then echo \"Unknown revision of the board\"; exit; fi; " \
"if test -n ${board_rev}; then " \
"if load mmc \"${fdt_device_id}:${fdt_partition}\" 0x45000000 seco-imx8mm-myon2-${board_rev}.dtbo; then " \
"fdt apply 0x45000000; " \
"fi; " \
"fi;\0" \
#endif
#include "seco_mx8_env.h" #include "seco_mx8_env.h"
#ifdef CONFIG_OF_LIBFDT_OVERLAY
#undef MACRO_ENV_FDT_LOAD_OVERLAY_BASE
/* Here we overwrite the fdt_overlay_load2ram command, to additionally apply
device tree overlay for detected board revision.
*/
#define MACRO_ENV_FDT_LOAD_OVERLAY_BASE \
fdt addr ${fdt_loadaddr}; fdt resize ${fdt_resize}; \
if test -n "${fdt_overlay_carrier_file}"; then run fdt_overlay_carrier_cmd; fi; \
seco_config fdtoverlay ; \
if test -n "${fdt_overlay_per_cmd}"; then run fdt_overlay_per_cmd; fi; \
if test -n "${fdt_overlay_video_cmd}"; then run fdt_overlay_video_cmd; fi; \
if test -n "${fdt_overlay_touch_cmd}"; then run fdt_overlay_touch_cmd; fi; \
if test -n "${fdt_overlay_board_rev}"; then run fdt_overlay_board_rev; fi; \
#endif
#endif /* __SECO_IMX8MM_MYON2_H */ #endif /* __SECO_IMX8MM_MYON2_H */
...@@ -69,6 +69,4 @@ ...@@ -69,6 +69,4 @@
#define ENV_DTBO_C57_EDP seco-imx8qxp-c57-sn65dsi86-edp.dtbo #define ENV_DTBO_C57_EDP seco-imx8qxp-c57-sn65dsi86-edp.dtbo
#define ENV_DTBO_ATM0700L61 seco-imx8mm-myon2-atm0700l61ct.dtbo #define ENV_DTBO_ATM0700L61 seco-imx8mm-myon2-atm0700l61ct.dtbo
#define ENV_DTBO_MYON2_IMX8MM_V1R4 seco-imx8mm-myon2-v1r4.dtbo
#define ENV_DTBO_MYON2_IMX8MM_V2R1 seco-imx8mm-myon2-v2r1.dtbo
#endif /* __SECO_MX8_DTBO_H */ #endif /* __SECO_MX8_DTBO_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment