From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Nyekjaer Date: Tue, 24 Apr 2018 14:05:54 +0200 Subject: [U-Boot] [PATCH] imx: mx6: add is_boot_from_usb define Message-ID: <20180424120554.18747-1-sean.nyekjaer@prevas.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This enables us to detect if the i.MX6 SoC is booting from USB. Signed-off-by: Sean Nyekjaer --- arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 095eb74195..10da611968 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -998,4 +998,11 @@ struct pwm_regs { u32 cnr; }; #endif /* __ASSEMBLER__*/ + +/* + * 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 /* __ASM_ARCH_MX6_IMX_REGS_H__ */ -- 2.17.0