toradex: colibri_imx7: Enable nand/emmc detection and set boot variant
authorHiago De Franco <hiago.franco@toradex.com>
Mon, 2 Oct 2023 11:57:49 +0000 (08:57 -0300)
committerStefano Babic <sbabic@denx.de>
Mon, 16 Oct 2023 06:46:01 +0000 (08:46 +0200)
commit0c39564d02817a3a5b5b2519e73afc0969966206
tree47ce58a9f991a82086fe0737472d586a1a0141aa
parent35fe2ae244b13a06297f08cdc5785bf913708079
toradex: colibri_imx7: Enable nand/emmc detection and set boot variant

Add detection of eMMC vs NAND devices on the Colibri iMX7
board. A GPIO is configured to detect the presence of an on-board resistor
that is configured differently based on the flash memory used. Depending on
the detection result, the 'variant' environment variable is set to '-emmc'
or cleared, indicating the type of storage device.

This enhancement improves variant detection during system initialization
through USB recovery mode, where U-Boot is loaded directly to RAM. This
allows variant detection for an accurate device tree selection.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
board/toradex/colibri_imx7/colibri_imx7.c