9
0
Fork 0
barebox/include/usb/ulpi.h

33 lines
1.2 KiB
C

#ifndef __MACH_ULPI_H
#define __MACH_ULPI_H
int ulpi_set(u8 bits, int reg, void __iomem *view);
int ulpi_clear(u8 bits, int reg, void __iomem *view);
int ulpi_read(int reg, void __iomem *view);
int ulpi_setup(void __iomem *view, int on);
/* ULPI register addresses */
#define ULPI_VID_LOW 0x00 /* Vendor ID low */
#define ULPI_VID_HIGH 0x01 /* Vendor ID high */
#define ULPI_PID_LOW 0x02 /* Product ID low */
#define ULPI_PID_HIGH 0x03 /* Product ID high */
#define ULPI_ITFCTL 0x07 /* Interface Control */
#define ULPI_OTGCTL 0x0A /* OTG Control */
/* add to above register address to access Set/Clear functions */
#define ULPI_REG_SET 0x01
#define ULPI_REG_CLEAR 0x02
/* ULPI OTG Control Register bits */
#define USE_EXT_VBUS_IND (1 << 7) /* Use ext. Vbus indicator */
#define DRV_VBUS_EXT (1 << 6) /* Drive Vbus external */
#define DRV_VBUS (1 << 5) /* Drive Vbus */
#define CHRG_VBUS (1 << 4) /* Charge Vbus */
#define DISCHRG_VBUS (1 << 3) /* Discharge Vbus */
#define DM_PULL_DOWN (1 << 2) /* enable DM Pull Down */
#define DP_PULL_DOWN (1 << 1) /* enable DP Pull Down */
#define ID_PULL_UP (1 << 0) /* enable ID Pull Up */
#endif /* __MACH_ULPI_H */