ARM: imx: cm_fx6: export board and soc info to env

Like many other i.MX6 based boards, there are multiple variants of
the cm-fx6 module featuring different SoC variants. Furthermore, the
module can be paired with multiple baseboards.

At the same time modern distribution like Fedora require U-Boot to
select a proper devicetree which depends on the SoC variant and the
baseboard.

Thus, export the SoC variant and the actual board to the environment
following the conventions of other i.MX6 devices (e.g. the NXP boards)
such that the environment can select a devicetree file to load.

For now, we only know for sure that the cm-fx6 module and the SB-fx6m
baseboard amount to a Utilite Computer variant (depending on the SoC).
Further combinations may be added in the future; e.g. CompuLab's
evaluation board once someone can verify the identification string
stored in its eeprom.

Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
This commit is contained in:
Christopher Spinrath
2018-01-09 22:01:35 +01:00
committed by Stefano Babic
parent f57263ee9b
commit dbeaa1d131
3 changed files with 23 additions and 0 deletions

View File

@@ -621,6 +621,27 @@ int board_init(void)
return 0;
}
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
char baseboard_name[16];
int err;
if (is_mx6dq())
env_set("board_rev", "MX6Q");
else if (is_mx6dl())
env_set("board_rev", "MX6DL");
err = cl_eeprom_get_product_name((uchar *)baseboard_name, 0);
if (err)
return 0;
if (!strncmp("SB-FX6m", baseboard_name, 7))
env_set("board_name", "Utilite");
#endif
return 0;
}
int checkboard(void)
{
puts("Board: CM-FX6\n");