board: toradex: apalis/colibri imx6: Detect new v1.2 SoM variant
authorErnest Van Hoecke <ernest.vanhoecke@toradex.com>
Fri, 7 Mar 2025 10:34:13 +0000 (11:34 +0100)
committerFabio Estevam <festevam@gmail.com>
Thu, 13 Mar 2025 18:15:50 +0000 (15:15 -0300)
commit47d5982c60165bcc17d0328cc9e375a519b279eb
treec63586b22aff98174a547f63b18f62befa52f479
parent9028da7675ea8084abab8e83484b42af54bd4df6
board: toradex: apalis/colibri imx6: Detect new v1.2 SoM variant

Apalis/Colibri iMX6 V1.2 will replace the STMPE811 ADC/Touch controller
which is EOL by the TLA2024 ADC and AD7879 touch controller.

To support this new version, we detect the presence of the TLA2024
during boot and set a new environment variable named "variant". This
will allow us and users to select the correct DT easily.

By probing via I2C we have a robust detection method instead of relying
on the existing "board_rev" environment variable which is set by the
config block. Users can use "variant" in their DT selection and do not
have to map the board revision to a device tree.

"variant" environment variable behaviour:
* Empty or absent for all versions below v1.2 (STMPE811)
* "-v1.2" for all versions starting from v1.2 (TLA2024 + AD7879)

Usage example:
setenv fdtfile imx6q-apalis${variant}-${fdt_board}.dtb

Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
board/toradex/apalis_imx6/apalis_imx6.c
board/toradex/colibri_imx6/colibri_imx6.c