diff options
author | Tom Rini <trini@konsulko.com> | 2018-04-15 08:43:50 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-04-15 08:43:50 -0400 |
commit | ebca902aeb3af3eaedd2787928184ad84a86b98f (patch) | |
tree | 20081e5c2cff3760d1ece3602823a3e3ff6d47d0 /arch/arm/mach-imx/spl.c | |
parent | df13a44377b36f438d15de06b07ad4645b89cf4f (diff) | |
parent | b4e9bdcd05ac83146ad16802a94db3e78f530d1a (diff) |
Merge git://git.denx.de/u-boot-imx
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/mach-imx/spl.c')
-rw-r--r-- | arch/arm/mach-imx/spl.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index b2521b2101..6fc24630ba 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -101,6 +101,29 @@ u32 spl_boot_device(void) /* Translate iMX7/MX8M boot device to the SPL boot device enumeration */ u32 spl_boot_device(void) { +#if defined(CONFIG_MX7) + unsigned int bmode = readl(&src_base->sbmr2); + + /* + * Check for BMODE if serial downloader is enabled + * BOOT_MODE - see IMX7DRM Table 6-24 + */ + if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */ + return BOOT_DEVICE_BOARD; + + /* + * The above method does not detect that the boot ROM used + * serial downloader in case the boot ROM decided to use the + * serial downloader as a fall back (primary boot source failed). + * + * Infer that the boot ROM used the USB serial downloader by + * checking whether the USB PHY is currently active... This + * assumes that SPL did not (yet) initialize the USB PHY... + */ + if (is_boot_from_usb()) + return BOOT_DEVICE_BOARD; +#endif + enum boot_device boot_device_spl = get_boot_device(); switch (boot_device_spl) { |