IMX Serial Downloader mode detection

Hi,
Currently I'm working on generalizing recovery mode handling, particularly making sure upon recovery mode (U-boot is loaded via Serial Downloader) detection the default U-Boot environment is used rather than the one stored in flash to avoid any bad side-effects.
For the moment we're trying to do that in runtime instead of keeping two binaries of U-boot, where the first one uses default recovery, another one uses env from eMMC/NAND.
For iMX8QM/QX Serial Downloader mode detection is done via MU (which currently exists and workins only in the downstream NXP U-boot fork) communication with SCFW (sc_misc_get_boot_dev() call etc).
However, for MX6/MX7 series there no any unified way to do so, and the only way I saw in the downstream NXP U-boot is using some indirect checks (that don't definetely say that serial download mode was used to upload this instance of running U-boot) are used, like: 1. Reading value of SRC_SBMR1/SRC_SBMR2 2. Checking for the status of USB OTG PHY, if it was enabled before U-boot initialed usb stack (is_usbotg_phy_active() from arch/arm/mach-imx/spl.c NXP U-boot) etc.
The question is: are there any other more proper ways to detect Serial Download mode?
Thanks
-- Best regards - Freundliche GrĂ¼sse - Meilleures salutations
Igor Opaniuk
mailto: igor.opaniuk@gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk
participants (1)
-
Igor Opaniuk