aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mtu3/mtu3.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/mtu3/mtu3.h')
-rw-r--r--drivers/usb/mtu3/mtu3.h57
1 files changed, 28 insertions, 29 deletions
diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h
index 87823ac0d120..76ecf12fdf62 100644
--- a/drivers/usb/mtu3/mtu3.h
+++ b/drivers/usb/mtu3/mtu3.h
@@ -63,6 +63,15 @@ struct mtu3_request;
63#define MTU3_U2_IP_SLOT_DEFAULT 1 63#define MTU3_U2_IP_SLOT_DEFAULT 1
64 64
65/** 65/**
66 * IP TRUNK version
67 * from 0x1003 version, USB3 Gen2 is supported, two changes affect driver:
68 * 1. MAXPKT and MULTI bits layout of TXCSR1 and RXCSR1 are adjusted,
69 * but not backward compatible
70 * 2. QMU extend buffer length supported
71 */
72#define MTU3_TRUNK_VERS_1003 0x1003
73
74/**
66 * Normally the device works on HS or SS, to simplify fifo management, 75 * Normally the device works on HS or SS, to simplify fifo management,
67 * devide fifo into some 512B parts, use bitmap to manage it; And 76 * devide fifo into some 512B parts, use bitmap to manage it; And
68 * 128 bits size of bitmap is large enough, that means it can manage 77 * 128 bits size of bitmap is large enough, that means it can manage
@@ -135,45 +144,33 @@ struct mtu3_fifo_info {
135 * The format of TX GPD is a little different from RX one. 144 * The format of TX GPD is a little different from RX one.
136 * And the size of GPD is 16 bytes. 145 * And the size of GPD is 16 bytes.
137 * 146 *
138 * @flag: 147 * @dw0_info:
139 * bit0: Hardware Own (HWO) 148 * bit0: Hardware Own (HWO)
140 * bit1: Buffer Descriptor Present (BDP), always 0, BD is not supported 149 * bit1: Buffer Descriptor Present (BDP), always 0, BD is not supported
141 * bit2: Bypass (BPS), 1: HW skips this GPD if HWO = 1 150 * bit2: Bypass (BPS), 1: HW skips this GPD if HWO = 1
151 * bit6: [EL] Zero Length Packet (ZLP), moved from @dw3_info[29]
142 * bit7: Interrupt On Completion (IOC) 152 * bit7: Interrupt On Completion (IOC)
143 * @chksum: This is used to validate the contents of this GPD; 153 * bit[31:16]: ([EL] bit[31:12]) allow data buffer length (RX ONLY),
144 * If TXQ_CS_EN / RXQ_CS_EN bit is set, an interrupt is issued 154 * the buffer length of the data to receive
145 * when checksum validation fails; 155 * bit[23:16]: ([EL] bit[31:24]) extension address (TX ONLY),
146 * Checksum value is calculated over the 16 bytes of the GPD by default; 156 * lower 4 bits are extension bits of @buffer,
147 * @data_buf_len (RX ONLY): This value indicates the length of 157 * upper 4 bits are extension bits of @next_gpd
148 * the assigned data buffer
149 * @tx_ext_addr (TX ONLY): [3:0] are 4 extension bits of @buffer,
150 * [7:4] are 4 extension bits of @next_gpd
151 * @next_gpd: Physical address of the next GPD 158 * @next_gpd: Physical address of the next GPD
152 * @buffer: Physical address of the data buffer 159 * @buffer: Physical address of the data buffer
153 * @buf_len: 160 * @dw3_info:
154 * (TX): This value indicates the length of the assigned data buffer 161 * bit[15:0]: ([EL] bit[19:0]) data buffer length,
155 * (RX): The total length of data received 162 * (TX): the buffer length of the data to transmit
156 * @ext_len: reserved 163 * (RX): The total length of data received
157 * @rx_ext_addr(RX ONLY): [3:0] are 4 extension bits of @buffer, 164 * bit[23:16]: ([EL] bit[31:24]) extension address (RX ONLY),
158 * [7:4] are 4 extension bits of @next_gpd 165 * lower 4 bits are extension bits of @buffer,
159 * @ext_flag: 166 * upper 4 bits are extension bits of @next_gpd
160 * bit5 (TX ONLY): Zero Length Packet (ZLP), 167 * bit29: ([EL] abandoned) Zero Length Packet (ZLP) (TX ONLY)
161 */ 168 */
162struct qmu_gpd { 169struct qmu_gpd {
163 __u8 flag; 170 __le32 dw0_info;
164 __u8 chksum;
165 union {
166 __le16 data_buf_len;
167 __le16 tx_ext_addr;
168 };
169 __le32 next_gpd; 171 __le32 next_gpd;
170 __le32 buffer; 172 __le32 buffer;
171 __le16 buf_len; 173 __le32 dw3_info;
172 union {
173 __u8 ext_len;
174 __u8 rx_ext_addr;
175 };
176 __u8 ext_flag;
177} __packed; 174} __packed;
178 175
179/** 176/**
@@ -316,6 +313,7 @@ static inline struct ssusb_mtk *dev_to_ssusb(struct device *dev)
316 * @may_wakeup: means device's remote wakeup is enabled 313 * @may_wakeup: means device's remote wakeup is enabled
317 * @is_self_powered: is reported in device status and the config descriptor 314 * @is_self_powered: is reported in device status and the config descriptor
318 * @delayed_status: true when function drivers ask for delayed status 315 * @delayed_status: true when function drivers ask for delayed status
316 * @gen2cp: compatible with USB3 Gen2 IP
319 * @ep0_req: dummy request used while handling standard USB requests 317 * @ep0_req: dummy request used while handling standard USB requests
320 * for GET_STATUS and SET_SEL 318 * for GET_STATUS and SET_SEL
321 * @setup_buf: ep0 response buffer for GET_STATUS and SET_SEL requests 319 * @setup_buf: ep0 response buffer for GET_STATUS and SET_SEL requests
@@ -356,6 +354,7 @@ struct mtu3 {
356 unsigned u2_enable:1; 354 unsigned u2_enable:1;
357 unsigned is_u3_ip:1; 355 unsigned is_u3_ip:1;
358 unsigned delayed_status:1; 356 unsigned delayed_status:1;
357 unsigned gen2cp:1;
359 358
360 u8 address; 359 u8 address;
361 u8 test_mode_nr; 360 u8 test_mode_nr;