|
#define | USB_CNTR_REG (&MMIO32(USB_DEV_FS_BASE + 0x40)) |
|
#define | USB_ISTR_REG (&MMIO32(USB_DEV_FS_BASE + 0x44)) |
|
#define | USB_FNR_REG (&MMIO32(USB_DEV_FS_BASE + 0x48)) |
|
#define | USB_DADDR_REG (&MMIO32(USB_DEV_FS_BASE + 0x4C)) |
|
#define | USB_BTABLE_REG (&MMIO32(USB_DEV_FS_BASE + 0x50)) |
|
#define | USB_EP_REG(EP) (&MMIO32(USB_DEV_FS_BASE) + (EP)) |
|
#define | USB_CNTR_CTRM 0x8000 |
|
#define | USB_CNTR_PMAOVRM 0x4000 |
|
#define | USB_CNTR_ERRM 0x2000 |
|
#define | USB_CNTR_WKUPM 0x1000 |
|
#define | USB_CNTR_SUSPM 0x0800 |
|
#define | USB_CNTR_RESETM 0x0400 |
|
#define | USB_CNTR_SOFM 0x0200 |
|
#define | USB_CNTR_ESOFM 0x0100 |
|
#define | USB_CNTR_RESUME 0x0010 /* Resume request */ |
|
#define | USB_CNTR_FSUSP 0x0008 /* Force suspend */ |
|
#define | USB_CNTR_LP_MODE 0x0004 /* Low-power mode */ |
|
#define | USB_CNTR_PWDN 0x0002 /* Power down */ |
|
#define | USB_CNTR_FRES 0x0001 /* Force reset */ |
|
#define | USB_ISTR_CTR 0x8000 /* Correct Transfer */ |
|
#define | USB_ISTR_PMAOVR 0x4000 /* Packet Memory Area Over / Underrun */ |
|
#define | USB_ISTR_ERR 0x2000 /* Error */ |
|
#define | USB_ISTR_WKUP 0x1000 /* Wake up */ |
|
#define | USB_ISTR_SUSP 0x0800 /* Suspend mode request */ |
|
#define | USB_ISTR_RESET 0x0400 /* USB RESET request */ |
|
#define | USB_ISTR_SOF 0x0200 /* Start Of Frame */ |
|
#define | USB_ISTR_ESOF 0x0100 /* Expected Start Of Frame */ |
|
#define | USB_ISTR_DIR 0x0010 /* Direction of transaction */ |
|
#define | USB_ISTR_EP_ID 0x000F /* Endpoint Identifier */ |
|
#define | USB_CLR_ISTR_PMAOVR() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_PMAOVR) |
|
#define | USB_CLR_ISTR_ERR() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_ERR) |
|
#define | USB_CLR_ISTR_WKUP() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_WKUP) |
|
#define | USB_CLR_ISTR_SUSP() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_SUSP) |
|
#define | USB_CLR_ISTR_RESET() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_RESET) |
|
#define | USB_CLR_ISTR_SOF() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_SOF) |
|
#define | USB_CLR_ISTR_ESOF() CLR_REG_BIT(USB_ISTR_REG, USB_ISTR_ESOF) |
|
#define | USB_FNR_RXDP (1 << 15) |
|
#define | USB_FNR_RXDM (1 << 14) |
|
#define | USB_FNR_LCK (1 << 13) |
|
#define | USB_FNR_LSOF_SHIFT 11 |
|
#define | USB_FNR_LSOF (3 << USB_FNR_LSOF_SHIFT) |
|
#define | USB_FNR_FN (0x7FF << 0) |
|
#define | USB_DADDR_EF (1 << 7) |
|
#define | USB_DADDR_ADDR 0x007F |
|
#define | USB_BTABLE_BTABLE 0xFFF8 |
|
#define | USB_EP0 0 |
|
#define | USB_EP1 1 |
|
#define | USB_EP2 2 |
|
#define | USB_EP3 3 |
|
#define | USB_EP4 4 |
|
#define | USB_EP5 5 |
|
#define | USB_EP6 6 |
|
#define | USB_EP7 7 |
|
#define | USB_EP_RX_CTR 0x8000 /* Correct transfer RX */ |
|
#define | USB_EP_RX_DTOG 0x4000 /* Data toggle RX */ |
|
#define | USB_EP_RX_STAT 0x3000 /* Endpoint status for RX */ |
|
#define | USB_EP_SETUP 0x0800 /* Setup transaction completed */ |
|
#define | USB_EP_TYPE 0x0600 /* Endpoint type */ |
|
#define | USB_EP_KIND |
|
#define | USB_EP_TX_CTR 0x0080 /* Correct transfer TX */ |
|
#define | USB_EP_TX_DTOG 0x0040 /* Data toggle TX */ |
|
#define | USB_EP_TX_STAT 0x0030 /* Endpoint status for TX */ |
|
#define | USB_EP_ADDR 0x000F /* Endpoint Address */ |
|
#define | USB_EP_NTOGGLE_MSK |
|
#define | USB_EP_RX_STAT_TOG_MSK (USB_EP_RX_STAT | USB_EP_NTOGGLE_MSK) |
|
#define | USB_EP_TX_STAT_TOG_MSK (USB_EP_TX_STAT | USB_EP_NTOGGLE_MSK) |
|
#define | USB_EP_RX_STAT_DISABLED 0x0000 |
|
#define | USB_EP_RX_STAT_STALL 0x1000 |
|
#define | USB_EP_RX_STAT_NAK 0x2000 |
|
#define | USB_EP_RX_STAT_VALID 0x3000 |
|
#define | USB_EP_TX_STAT_DISABLED 0x0000 |
|
#define | USB_EP_TX_STAT_STALL 0x0010 |
|
#define | USB_EP_TX_STAT_NAK 0x0020 |
|
#define | USB_EP_TX_STAT_VALID 0x0030 |
|
#define | USB_EP_TYPE_BULK 0x0000 |
|
#define | USB_EP_TYPE_CONTROL 0x0200 |
|
#define | USB_EP_TYPE_ISO 0x0400 |
|
#define | USB_EP_TYPE_INTERRUPT 0x0600 |
|
#define | USB_SET_EP_RX_STAT(EP, STAT) |
|
#define | USB_SET_EP_TX_STAT(EP, STAT) |
|
#define | USB_CLR_EP_NTOGGLE_BIT_AND_SET(EP, BIT, EXTRA_BITS) |
|
#define | USB_CLR_EP_RX_CTR(EP) USB_CLR_EP_NTOGGLE_BIT_AND_SET(EP, USB_EP_RX_CTR, USB_EP_TX_CTR) |
|
#define | USB_CLR_EP_TX_CTR(EP) USB_CLR_EP_NTOGGLE_BIT_AND_SET(EP, USB_EP_TX_CTR, USB_EP_RX_CTR) |
|
#define | USB_SET_EP_TYPE(EP, TYPE) |
|
#define | USB_SET_EP_KIND(EP) |
|
#define | USB_CLR_EP_KIND(EP) |
|
#define | USB_SET_EP_STAT_OUT(EP) USB_SET_EP_KIND(EP) |
|
#define | USB_CLR_EP_STAT_OUT(EP) USB_CLR_EP_KIND(EP) |
|
#define | USB_SET_EP_ADDR(EP, ADDR) |
|
#define | USB_CLR_EP_TX_DTOG(EP) |
|
#define | USB_CLR_EP_RX_DTOG(EP) |
|
#define | USB_GET_BTABLE GET_REG(USB_BTABLE_REG) |
|
#define | USB_GET_EP_TX_ADDR(EP) GET_REG(USB_EP_TX_ADDR(EP)) |
|
#define | USB_GET_EP_TX_COUNT(EP) GET_REG(USB_EP_TX_COUNT(EP)) |
|
#define | USB_GET_EP_RX_ADDR(EP) GET_REG(USB_EP_RX_ADDR(EP)) |
|
#define | USB_GET_EP_RX_COUNT(EP) GET_REG(USB_EP_RX_COUNT(EP)) |
|
#define | USB_SET_EP_TX_ADDR(EP, ADDR) SET_REG(USB_EP_TX_ADDR(EP), ADDR) |
|
#define | USB_SET_EP_TX_COUNT(EP, COUNT) SET_REG(USB_EP_TX_COUNT(EP), COUNT) |
|
#define | USB_SET_EP_RX_ADDR(EP, ADDR) SET_REG(USB_EP_RX_ADDR(EP), ADDR) |
|
#define | USB_SET_EP_RX_COUNT(EP, COUNT) SET_REG(USB_EP_RX_COUNT(EP), COUNT) |
|