32#define AVR32_MAX_DEVICES (USB_MIN_DEVICES + 1)
36#define AVR32_CTRL 0x00
37#define AVR32_CTRL_DEV_ADDR 0x7F
38#define AVR32_CTRL_DEV_FADDR_EN 0x80
39#define AVR32_CTRL_DEV_EN_USBA 0x100
40#define AVR32_CTRL_DEV_DETACH 0x200
41#define AVR32_CTRL_DEV_REWAKEUP 0x400
43#define AVR32_FNUM 0x04
44#define AVR32_FNUM_MASK 0x3FFF
45#define AVR32_FRAME_MASK 0x7FF
49#define AVR32_INTSTA 0x14
50#define AVR32_CLRINT 0x18
52#define AVR32_INT_SPEED 0x00000001
53#define AVR32_INT_DET_SUSPD 0x00000002
54#define AVR32_INT_MICRO_SOF 0x00000004
55#define AVR32_INT_INT_SOF 0x00000008
56#define AVR32_INT_ENDRESET 0x00000010
57#define AVR32_INT_WAKE_UP 0x00000020
58#define AVR32_INT_ENDOFRSM 0x00000040
59#define AVR32_INT_UPSTR_RES 0x00000080
60#define AVR32_INT_EPT_INT(n) (0x00000100 << (n))
61#define AVR32_INT_DMA_INT(n) (0x01000000 << (n))
63#define AVR32_EPTRST 0x1C
64#define AVR32_EPTRST_MASK(n) (0x00000001 << (n))
67#define AVR32_TSTSOFCNT 0xD0
68#define AVR32_TSTCNTA 0xD4
69#define AVR32_TSTCNTB 0xD8
70#define AVR32_TSTMODEREG 0xDC
72#define AVR32_TST_NORMAL 0x00000000
73#define AVR32_TST_HS_ONLY 0x00000002
74#define AVR32_TST_FS_ONLY 0x00000003
77#define AVR32_IPPADDRSIZE 0xEC
78#define AVR32_IPNAME1 0xF0
79#define AVR32_IPNAME2 0xF4
80#define AVR32_IPFEATURES 0xF8
81#define AVR32_IPFEATURES_NEP(x) (((x) & 0xF) ? ((x) & 0xF) : 0x10)
83#define AVR32_IPVERSION 0xFC
85#define _A(base,n) ((base) + (0x20*(n)))
86#define AVR32_EPTCFG(n) _A(0x100, n)
87#define AVR32_EPTCFG_EPSIZE(n) ((n)-3)
88#define AVR32_EPTCFG_EPDIR_OUT 0x00000000
89#define AVR32_EPTCFG_EPDIR_IN 0x00000008
90#define AVR32_EPTCFG_TYPE_CTRL 0x00000000
91#define AVR32_EPTCFG_TYPE_ISOC 0x00000100
92#define AVR32_EPTCFG_TYPE_BULK 0x00000200
93#define AVR32_EPTCFG_TYPE_INTR 0x00000300
94#define AVR32_EPTCFG_NBANK(n) (0x00000400*(n))
95#define AVR32_EPTCFG_NB_TRANS(n) (0x00001000*(n))
96#define AVR32_EPTCFG_EPT_MAPD 0x80000000
98#define AVR32_EPTCTLENB(n) _A(0x104, n)
99#define AVR32_EPTCTLDIS(n) _A(0x108, n)
100#define AVR32_EPTCTL(n) _A(0x10C, n)
101#define AVR32_EPTCTL_EPT_ENABL 0x00000001
102#define AVR32_EPTCTL_AUTO_VALID 0x00000002
103#define AVR32_EPTCTL_INTDIS_DMA 0x00000008
104#define AVR32_EPTCTL_NYET_DIS 0x00000010
105#define AVR32_EPTCTL_DATAX_RX 0x00000040
106#define AVR32_EPTCTL_MDATA_RX 0x00000080
107#define AVR32_EPTCTL_ERR_OVFLW 0x00000100
108#define AVR32_EPTCTL_RX_BK_RDY 0x00000200
109#define AVR32_EPTCTL_TX_COMPLT 0x00000400
110#define AVR32_EPTCTL_TX_PK_RDY 0x00000800
111#define AVR32_EPTCTL_RX_SETUP 0x00001000
112#define AVR32_EPTCTL_STALL_SNT 0x00002000
113#define AVR32_EPTCTL_NAK_IN 0x00004000
114#define AVR32_EPTCTL_NAK_OUT 0x00008000
115#define AVR32_EPTCTL_BUSY_BANK 0x00040000
116#define AVR32_EPTCTL_SHORT_PCKT 0x80000000
119#define AVR32_EPTSETSTA(n) _A(0x114, n)
120#define AVR32_EPTCLRSTA(n) _A(0x118, n)
121#define AVR32_EPTSTA(n) _A(0x11C, n)
122#define AVR32_EPTSTA_FRCESTALL 0x00000020
123#define AVR32_EPTSTA_TOGGLESQ_STA(x) (((x) & 0xC0) >> 6)
124#define AVR32_EPTSTA_TOGGLESQ 0x00000040
125#define AVR32_EPTSTA_ERR_OVFLW 0x00000100
126#define AVR32_EPTSTA_RX_BK_RDY 0x00000200
127#define AVR32_EPTSTA_TX_COMPLT 0x00000400
128#define AVR32_EPTSTA_TX_PK_RDY 0x00000800
129#define AVR32_EPTSTA_RX_SETUP 0x00001000
130#define AVR32_EPTSTA_STALL_SNT 0x00002000
131#define AVR32_EPTSTA_NAK_IN 0x00004000
132#define AVR32_EPTSTA_NAK_OUT 0x00008000
133#define AVR32_EPTSTA_CURRENT_BANK(x) (((x) & 0x00030000) >> 16)
134#define AVR32_EPTSTA_BUSY_BANK_STA(x) (((x) & 0x000C0000) >> 18)
135#define AVR32_EPTSTA_BYTE_COUNT(x) (((x) & 0x7FF00000) >> 20)
136#define AVR32_EPTSTA_SHRT_PCKT 0x80000000
139#define AVR32_DMANXTDSC 0x310
140#define AVR32_DMAADDRESS 0x314
142#define AVR32_READ_4(sc, reg) \
143 bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg)
145#define AVR32_WRITE_4(sc, reg, data) \
146 bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data)
148#define AVR32_WRITE_MULTI_4(sc, reg, ptr, len) \
149 bus_space_write_multi_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, ptr, len)
151#define AVR32_READ_MULTI_4(sc, reg, ptr, len) \
152 bus_space_read_multi_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, ptr, len)
157#define AVR32_EP_MAX 7
uint8_t() avr32dci_cmd_t(struct avr32dci_td *td)
struct avr32dci_config_desc __packed
void avr32dci_uninit(struct avr32dci_softc *sc)
#define AVR32_MAX_DEVICES
void avr32dci_vbus_interrupt(struct avr32dci_softc *sc, uint8_t is_on)
usb_error_t avr32dci_init(struct avr32dci_softc *sc)
void avr32dci_interrupt(struct avr32dci_softc *sc)
void() avr32dci_clocks_t(struct usb_bus *)
struct usb_endpoint_descriptor endpd
struct usb_config_descriptor confd
struct usb_interface_descriptor ifcd
avr32dci_clocks_t * sc_clocks_on
bus_space_tag_t sc_io_tag
struct avr32dci_flags sc_flags
bus_space_handle_t sc_io_hdl
struct usb_device * sc_devices[AVR32_MAX_DEVICES]
struct resource * sc_irq_res
avr32dci_clocks_t * sc_clocks_off
struct resource * sc_io_res
union avr32dci_hub_temp sc_hub_temp
struct avr32dci_td * td_next
struct usb_page_cache * pc
struct avr32dci_td * obj_next
struct usb_page_cache * pc
uint8_t support_multi_buffer
struct usb_port_status ps