summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/usb-drv-as3525v2.h
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2010-06-19 20:39:57 +0000
committerAmaury Pouly <pamaury@rockbox.org>2010-06-19 20:39:57 +0000
commit19b3348656c305f8550b99c3368f9404ca913f94 (patch)
treefc85bc3ff82510d4fff86a88fa25216cef834596 /firmware/target/arm/as3525/usb-drv-as3525v2.h
parentf9242c06d01b6fe4532cb5511b1470046df5650b (diff)
downloadrockbox-19b3348656c305f8550b99c3368f9404ca913f94.tar.gz
rockbox-19b3348656c305f8550b99c3368f9404ca913f94.zip
as3525v2-usb: major code renaming
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26971 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/usb-drv-as3525v2.h')
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525v2.h564
1 files changed, 308 insertions, 256 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.h b/firmware/target/arm/as3525/usb-drv-as3525v2.h
index 23be1c5b49..96b13f2028 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525v2.h
+++ b/firmware/target/arm/as3525/usb-drv-as3525v2.h
@@ -23,254 +23,306 @@
23 23
24#include "as3525v2.h" 24#include "as3525v2.h"
25 25
26/* All multi-bit fields in the driver use the following convention.
27 * If the register name is NAME, then there is one define NAME_bit_pos
28 * which holds the bit position and one define NAME_bits which holds
29 * a mask of the bits within the register.
30 * These macros allow easy access and construction of such fields */
31/* Usage:
32 * - extract(reg_name,field_name)
33 note: the field_name must not be prefix with the reg name */
34#define extract(reg_name, field_name) \
35 ((reg_name & reg_name##_##field_name##_bits) >> reg_name##_##field_name##_bit_pos)
36
26#define USB_DEVICE (USB_BASE + 0x0800) /** USB Device base address */ 37#define USB_DEVICE (USB_BASE + 0x0800) /** USB Device base address */
27 38
28/** 39/**
29 * Core Global Registers 40 * Core Global Registers
30 */ 41 */
31#define USB_BASE_REG(offset) (*(volatile unsigned long *)(USB_BASE + offset)) 42#define BASE_REG(offset) (*(volatile unsigned long *)(USB_BASE + offset))
32 43
33#define USB_GOTGCTL USB_BASE_REG(0x000) /** OTG Control and Status Register */ 44/** OTG Control and Status Register */
34#define USB_GOTGINT USB_BASE_REG(0x004) /** OTG Interrupt Register */ 45#define GOTGCTL BASE_REG(0x000)
35#define USB_GAHBCFG USB_BASE_REG(0x008) /** Core AHB Configuration Register */ 46
36#define USB_GUSBCFG USB_BASE_REG(0x00C) /** Core USB Configuration Register */ 47/** OTG Interrupt Register */
37#define USB_GRSTCTL USB_BASE_REG(0x010) /** Core Reset Register */ 48#define GOTGINT BASE_REG(0x004)
38#define USB_GINTSTS USB_BASE_REG(0x014) /** Core Interrupt Register */ 49
39#define USB_GINTMSK USB_BASE_REG(0x018) /** Core Interrupt Mask Register */ 50/** Core AHB Configuration Register */
40#define USB_GRXSTSR USB_BASE_REG(0x01C) /** Receive Status Debug Read Register (Read Only) */ 51#define GAHBCFG BASE_REG(0x008)
41#define USB_GRXSTSP USB_BASE_REG(0x020) /** Receive Status Read /Pop Register (Read Only) */ 52#define GAHBCFG_glblintrmsk (1 << 0) /** Global interrupt mask */
42#define USB_GRXFSIZ USB_BASE_REG(0x024) /** Receive FIFO Size Register */ 53#define GAHBCFG_hburstlen_bit_pos 1
43#define USB_GNPTXFSIZ USB_BASE_REG(0x028) /** Periodic Transmit FIFO Size Register */ 54#define GAHBCFG_INT_DMA_BURST_SINGLE 0
44#define USB_GNPTXSTS USB_BASE_REG(0x02C) /** Non-Periodic Transmit FIFO/Queue Status Register */ 55#define GAHBCFG_INT_DMA_BURST_INCR 1 /** note: the linux patch has several other value, this is one picked for internal dma */
45#define USB_GI2CCTL USB_BASE_REG(0x030) /** I2C Access Register */ 56#define GAHBCFG_INT_DMA_BURST_INCR4 3
46#define USB_GPVNDCTL USB_BASE_REG(0x034) /** PHY Vendor Control Register */ 57#define GAHBCFG_INT_DMA_BURST_INCR8 5
47#define USB_GGPIO USB_BASE_REG(0x038) /** General Purpose Input/Output Register */ 58#define GAHBCFG_INT_DMA_BURST_INCR16 7
48#define USB_GUID USB_BASE_REG(0x03C) /** User ID Register */ 59#define GAHBCFG_dma_enable (1 << 5) /** Enable DMA */
49#define USB_GSNPSID USB_BASE_REG(0x040) /** Synopsys ID Register */ 60
50#define USB_GHWCFG1 USB_BASE_REG(0x044) /** User HW Config1 Register */ 61/** Core USB Configuration Register */
51#define USB_GHWCFG2 USB_BASE_REG(0x048) /** User HW Config2 Register */ 62#define GUSBCFG BASE_REG(0x00C)
52#define USB_GHWCFG3 USB_BASE_REG(0x04C) /** User HW Config3 Register */ 63#define GUSBCFG_toutcal_bit_pos 0
53#define USB_GHWCFG4 USB_BASE_REG(0x050) /** User HW Config4 Register */ 64#define GUSBCFG_toutcal_bits (0x7 << GUSBCFG_toutcal_bit_pos)
65#define GUSBCFG_phy_if (1 << 3) /** select utmi bus width ? */
66#define GUSBCFG_ulpi_utmi_sel (1 << 4) /** select ulpi:1 or utmi:0 */
67#define GUSBCFG_fsintf (1 << 5)
68#define GUSBCFG_physel (1 << 6)
69#define GUSBCFG_ddrsel (1 << 7)
70#define GUSBCFG_srpcap (1 << 8)
71#define GUSBCFG_hnpcapp (1 << 9)
72#define GUSBCFG_usbtrdtim_bit_pos 10
73#define GUSBCFG_usbtrdtim_bits (0xf << GUSBCFG_usbtrdtim_bit_pos)
74#define GUSBCFG_nptxfrwnden (1 << 14)
75#define GUSBCFG_phylpwrclksel (1 << 15)
76#define GUSBCFG_otgutmifssel (1 << 16)
77#define GUSBCFG_ulpi_fsls (1 << 17)
78#define GUSBCFG_ulpi_auto_res (1 << 18)
79#define GUSBCFG_ulpi_clk_sus_m (1 << 19)
80#define GUSBCFG_ulpi_ext_vbus_drv (1 << 20)
81#define GUSBCFG_ulpi_int_vbus_indicator (1 << 21)
82#define GUSBCFG_term_sel_dl_pulse (1 << 22)
83#define GUSBCFG_force_host_mode (1 << 29)
84#define GUSBCFG_force_device_mode (1 << 30)
85#define GUSBCFG_corrupt_tx_packet (1 << 31)
86
87/** Core Reset Register */
88#define GRSTCTL BASE_REG(0x010)
89#define GRSTCTL_csftrst (1 << 0) /** Core soft reset */
90#define GRSTCTL_hsftrst (1 << 1) /** Hclk soft reset */
91#define GRSTCTL_intknqflsh (1 << 3) /** In Token Sequence Learning Queue Flush */
92#define GRSTCTL_rxfflsh_flush (1 << 4) /** RxFIFO Flush */
93#define GRSTCTL_txfflsh_flush (1 << 5) /** TxFIFO Flush */
94#define GRSTCTL_txfnum_bit_pos 6 /** TxFIFO Number */
95#define GRSTCTL_txfnum_bits (0x1f << 6)
96#define GRSTCTL_ahbidle (1 << 31) /** AHB idle state*/
97
98/** Core Interrupt Register */
99#define GINTSTS BASE_REG(0x014)
100/* NOTE: GINTSTS bits are the same as in GINTMSK plus this one */
101#define GINTSTS_curmode (1 << 0) /** Current mode, 0 for device */
102
103/** Core Interrupt Mask Register */
104#define GINTMSK BASE_REG(0x018)
105#define GINTMSK_modemismatch (1 << 1) /** mode mismatch ? */
106#define GINTMSK_otgintr (1 << 2)
107#define GINTMSK_sofintr (1 << 3)
108#define GINTMSK_rxstsqlvl (1 << 4)
109#define GINTMSK_nptxfempty (1 << 5) /** Non-periodic TX fifo empty ? */
110#define GINTMSK_ginnakeff (1 << 6)
111#define GINTMSK_goutnakeff (1 << 7)
112#define GINTMSK_i2cintr (1 << 9)
113#define GINTMSK_erlysuspend (1 << 10)
114#define GINTMSK_usbsuspend (1 << 11) /** USB suspend */
115#define GINTMSK_usbreset (1 << 12) /** USB reset */
116#define GINTMSK_enumdone (1 << 13) /** Enumeration done */
117#define GINTMSK_isooutdrop (1 << 14)
118#define GINTMSK_eopframe (1 << 15)
119#define GINTMSK_epmismatch (1 << 17) /** endpoint mismatch ? */
120#define GINTMSK_inepintr (1 << 18) /** in pending ? */
121#define GINTMSK_outepintr (1 << 19) /** out pending ? */
122#define GINTMSK_incomplisoin (1 << 20) /** ISP in complete ? */
123#define GINTMSK_incomplisoout (1 << 21) /** ISO out complete ? */
124#define GINTMSK_portintr (1 << 24) /** Port status change ? */
125#define GINTMSK_hcintr (1 << 25)
126#define GINTMSK_ptxfempty (1 << 26) /** Periodic TX fifof empty ? */
127#define GINTMSK_conidstschng (1 << 28)
128#define GINTMSK_disconnect (1 << 29) /** Disconnect */
129#define GINTMSK_sessreqintr (1 << 30) /** Session request */
130#define GINTMSK_wkupintr (1 << 31) /** Wake up */
131
132/** Receive Status Debug Read Register (Read Only) */
133#define GRXSTSR BASE_REG(0x01C)
134
135/** Receive Status Read /Pop Register (Read Only) */
136#define GRXSTSP BASE_REG(0x020)
137
138/** Receive FIFO Size Register */
139#define GRXFSIZ BASE_REG(0x024)
140
141/** Periodic Transmit FIFO Size Register */
142#define GNPTXFSIZ BASE_REG(0x028)
143
144/** Non-Periodic Transmit FIFO/Queue Status Register */
145#define GNPTXSTS BASE_REG(0x02C)
146
147/** I2C Access Register */
148#define GI2CCTL BASE_REG(0x030)
149
150/** PHY Vendor Control Register */
151#define GPVNDCTL BASE_REG(0x034)
152
153/** General Purpose Input/Output Register */
154#define GGPIO BASE_REG(0x038)
155
156/** User ID Register */
157#define GUID BASE_REG(0x03C)
158
159/** Synopsys ID Register */
160#define GSNPSID BASE_REG(0x040)
161
162/** User HW Config1 Register */
163#define GHWCFG1 BASE_REG(0x044)
164#define GHWCFG1_IN_EP(ep) (1 << (2 * (ep))) /** 1 if EP(ep) has in cap */
165#define GHWCFG1_OUT_EP(ep) (1 << (1 + 2 * (ep))) /** same for out */
166
167/** User HW Config2 Register */
168#define GHWCFG2 BASE_REG(0x048)
169#define GHWCFG2_ARCH_bit_pos 3 /** Architecture */
170#define GHWCFG2_ARCH_bits (0x3 << GHWCFG2_ARCH_bit_pos)
171#define GHWCFG2_HS_PHY_TYPE_bit_pos 6 /** High speed PHY type */
172#define GHWCFG2_HS_PHY_TYPE_bits (0x3 << GHWCFG2_HS_PHY_TYPE_bit_pos)
173#define GHWCFG2_FS_PHY_TYPE_bit_pos 8 /** Full speed PHY type */
174#define GHWCFG2_FS_PHY_TYPE_bits (0x3 << GHWCFG2_FS_PHY_TYPE_bit_pos)
175#define GHWCFG2_NUM_EP_bit_pos 10 /** Number of endpoints */
176#define GHWCFG2_NUM_EP_bits (0xf << GHWCFG2_NUM_EP_bit_pos)
177#define GHWCFG2_DYN_FIFO (1 << 19) /** Dynamic FIFO */
178/* For GHWCFG2_HS_PHY_TYPE and GHWCFG2_SS_PHY_TYPE */
179#define PHY_TYPE_UNSUPPORTED 0
180#define PHY_TYPE_UTMI 1
181#define INT_DMA_ARCH 2
182
183/** User HW Config3 Register */
184#define GHWCFG3 BASE_REG(0x04C)
185
186/** User HW Config4 Register */
187#define GHWCFG4 BASE_REG(0x050)
54 188
55/* 1<=ep<=15, don't use ep=0 !!! */ 189/* 1<=ep<=15, don't use ep=0 !!! */
56/** Device IN Endpoint Transmit FIFO (ep) Size Register */ 190/** Device IN Endpoint Transmit FIFO (ep) Size Register */
57#define USB_DIEPTXFSIZ(ep) USB_BASE_REG(0x100 + 4 * (ep)) 191#define DIEPTXFSIZ(ep) BASE_REG(0x100 + 4 * (ep))
58 192
59/** Build the content of a FIFO size register like USB_DIEPTXFSIZ(i) and USB_GNPTXFSIZ*/ 193/** Build the content of a FIFO size register like DIEPTXFSIZ(i) and GNPTXFSIZ*/
60#define USB_MAKE_FIFOSIZE_DATA(startadr, depth) \ 194#define MAKE_FIFOSIZE_DATA(startadr, depth) \
61 (((startadr) & 0xffff) | ((depth) << 16)) 195 (((startadr) & 0xffff) | ((depth) << 16))
62
63/** Retrieve fifo size for such registers */ 196/** Retrieve fifo size for such registers */
64#define USB_GET_FIFOSIZE_DEPTH(data) \ 197#define GET_FIFOSIZE_DEPTH(data) \
65 ((data) >> 16) 198 ((data) >> 16)
66
67/** Retrieve fifo start address for such registers */ 199/** Retrieve fifo start address for such registers */
68#define USB_GET_FIFOSIZE_START_ADR(data) \ 200#define GET_FIFOSIZE_START_ADR(data) \
69 ((data) & 0xffff) 201 ((data) & 0xffff)
70 202
71#define USB_GRSTCTL_csftrst (1 << 0) /** Core soft reset */ 203
72#define USB_GRSTCTL_hsftrst (1 << 1) /** Hclk soft reset */ 204
73#define USB_GRSTCTL_intknqflsh (1 << 3) /** In Token Sequence Learning Queue Flush */ 205
74#define USB_GRSTCTL_rxfflsh_flush (1 << 4) /** RxFIFO Flush */ 206
75#define USB_GRSTCTL_txfflsh_flush (1 << 5) /** TxFIFO Flush */ 207#define GHWCFG3_DFIFO_LEN (GHWCFG3 >> 16) /** Total fifo size */
76#define USB_GRSTCTL_txfnum_bit_pos 6 /** TxFIFO Number */ 208
77#define USB_GRSTCTL_txfnum_bits (0x1f << 6) 209#define GHWCFG4_UTMI_PHY_DATA_WIDTH ((GHWCFG4 >> 14) & 0x3) /** UTMI+ data bus width (format is unsure) */
78#define USB_GRSTCTL_ahbidle (1 << 31) /** AHB idle state*/ 210#define GHWCFG4_DED_FIFO_EN ((GHWCFG4 >> 25) & 0x1) /** Dedicated Tx FIFOs */
79 211#define GHWCFG4_NUM_IN_EP ((GHWCFG4 >> 26) & 0xf) /** Number of IN endpoints */
80#define USB_GHWCFG1_IN_EP(ep) ((USB_GHWCFG1 >> ((ep) *2)) & 0x1) /** 1 if EP(ep) has in cap */ 212
81#define USB_GHWCFG1_OUT_EP(ep) ((USB_GHWCFG1 >> ((ep) *2 + 1)) & 0x1)/** 1 if EP(ep) has out cap */ 213
82
83#define USB_GHWCFG2_ARCH ((USB_GHWCFG2 >> 3) & 0x3) /** Architecture */
84#define USB_GHWCFG2_HS_PHY_TYPE ((USB_GHWCFG2 >> 6) & 0x3) /** High speed PHY type */
85#define USB_GHWCFG2_FS_PHY_TYPE ((USB_GHWCFG2 >> 8) & 0x3) /** Full speed PHY type */
86#define USB_GHWCFG2_NUM_EP ((USB_GHWCFG2 >> 10) & 0xf) /** Number of endpoints */
87#define USB_GHWCFG2_DYN_FIFO ((USB_GHWCFG2 >> 19) & 0x1) /** Dynamic FIFO */
88
89/* For USB_GHWCFG2_HS_PHY_TYPE and USB_GHWCFG2_SS_PHY_TYPE */
90#define USB_PHY_TYPE_UNSUPPORTED 0
91#define USB_PHY_TYPE_UTMI 1
92#define USB_INT_DMA_ARCH 2
93
94#define USB_GHWCFG3_DFIFO_LEN (USB_GHWCFG3 >> 16) /** Total fifo size */
95
96#define USB_GHWCFG4_UTMI_PHY_DATA_WIDTH ((USB_GHWCFG4 >> 14) & 0x3) /** UTMI+ data bus width (format is unsure) */
97#define USB_GHWCFG4_DED_FIFO_EN ((USB_GHWCFG4 >> 25) & 0x1) /** Dedicated Tx FIFOs */
98#define USB_GHWCFG4_NUM_IN_EP ((USB_GHWCFG4 >> 26) & 0xf) /** Number of IN endpoints */
99
100#define USB_GUSBCFG_toutcal_bit_pos 0
101#define USB_GUSBCFG_toutcal_bits (0x7 << USB_GUSBCFG_toutcal_bit_pos)
102#define USB_GUSBCFG_phy_if (1 << 3) /** select utmi bus width ? */
103#define USB_GUSBCFG_ulpi_utmi_sel (1 << 4) /** select ulpi:1 or utmi:0 */
104#define USB_GUSBCFG_fsintf (1 << 5)
105#define USB_GUSBCFG_physel (1 << 6)
106#define USB_GUSBCFG_ddrsel (1 << 7)
107#define USB_GUSBCFG_srpcap (1 << 8)
108#define USB_GUSBCFG_hnpcapp (1 << 9)
109#define USB_GUSBCFG_usbtrdtim_bit_pos 10
110#define USB_GUSBCFG_usbtrdtim_bits (0xf << USB_GUSBCFG_usbtrdtim_bit_pos)
111#define USB_GUSBCFG_nptxfrwnden (1 << 14)
112#define USB_GUSBCFG_phylpwrclksel (1 << 15)
113#define USB_GUSBCFG_otgutmifssel (1 << 16)
114#define USB_GUSBCFG_ulpi_fsls (1 << 17)
115#define USB_GUSBCFG_ulpi_auto_res (1 << 18)
116#define USB_GUSBCFG_ulpi_clk_sus_m (1 << 19)
117#define USB_GUSBCFG_ulpi_ext_vbus_drv (1 << 20)
118#define USB_GUSBCFG_ulpi_int_vbus_indicator (1 << 21)
119#define USB_GUSBCFG_term_sel_dl_pulse (1 << 22)
120#define USB_GUSBCFG_force_host_mode (1 << 29)
121#define USB_GUSBCFG_force_device_mode (1 << 30)
122#define USB_GUSBCFG_corrupt_tx_packet (1 << 31)
123
124#define USB_GAHBCFG_glblintrmsk (1 << 0) /** Global interrupt mask */
125#define USB_GAHBCFG_hburstlen_bit_pos 1
126#define USB_GAHBCFG_INT_DMA_BURST_SINGLE 0
127#define USB_GAHBCFG_INT_DMA_BURST_INCR 1 /** note: the linux patch has several other value, this is one picked for internal dma */
128#define USB_GAHBCFG_INT_DMA_BURST_INCR4 3
129#define USB_GAHBCFG_INT_DMA_BURST_INCR8 5
130#define USB_GAHBCFG_INT_DMA_BURST_INCR16 7
131#define USB_GAHBCFG_dma_enable (1 << 5) /** Enable DMA */
132
133/* NOTE: USB_GINTSTS bits are the same as in USB_GINTMSK plus the following one */
134#define USB_GINTSTS_curmode (1 << 0) /** Current mode: 1 for host, 0 for device */
135
136#define USB_GINTMSK_modemismatch (1 << 1) /** mode mismatch ? */
137#define USB_GINTMSK_otgintr (1 << 2)
138#define USB_GINTMSK_sofintr (1 << 3)
139#define USB_GINTMSK_rxstsqlvl (1 << 4)
140#define USB_GINTMSK_nptxfempty (1 << 5) /** Non-periodic TX fifo empty ? */
141#define USB_GINTMSK_ginnakeff (1 << 6)
142#define USB_GINTMSK_goutnakeff (1 << 7)
143#define USB_GINTMSK_i2cintr (1 << 9)
144#define USB_GINTMSK_erlysuspend (1 << 10)
145#define USB_GINTMSK_usbsuspend (1 << 11) /** USB suspend */
146#define USB_GINTMSK_usbreset (1 << 12) /** USB reset */
147#define USB_GINTMSK_enumdone (1 << 13) /** Enumeration done */
148#define USB_GINTMSK_isooutdrop (1 << 14)
149#define USB_GINTMSK_eopframe (1 << 15)
150#define USB_GINTMSK_epmismatch (1 << 17) /** endpoint mismatch ? */
151#define USB_GINTMSK_inepintr (1 << 18) /** in pending ? */
152#define USB_GINTMSK_outepintr (1 << 19) /** out pending ? */
153#define USB_GINTMSK_incomplisoin (1 << 20) /** ISP in complete ? */
154#define USB_GINTMSK_incomplisoout (1 << 21) /** ISO out complete ? */
155#define USB_GINTMSK_portintr (1 << 24) /** Port status change ? */
156#define USB_GINTMSK_hcintr (1 << 25)
157#define USB_GINTMSK_ptxfempty (1 << 26) /** Periodic TX fifof empty ? */
158#define USB_GINTMSK_conidstschng (1 << 28)
159#define USB_GINTMSK_disconnect (1 << 29) /** Disconnect */
160#define USB_GINTMSK_sessreqintr (1 << 30) /** Session request */
161#define USB_GINTMSK_wkupintr (1 << 31) /** Wake up */
162 214
163/** 215/**
164 * Device Registers Base Addresses 216 * Device Registers Base Addresses
165 */ 217 */
166#define USB_DEV_REG(offset) (*(volatile unsigned long *)(USB_DEVICE + offset)) 218#define DEV_REG(offset) (*(volatile unsigned long *)(USB_DEVICE + offset))
167 219
168#define USB_DCFG USB_DEV_REG(0x00) /** Device Configuration Register */ 220#define DCFG DEV_REG(0x00) /** Device Configuration Register */
169#define USB_DCTL USB_DEV_REG(0x04) /** Device Control Register */ 221#define DCTL DEV_REG(0x04) /** Device Control Register */
170#define USB_DSTS USB_DEV_REG(0x08) /** Device Status Register */ 222#define DSTS DEV_REG(0x08) /** Device Status Register */
171#define USB_DIEPMSK USB_DEV_REG(0x10) /** Device IN Endpoint Common Interrupt Mask Register */ 223#define DIEPMSK DEV_REG(0x10) /** Device IN Endpoint Common Interrupt Mask Register */
172#define USB_DOEPMSK USB_DEV_REG(0x14) /** Device OUT Endpoint Common Interrupt Mask Register */ 224#define DOEPMSK DEV_REG(0x14) /** Device OUT Endpoint Common Interrupt Mask Register */
173#define USB_DAINT USB_DEV_REG(0x18) /** Device All Endpoints Interrupt Register */ 225#define DAINT DEV_REG(0x18) /** Device All Endpoints Interrupt Register */
174#define USB_DAINTMSK USB_DEV_REG(0x1C) /** Device Endpoints Interrupt Mask Register */ 226#define DAINTMSK DEV_REG(0x1C) /** Device Endpoints Interrupt Mask Register */
175#define USB_DTKNQR1 USB_DEV_REG(0x20) /** Device IN Token Sequence Learning Queue Read Register 1 */ 227#define DTKNQR1 DEV_REG(0x20) /** Device IN Token Sequence Learning Queue Read Register 1 */
176#define USB_DTKNQR2 USB_DEV_REG(0x24) /** Device IN Token Sequence Learning Queue Register 2 */ 228#define DTKNQR2 DEV_REG(0x24) /** Device IN Token Sequence Learning Queue Register 2 */
177#define USB_DTKNQP USB_DEV_REG(0x28) /** Device IN Token Queue Pop register */ 229#define DTKNQP DEV_REG(0x28) /** Device IN Token Queue Pop register */
178/* fixme: those registers are not present in usb_registers.h but are in dwc_otgh_regs.h. 230/* fixme: those registers are not present in registers.h but are in dwc_otgh_regs.h.
179 * the previous registers exists but has a different name :( */ 231 * the previous registers exists but has a different name :( */
180#define USB_DVBUSDIS USB_DEV_REG(0x28) /** Device VBUS discharge register*/ 232#define DVBUSDIS DEV_REG(0x28) /** Device VBUS discharge register*/
181#define USB_DVBUSPULSE USB_DEV_REG(0x2C) /** Device VBUS pulse register */ 233#define DVBUSPULSE DEV_REG(0x2C) /** Device VBUS pulse register */
182#define USB_DTKNQR3 USB_DEV_REG(0x30) /** Device IN Token Queue Read Register 3 (RO) */ 234#define DTKNQR3 DEV_REG(0x30) /** Device IN Token Queue Read Register 3 (RO) */
183#define USB_DTHRCTL USB_DEV_REG(0x30) /** Device Thresholding control register */ 235#define DTHRCTL DEV_REG(0x30) /** Device Thresholding control register */
184#define USB_DTKNQR4 USB_DEV_REG(0x34) /** Device IN Token Queue Read Register 4 (RO) */ 236#define DTKNQR4 DEV_REG(0x34) /** Device IN Token Queue Read Register 4 (RO) */
185#define USB_FFEMPTYMSK USB_DEV_REG(0x34) /** Device IN EPs empty Inr. Mask Register */ 237#define FFEMPTYMSK DEV_REG(0x34) /** Device IN EPs empty Inr. Mask Register */
186 238
187#define USB_DCTL_rmtwkupsig (1 << 0) /** Remote Wakeup */ 239#define DCTL_rmtwkupsig (1 << 0) /** Remote Wakeup */
188#define USB_DCTL_sftdiscon (1 << 1) /** Soft Disconnect */ 240#define DCTL_sftdiscon (1 << 1) /** Soft Disconnect */
189#define USB_DCTL_gnpinnaksts (1 << 2) /** Global Non-Periodic IN NAK Status */ 241#define DCTL_gnpinnaksts (1 << 2) /** Global Non-Periodic IN NAK Status */
190#define USB_DCTL_goutnaksts (1 << 3) /** Global OUT NAK Status */ 242#define DCTL_goutnaksts (1 << 3) /** Global OUT NAK Status */
191#define USB_DCTL_tstctl_bit_pos 4 /** Test Control */ 243#define DCTL_tstctl_bit_pos 4 /** Test Control */
192#define USB_DCTL_tstctl_bits (0x7 << USB_DCTL_tstctl_bit_pos) 244#define DCTL_tstctl_bits (0x7 << DCTL_tstctl_bit_pos)
193#define USB_DCTL_sgnpinnak (1 << 7) /** Set Global Non-Periodic IN NAK */ 245#define DCTL_sgnpinnak (1 << 7) /** Set Global Non-Periodic IN NAK */
194#define USB_DCTL_cgnpinnak (1 << 8) /** Clear Global Non-Periodic IN NAK */ 246#define DCTL_cgnpinnak (1 << 8) /** Clear Global Non-Periodic IN NAK */
195#define USB_DCTL_sgoutnak (1 << 9) /** Set Global OUT NAK */ 247#define DCTL_sgoutnak (1 << 9) /** Set Global OUT NAK */
196#define USB_DCTL_cgoutnak (1 << 10) /** Clear Global OUT NAK */ 248#define DCTL_cgoutnak (1 << 10) /** Clear Global OUT NAK */
197/* "documented" in usb_constants.h only */ 249/* "documented" in constants.h only */
198#define USB_DCTL_pwronprgdone (1 << 11) /** Power on Program Done ? */ 250#define DCTL_pwronprgdone (1 << 11) /** Power on Program Done ? */
199 251
200#define USB_DCFG_devspd_bits 0x3 /** Device Speed */ 252#define DCFG_devspd_bits 0x3 /** Device Speed */
201#define USB_DCFG_devspd_hs_phy_hs 0 /** High speed PHY running at high speed */ 253#define DCFG_devspd_hs_phy_hs 0 /** High speed PHY running at high speed */
202#define USB_DCFG_devspd_hs_phy_fs 1 /** High speed PHY running at full speed */ 254#define DCFG_devspd_hs_phy_fs 1 /** High speed PHY running at full speed */
203#define USB_DCFG_nzstsouthshk (1 << 2) /** Non Zero Length Status OUT Handshake */ 255#define DCFG_nzstsouthshk (1 << 2) /** Non Zero Length Status OUT Handshake */
204#define USB_DCFG_devadr_bit_pos 4 /** Device Address */ 256#define DCFG_devadr_bit_pos 4 /** Device Address */
205#define USB_DCFG_devadr_bits (0x7f << USB_DCFG_devadr_bit_pos) 257#define DCFG_devadr_bits (0x7f << DCFG_devadr_bit_pos)
206#define USB_DCFG_perfrint_bit_pos 11 /** Periodic Frame Interval */ 258#define DCFG_perfrint_bit_pos 11 /** Periodic Frame Interval */
207#define USB_DCFG_perfrint_bits (0x3 << USB_DCFG_perfrint_bit_pos) 259#define DCFG_perfrint_bits (0x3 << DCFG_perfrint_bit_pos)
208#define USB_DCFG_FRAME_INTERVAL_80 0 260#define DCFG_FRAME_INTERVAL_80 0
209#define USB_DCFG_FRAME_INTERVAL_85 1 261#define DCFG_FRAME_INTERVAL_85 1
210#define USB_DCFG_FRAME_INTERVAL_90 2 262#define DCFG_FRAME_INTERVAL_90 2
211#define USB_DCFG_FRAME_INTERVAL_95 3 263#define DCFG_FRAME_INTERVAL_95 3
212 264
213#define USB_DSTS_suspsts (1 << 0) /** Suspend status */ 265#define DSTS_suspsts (1 << 0) /** Suspend status */
214#define USB_DSTS_enumspd_bit_pos 1 /** Enumerated speed */ 266#define DSTS_enumspd_bit_pos 1 /** Enumerated speed */
215#define USB_DSTS_enumspd_bits (0x3 << USB_DSTS_enumspd_bit_pos) 267#define DSTS_enumspd_bits (0x3 << DSTS_enumspd_bit_pos)
216#define USB_DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ 0 268#define DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ 0
217#define USB_DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ 1 269#define DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ 1
218#define USB_DSTS_ENUMSPD_LS_PHY_6MHZ 2 270#define DSTS_ENUMSPD_LS_PHY_6MHZ 2
219#define USB_DSTS_ENUMSPD_FS_PHY_48MHZ 3 271#define DSTS_ENUMSPD_FS_PHY_48MHZ 3
220#define USB_DSTS_errticerr (1 << 3) /** Erratic errors ? */ 272#define DSTS_errticerr (1 << 3) /** Erratic errors ? */
221#define USB_DSTS_soffn_bit_pos 7 /** Frame or Microframe Number of the received SOF */ 273#define DSTS_soffn_bit_pos 7 /** Frame or Microframe Number of the received SOF */
222#define USB_DSTS_soffn_bits (0x3fff << USB_DSTS_soffn_bit_pos) 274#define DSTS_soffn_bits (0x3fff << DSTS_soffn_bit_pos)
223 275
224#define USB_DTHRCTL_non_iso_thr_en (1 << 0) 276#define DTHRCTL_non_iso_thr_en (1 << 0)
225#define USB_DTHRCTL_iso_thr_en (1 << 1) 277#define DTHRCTL_iso_thr_en (1 << 1)
226#define USB_DTHRCTL_tx_thr_len_bit_pos 2 278#define DTHRCTL_tx_thr_len_bit_pos 2
227#define USB_DTHRCTL_tx_thr_len_bits (0x1FF << USB_DTHRCTL_tx_thr_len_bit_pos) 279#define DTHRCTL_tx_thr_len_bits (0x1FF << DTHRCTL_tx_thr_len_bit_pos)
228#define USB_DTHRCTL_rx_thr_en (1 << 16) 280#define DTHRCTL_rx_thr_en (1 << 16)
229#define USB_DTHRCTL_rx_thr_len_bit_pos 17 281#define DTHRCTL_rx_thr_len_bit_pos 17
230#define USB_DTHRCTL_rx_thr_len_bits (0x1FF << USB_DTHRCTL_rx_thr_len_bit_pos) 282#define DTHRCTL_rx_thr_len_bits (0x1FF << DTHRCTL_rx_thr_len_bit_pos)
231 283
232/* 0<=ep<=15, you can use ep=0 */ 284/* 0<=ep<=15, you can use ep=0 */
233/** Device IN Endpoint (ep) Control Register */ 285/** Device IN Endpoint (ep) Control Register */
234#define USB_DIEPCTL(ep) USB_DEV_REG(0x100 + (ep) * 0x20) 286#define DIEPCTL(ep) DEV_REG(0x100 + (ep) * 0x20)
235/** Device IN Endpoint (ep) Interrupt Register */ 287/** Device IN Endpoint (ep) Interrupt Register */
236#define USB_DIEPINT(ep) USB_DEV_REG(0x100 + (ep) * 0x20 + 0x8) 288#define DIEPINT(ep) DEV_REG(0x100 + (ep) * 0x20 + 0x8)
237/** Device IN Endpoint (ep) Transfer Size Register */ 289/** Device IN Endpoint (ep) Transfer Size Register */
238#define USB_DIEPTSIZ(ep) USB_DEV_REG(0x100 + (ep) * 0x20 + 0x10) 290#define DIEPTSIZ(ep) DEV_REG(0x100 + (ep) * 0x20 + 0x10)
239/** Device IN Endpoint (ep) DMA Address Register */ 291/** Device IN Endpoint (ep) DMA Address Register */
240#define USB_DIEPDMA(ep) USB_DEV_REG(0x100 + (ep) * 0x20 + 0x14) 292#define DIEPDMA(ep) DEV_REG(0x100 + (ep) * 0x20 + 0x14)
241/** Device IN Endpoint (ep) Transmit FIFO Status Register */ 293/** Device IN Endpoint (ep) Transmit FIFO Status Register */
242#define USB_DTXFSTS(ep) USB_DEV_REG(0x100 + (ep) * 0x20 + 0x18) 294#define DTXFSTS(ep) DEV_REG(0x100 + (ep) * 0x20 + 0x18)
243 295
244/* the following also apply to DIEPMSK */ 296/* the following also apply to DIEPMSK */
245#define USB_DIEPINT_xfercompl (1 << 0) /** Transfer complete */ 297#define DIEPINT_xfercompl (1 << 0) /** Transfer complete */
246#define USB_DIEPINT_epdisabled (1 << 1) /** Endpoint disabled */ 298#define DIEPINT_epdisabled (1 << 1) /** Endpoint disabled */
247#define USB_DIEPINT_ahberr (1 << 2) /** AHB error */ 299#define DIEPINT_ahberr (1 << 2) /** AHB error */
248#define USB_DIEPINT_timeout (1 << 3) /** Timeout handshake (non-iso TX) */ 300#define DIEPINT_timeout (1 << 3) /** Timeout handshake (non-iso TX) */
249#define USB_DIEPINT_intktxfemp (1 << 4) /** IN token received with tx fifo empty */ 301#define DIEPINT_intktxfemp (1 << 4) /** IN token received with tx fifo empty */
250#define USB_DIEPINT_intknepmis (1 << 5) /** IN token received with ep mismatch */ 302#define DIEPINT_intknepmis (1 << 5) /** IN token received with ep mismatch */
251#define USB_DIEPINT_inepnakeff (1 << 6) /** IN endpoint NAK effective */ 303#define DIEPINT_inepnakeff (1 << 6) /** IN endpoint NAK effective */
252#define USB_DIEPINT_emptyintr (1 << 7) /** linux doc broken on this, empty fifo ? */ 304#define DIEPINT_emptyintr (1 << 7) /** linux doc broken on this, empty fifo ? */
253#define USB_DIEPINT_txfifoundrn (1 << 8) /** linux doc void on this, tx fifo underrun ? */ 305#define DIEPINT_txfifoundrn (1 << 8) /** linux doc void on this, tx fifo underrun ? */
254 306
255/* the following also apply to DOEPMSK */ 307/* the following also apply to DOEPMSK */
256#define USB_DOEPINT_xfercompl (1 << 0) /** Transfer complete */ 308#define DOEPINT_xfercompl (1 << 0) /** Transfer complete */
257#define USB_DOEPINT_epdisabled (1 << 1) /** Endpoint disabled */ 309#define DOEPINT_epdisabled (1 << 1) /** Endpoint disabled */
258#define USB_DOEPINT_ahberr (1 << 2) /** AHB error */ 310#define DOEPINT_ahberr (1 << 2) /** AHB error */
259#define USB_DOEPINT_setup (1 << 3) /** Setup Phase Done (control EPs)*/ 311#define DOEPINT_setup (1 << 3) /** Setup Phase Done (control EPs)*/
260 312
261/* 0<=ep<=15, you can use ep=0 */ 313/* 0<=ep<=15, you can use ep=0 */
262/** Device OUT Endpoint (ep) Control Register */ 314/** Device OUT Endpoint (ep) Control Register */
263#define USB_DOEPCTL(ep) USB_DEV_REG(0x300 + (ep) * 0x20) 315#define DOEPCTL(ep) DEV_REG(0x300 + (ep) * 0x20)
264/** Device OUT Endpoint (ep) Frame number Register */ 316/** Device OUT Endpoint (ep) Frame number Register */
265#define USB_DOEPFN(ep) USB_DEV_REG(0x300 + (ep) * 0x20 + 0x4) 317#define DOEPFN(ep) DEV_REG(0x300 + (ep) * 0x20 + 0x4)
266/** Device Endpoint (ep) Interrupt Register */ 318/** Device Endpoint (ep) Interrupt Register */
267#define USB_DOEPINT(ep) USB_DEV_REG(0x300 + (ep) * 0x20 + 0x8) 319#define DOEPINT(ep) DEV_REG(0x300 + (ep) * 0x20 + 0x8)
268/** Device OUT Endpoint (ep) Transfer Size Register */ 320/** Device OUT Endpoint (ep) Transfer Size Register */
269#define USB_DOEPTSIZ(ep) USB_DEV_REG(0x300 + (ep) * 0x20 + 0x10) 321#define DOEPTSIZ(ep) DEV_REG(0x300 + (ep) * 0x20 + 0x10)
270/** Device Endpoint (ep) DMA Address Register */ 322/** Device Endpoint (ep) DMA Address Register */
271#define USB_DOEPDMA(ep) USB_DEV_REG(0x300 + (ep) * 0x20 + 0x14) 323#define DOEPDMA(ep) DEV_REG(0x300 + (ep) * 0x20 + 0x14)
272 324
273#define USB_PCGCCTL USB_BASE_REG(0xE00) /** Power and Clock Gating Control Register */ 325#define PCGCCTL BASE_REG(0xE00) /** Power and Clock Gating Control Register */
274 326
275 327
276/** Maximum Packet Size 328/** Maximum Packet Size
@@ -280,18 +332,18 @@
280 * 2'b01: 32 332 * 2'b01: 32
281 * 2'b10: 16 333 * 2'b10: 16
282 * 2'b11: 8 */ 334 * 2'b11: 8 */
283#define USB_DEPCTL_mps_bits 0x7ff 335#define DEPCTL_mps_bits 0x7ff
284#define USB_DEPCTL_mps_bit_pos 0 336#define DEPCTL_mps_bit_pos 0
285#define USB_DEPCTL_MPS_64 0 337#define DEPCTL_MPS_64 0
286#define USB_DEPCTL_MPS_32 1 338#define DEPCTL_MPS_32 1
287#define USB_DEPCTL_MPS_16 2 339#define DEPCTL_MPS_16 2
288#define USB_DEPCTL_MPS_8 3 340#define DEPCTL_MPS_8 3
289/** Next Endpoint 341/** Next Endpoint
290 * IN EPn/IN EP0 342 * IN EPn/IN EP0
291 * OUT EPn/OUT EP0 - reserved */ 343 * OUT EPn/OUT EP0 - reserved */
292#define USB_DEPCTL_nextep_bit_pos 11 344#define DEPCTL_nextep_bit_pos 11
293#define USB_DEPCTL_nextep_bits (0xf << USB_DEPCTL_nextep_bit_pos) 345#define DEPCTL_nextep_bits (0xf << DEPCTL_nextep_bit_pos)
294#define USB_DEPCTL_usbactep (1 << 15) /** USB Active Endpoint */ 346#define DEPCTL_usbactep (1 << 15) /** USB Active Endpoint */
295/** Endpoint DPID (INTR/Bulk IN and OUT endpoints) 347/** Endpoint DPID (INTR/Bulk IN and OUT endpoints)
296 * This field contains the PID of the packet going to 348 * This field contains the PID of the packet going to
297 * be received or transmitted on this endpoint. The 349 * be received or transmitted on this endpoint. The
@@ -306,28 +358,28 @@
306 * - 0: D0 358 * - 0: D0
307 * - 1: D1 359 * - 1: D1
308 */ 360 */
309#define USB_DEPCTL_dpid (1 << 16) 361#define DEPCTL_dpid (1 << 16)
310#define USB_DEPCTL_naksts (1 << 17) /** NAK Status */ 362#define DEPCTL_naksts (1 << 17) /** NAK Status */
311/** Endpoint Type 363/** Endpoint Type
312 * 2'b00: Control 364 * 2'b00: Control
313 * 2'b01: Isochronous 365 * 2'b01: Isochronous
314 * 2'b10: Bulk 366 * 2'b10: Bulk
315 * 2'b11: Interrupt */ 367 * 2'b11: Interrupt */
316#define USB_DEPCTL_eptype_bit_pos 18 368#define DEPCTL_eptype_bit_pos 18
317#define USB_DEPCTL_eptype_bits (0x3 << USB_DEPCTL_eptype_bit_pos) 369#define DEPCTL_eptype_bits (0x3 << DEPCTL_eptype_bit_pos)
318/** Snoop Mode 370/** Snoop Mode
319 * OUT EPn/OUT EP0 371 * OUT EPn/OUT EP0
320 * IN EPn/IN EP0 - reserved */ 372 * IN EPn/IN EP0 - reserved */
321#define USB_DEPCTL_snp (1 << 20) 373#define DEPCTL_snp (1 << 20)
322#define USB_DEPCTL_stall (1 << 21) /** Stall Handshake */ 374#define DEPCTL_stall (1 << 21) /** Stall Handshake */
323/** Tx Fifo Number 375/** Tx Fifo Number
324 * IN EPn/IN EP0 376 * IN EPn/IN EP0
325 * OUT EPn/OUT EP0 - reserved */ 377 * OUT EPn/OUT EP0 - reserved */
326#define USB_DEPCTL_txfnum_bit_pos 22 378#define DEPCTL_txfnum_bit_pos 22
327#define USB_DEPCTL_txfnum_bits (0xf << USB_DEPCTL_txfnum_bit_pos) 379#define DEPCTL_txfnum_bits (0xf << DEPCTL_txfnum_bit_pos)
328 380
329#define USB_DEPCTL_cnak (1 << 26) /** Clear NAK */ 381#define DEPCTL_cnak (1 << 26) /** Clear NAK */
330#define USB_DEPCTL_snak (1 << 27) /** Set NAK */ 382#define DEPCTL_snak (1 << 27) /** Set NAK */
331/** Set DATA0 PID (INTR/Bulk IN and OUT endpoints) 383/** Set DATA0 PID (INTR/Bulk IN and OUT endpoints)
332 * Writing to this field sets the Endpoint DPID (DPID) 384 * Writing to this field sets the Endpoint DPID (DPID)
333 * field in this register to DATA0. Set Even 385 * field in this register to DATA0. Set Even
@@ -336,7 +388,7 @@
336 * (micro)frame (EO_FrNum) field to even (micro) 388 * (micro)frame (EO_FrNum) field to even (micro)
337 * frame. 389 * frame.
338 */ 390 */
339#define USB_DEPCTL_setd0pid (1 << 28) 391#define DEPCTL_setd0pid (1 << 28)
340/** Set DATA1 PID (INTR/Bulk IN and OUT endpoints) 392/** Set DATA1 PID (INTR/Bulk IN and OUT endpoints)
341 * Writing to this field sets the Endpoint DPID (DPID) 393 * Writing to this field sets the Endpoint DPID (DPID)
342 * field in this register to DATA1 Set Odd 394 * field in this register to DATA1 Set Odd
@@ -344,52 +396,52 @@
344 * Writing to this field sets the Even/Odd 396 * Writing to this field sets the Even/Odd
345 * (micro)frame (EO_FrNum) field to odd (micro) frame. 397 * (micro)frame (EO_FrNum) field to odd (micro) frame.
346 */ 398 */
347#define USB_DEPCTL_setd1pid (1 << 29) 399#define DEPCTL_setd1pid (1 << 29)
348#define USB_DEPCTL_epdis (1 << 30) /** Endpoint disable */ 400#define DEPCTL_epdis (1 << 30) /** Endpoint disable */
349#define USB_DEPCTL_epena (1 << 31) /** Endpoint enable */ 401#define DEPCTL_epena (1 << 31) /** Endpoint enable */
350 402
351 403
352/* valid for any D{I,O}EPTSIZi with 1<=i<=15, NOT for i=0 ! */ 404/* valid for any D{I,O}EPTSIZi with 1<=i<=15, NOT for i=0 ! */
353#define USB_DEPTSIZ_xfersize_bits 0x7ffff /** Transfer Size */ 405#define DEPTSIZ_xfersize_bits 0x7ffff /** Transfer Size */
354#define USB_DEPTSIZ_pkcnt_bit_pos 19 /** Packet Count */ 406#define DEPTSIZ_pkcnt_bit_pos 19 /** Packet Count */
355#define USB_DEPTSIZ_pkcnt_bits (0x3ff << USB_DEPTSIZ_pkcnt_bit_pos) 407#define DEPTSIZ_pkcnt_bits (0x3ff << DEPTSIZ_pkcnt_bit_pos)
356#define USB_DEPTSIZ_mc_bit_pos 29 /** Multi Count - Periodic IN endpoints */ 408#define DEPTSIZ_mc_bit_pos 29 /** Multi Count - Periodic IN endpoints */
357#define USB_DEPTSIZ_mc_bits (0x3 << USB_DEPTSIZ_mc_bit_pos) 409#define DEPTSIZ_mc_bits (0x3 << DEPTSIZ_mc_bit_pos)
358 410
359/* idem but for i=0 */ 411/* idem but for i=0 */
360#define USB_DEPTSIZ0_xfersize_bits 0x7f /** Transfer Size */ 412#define DEPTSIZ0_xfersize_bits 0x7f /** Transfer Size */
361#define USB_DEPTSIZ0_pkcnt_bit_pos 19 /** Packet Count */ 413#define DEPTSIZ0_pkcnt_bit_pos 19 /** Packet Count */
362#define USB_DEPTSIZ0_pkcnt_bits (0x1 << USB_DEPTSIZ0_pkcnt_bit_pos) 414#define DEPTSIZ0_pkcnt_bits (0x1 << DEPTSIZ0_pkcnt_bit_pos)
363#define USB_DEPTSIZ0_supcnt_bit_pos 29 /** Setup Packet Count (DOEPTSIZ0 Only) */ 415#define DEPTSIZ0_supcnt_bit_pos 29 /** Setup Packet Count (DOEPTSIZ0 Only) */
364#define USB_DEPTSIZ0_supcnt_bits (0x3 << USB_DEPTSIZ0_supcnt_bit_pos) 416#define DEPTSIZ0_supcnt_bits (0x3 << DEPTSIZ0_supcnt_bit_pos)
365 417
366/* valid for USB_DAINT and USB_DAINTMSK, for 0<=ep<=15 */ 418/* valid for DAINT and DAINTMSK, for 0<=ep<=15 */
367#define USB_DAINT_IN_EP(i) (1 << (i)) 419#define DAINT_IN_EP(i) (1 << (i))
368#define USB_DAINT_OUT_EP(i) (1 << ((i) + 16)) 420#define DAINT_OUT_EP(i) (1 << ((i) + 16))
369 421
370/** 422/**
371 * Parameters 423 * Parameters
372 */ 424 */
373#define USB_USE_CUSTOM_FIFO_LAYOUT 425#define USE_CUSTOM_FIFO_LAYOUT
374 426
375#ifdef USB_USE_CUSTOM_FIFO_LAYOUT 427#ifdef USE_CUSTOM_FIFO_LAYOUT
376/* Data fifo: includes RX fifo, non period TX fifo and periodic fifos 428/* Data fifo: includes RX fifo, non period TX fifo and periodic fifos
377 * NOTE: this is a hardware parameter, it cannot be changed ! */ 429 * NOTE: this is a hardware parameter, it cannot be changed ! */
378#define USB_DATA_FIFO_DEPTH 0x535 430#define DATA_FIFO_DEPTH 0x535
379/* size of the FX fifo */ 431/* size of the FX fifo */
380#define USB_RX_FIFO_SIZE 0x100 432#define RX_FIFO_SIZE 0x100
381/* size of the non periodic TX fifo */ 433/* size of the non periodic TX fifo */
382#define USB_NPTX_FIFO_SIZE 0x100 434#define NPTX_FIFO_SIZE 0x100
383/* size of each TX ep fifo size */ 435/* size of each TX ep fifo size */
384#define USB_EPTX_FIFO_SIZE 0x100 436#define EPTX_FIFO_SIZE 0x100
385#endif /* USB_USE_CUSTOM_FIFO_LAYOUT */ 437#endif /* USE_CUSTOM_FIFO_LAYOUT */
386 438
387/* Number of IN/OUT endpoints */ 439/* Number of IN/OUT endpoints */
388#define USB_NUM_IN_EP 3 440#define NUM_IN_EP 3
389#define USB_NUM_OUT_EP 2 441#define NUM_OUT_EP 2
390 442
391/* List of IN enpoints */ 443/* List of IN enpoints */
392#define USB_IN_EP_LIST 1, 3, 5 444#define IN_EP_LIST 1, 3, 5
393#define USB_OUT_EP_LIST 2, 4 445#define OUT_EP_LIST 2, 4
394 446
395#endif /* __USB_DRV_AS3525v2_H__ */ 447#endif /* __USB_DRV_AS3525v2_H__ */