/* * Common registers interface for both CDNS3 and CDNSP version of DRD.
*/ struct cdns_otg_common_regs {
__le32 cmd;
__le32 sts;
__le32 state;
};
/* * Interrupt related registers. This registers are mapped in different * location for CDNSP controller.
*/ struct cdns_otg_irq_regs {
__le32 ien;
__le32 ivect;
};
/* OTGCMD - bitmasks */ /* "Request the bus for Device mode. */ #define OTGCMD_DEV_BUS_REQ BIT(0) /* Request the bus for Host mode */ #define OTGCMD_HOST_BUS_REQ BIT(1) /* Enable OTG mode. */ #define OTGCMD_OTG_EN BIT(2) /* Disable OTG mode */ #define OTGCMD_OTG_DIS BIT(3) /*"Configure OTG as A-Device. */ #define OTGCMD_A_DEV_EN BIT(4) /*"Configure OTG as A-Device. */ #define OTGCMD_A_DEV_DIS BIT(5) /* Drop the bus for Device mod e. */ #define OTGCMD_DEV_BUS_DROP BIT(8) /* Drop the bus for Host mode*/ #define OTGCMD_HOST_BUS_DROP BIT(9) /* Power Down USBSS-DEV - only for CDNS3.*/ #define OTGCMD_DEV_POWER_OFF BIT(11) /* Power Down CDNSXHCI - only for CDNS3. */ #define OTGCMD_HOST_POWER_OFF BIT(12)
/* OTGSTS - bitmasks */ /* * Current value of the ID pin. It is only valid when idpullup in * OTGCTRL1_TYPE register is set to '1'.
*/ #define OTGSTS_ID_VALUE BIT(0) /* Current value of the vbus_valid */ #define OTGSTS_VBUS_VALID BIT(1) /* Current value of the b_sess_vld */ #define OTGSTS_SESSION_VALID BIT(2) /*Device mode is active*/ #define OTGSTS_DEV_ACTIVE BIT(3) /* Host mode is active. */ #define OTGSTS_HOST_ACTIVE BIT(4) /* OTG Controller not ready. */ #define OTGSTS_OTG_NRDY_MASK BIT(11) #define OTGSTS_OTG_NRDY(p) ((p) & OTGSTS_OTG_NRDY_MASK) /* * Value of the strap pins for: * CDNS3: * 000 - no default configuration * 010 - Controller initiall configured as Host * 100 - Controller initially configured as Device * CDNSP: * 000 - No default configuration. * 010 - Controller initiall configured as Host. * 100 - Controller initially configured as Device.
*/ #define OTGSTS_STRAP(p) (((p) & GENMASK(14, 12)) >> 12) #define OTGSTS_STRAP_NO_DEFAULT_CFG 0x00 #define OTGSTS_STRAP_HOST_OTG 0x01 #define OTGSTS_STRAP_HOST 0x02 #define OTGSTS_STRAP_GADGET 0x04 #define OTGSTS_CDNSP_STRAP_HOST 0x01 #define OTGSTS_CDNSP_STRAP_GADGET 0x02
/* Host mode is turned on. */ #define OTGSTS_CDNS3_XHCI_READY BIT(26) #define OTGSTS_CDNSP_XHCI_READY BIT(27)
/* "Device mode is turned on .*/ #define OTGSTS_CDNS3_DEV_READY BIT(27) #define OTGSTS_CDNSP_DEV_READY BIT(26)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.