Skip to content
Snippets Groups Projects
Commit 7d289d62 authored by Stefan Agner's avatar Stefan Agner Committed by Stefano Babic
Browse files

imx: add macro to detect whether USB PHY is active

This macro allows to detect whether the USB PHY is active. This
is helpful to detect if the boot ROM has previously started the
USB serial downloader.

The idea is taken from the mfgtool support in the NXP U-Boot:
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/?h=imx_v2016.03_4.1.15_2.0.0_ga&id=a352ed3c5184b95c4c9f7468f5fbb5f43de5e412



Signed-off-by: default avatarStefan Agner <stefan.agner@toradex.com>
Acked-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: default avatarEric Nelson <eric@nelint.com>
parent 08cebeea
No related branches found
No related tags found
No related merge requests found
......@@ -6,3 +6,10 @@
*/
#include <asm/mach-imx/sys_proto.h>
#define USBPHY_PWD 0x00000000
#define USBPHY_PWD_RXPWDRX (1 << 20) /* receiver block power down */
#define is_usbotg_phy_active(void) (!(readl(USB_PHY0_BASE_ADDR + USBPHY_PWD) & \
USBPHY_PWD_RXPWDRX))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment