diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2017-08-08 18:08:22 -0700 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2017-08-31 19:57:38 -0700 |
commit | 0d069117614b590848b490e348488362443c5547 (patch) | |
tree | 819cda94fdf69073f0da75800288a80662f9ac55 /arch | |
parent | a2e77a650a496e2be0b1630b874f531e9f394d47 (diff) |
imx: add macro to detect whether USB has been initialized
This macro allows to detect whether the boot ROM initialized USB
already (serial downloader). This is helpful to reliably detect
if the system has been recovered via USB serial downloader.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/arch-mx6/imx-regs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 8bb36eb9de9..4b8d27371f2 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -960,5 +960,12 @@ struct pwm_regs { u32 pr; u32 cnr; }; + +/* + * If ROM fail back to USB recover mode, USBPH0_PWD will be clear to use USB + * If boot from the other mode, USB0_PWD will keep reset value + */ +#define is_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20))) + #endif /* __ASSEMBLER__*/ #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */ |