Lines Matching +full:stream +full:- +full:mode +full:- +full:support

1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright (C) 2018-2019 Cadence.
6 * Copyright (C) 2017-2018 NXP
15 #include <linux/dma-direction.h>
18 * USBSS-DEV register interface.
23 * struct cdns3_usb_regs - device controller registers.
53 * @buf_addr: Address for On-chip Buffer operations.
54 * @buf_data: Data for On-chip Buffer operations.
55 * @buf_ctrl: On-chip Buffer Access Control.
56 * @dtrans: DMA Transfer Mode.
123 /* USB_CONF - bitmasks */
132 /* Little Endian access - default */
142 /* Singular DMA transfer mode. Only for VER < DEV_VER_V3*/
144 /* Multiple DMA transfers mode. Only for VER < DEV_VER_V3 */
146 /* DMA clock turn-off enable. */
148 /* DMA clock turn-off disable. */
158 /* L1 LPM state entry enable (used in HS/FS mode). */
160 /* L1 LPM state entry disable (used in HS/FS mode). */
166 /* L0 LPM state entry request (used in HS/FS mode). */
173 /* U1 state entry enable (used in SS mode). */
175 /* U1 state entry disable (used in SS mode). */
177 /* U2 state entry enable (used in SS mode). */
179 /* U2 state entry disable (used in SS mode). */
181 /* U0 state entry request (used in SS mode). */
183 /* U1 state entry request (used in SS mode). */
185 /* U2 state entry request (used in SS mode). */
187 /* SS.Inactive state entry request (used in SS mode) */
190 /* USB_STS - bitmasks */
193 * 1 - device is in the configured state.
194 * 0 - device is not configured.
199 * On-chip memory overflow.
200 * 0 - On-chip memory status OK.
201 * 1 - On-chip memory overflow.
207 * 0 - USB in SuperSpeed mode disconnected.
208 * 1 - USB in SuperSpeed mode connected.
214 * 0 - single request.
215 * 1 - multiple TRB chain
222 * 0 - Undefined (value after reset).
223 * 1 - Low speed
224 * 2 - Full speed
225 * 3 - High speed
226 * 4 - Super speed
241 * 0 - Little Endian order (default after hardware reset).
242 * 1 - Big Endian order
247 * HS/FS clock turn-off status.
248 * 0 - hsfs clock is always on.
249 * 1 - hsfs clock turn-off in L2 (HS/FS mode) is enabled
255 * PCLK clock turn-off status.
256 * 0 - pclk clock is always on.
257 * 1 - pclk clock turn-off in U3 (SS mode) is enabled
264 * 0 - Internal reset is active.
265 * 1 - Internal reset is not active and controller is fully operational.
271 * 0 - disabled
272 * 1 - enabled
278 * 0 - USB device is disabled (VBUS input is disconnected from internal logic).
279 * 1 - USB device is enabled (VBUS input is connected to the internal logic).
285 * 0 - USB device is default state.
286 * 1 - USB device is at least in address state.
291 * L1 LPM state enable status (used in HS/FS mode).
292 * 0 - Entering to L1 LPM state disabled.
293 * 1 - Entering to L1 LPM state enabled.
298 * Internal VBUS connection status (used both in HS/FS and SS mode).
299 * 0 - internal VBUS is not detected.
300 * 1 - internal VBUS is detected.
305 * HS/FS LPM state (used in FS/HS mode).
306 * 0 - L0 State
307 * 1 - L1 State
308 * 2 - L2 State
309 * 3 - L3 State
317 * Disable HS status (used in FS/HS mode).
318 * 0 - the disconnect bit for HS/FS mode is set .
319 * 1 - the disconnect bit for HS/FS mode is not set.
324 * HS/FS mode connection status (used in FS/HS mode).
325 * 0 - High Speed operations in USB2.0 (FS/HS) mode not disabled.
326 * 1 - High Speed operations in USB2.0 (FS/HS).
331 * U1 state enable status (used in SS mode).
332 * 0 - Entering to U1 state disabled.
333 * 1 - Entering to U1 state enabled.
338 * U2 state enable status (used in SS mode).
339 * 0 - Entering to U2 state disabled.
340 * 1 - Entering to U2 state enabled.
345 * SuperSpeed Link LTSSM state. This field reflects USBSS-DEV current
362 * DMA clock turn-off status.
363 * 0 - DMA clock is always on (default after hardware reset).
364 * 1 - DMA clock turn-off in U1, U2 and U3 (SS mode) is enabled.
370 * 0 - Little Endian order (default after hardware reset).
371 * 1 - Big Endian order.
376 /* USB_CMD - bitmasks */
388 /* Send Function Wake Device Notification TP (used only in SS mode). */
390 /* Set Test Mode (used only in HS/FS mode). */
392 /* Test mode selector (used only in HS/FS mode) */
397 * in SS mode).
400 /* Send Custom Transaction Packet (used only in SS mode) */
402 /*Device Notification 'Function Wake' - Interface value (only in SS mode. */
406 * Device Notification 'Latency Tolerance Message' -373 BELT value [7:0]
407 * (used only in SS mode).
412 /* USB_ITPN - bitmasks */
415 * In SS mode this field represent number of last ITP received from host.
416 * In HS/FS mode this field represent number of last SOF received from host.
421 /* USB_LPM - bitmasks */
428 /* USB_IEN - bitmasks */
455 /* HS/FS mode connection interrupt enable.*/
457 /* HS/FS mode disconnection interrupt enable.*/
459 /* USB reset (HS/FS mode) interrupt enable.*/
481 /* USB_ISTS - bitmasks */
508 /* HS/FS mode connection detected.*/
510 /* HS/FS mode disconnection detected.*/
512 /* USB reset (HS/FS mode) detected.*/
529 /* USB_SEL - bitmasks */
533 /* Endpoint direction bit - 0 - OUT, 1 - IN. */
539 /* EP_TRADDR - bitmasks */
543 /* EP_CFG - bitmasks */
548 * 1 - isochronous
549 * 2 - bulk
550 * 3 - interrupt
554 /* Stream support enable (only in SS mode). */
556 /* TDL check (only in SS mode for BULK EP). */
558 /* SID check (only in SS mode for BULK OUT EP). */
562 /* Max burst size (used only in SS mode). */
578 /* EP_CMD - bitmasks */
594 * Transfer Descriptor Length write (used only for Bulk Stream capable
595 * endpoints in SS mode).
600 * Transfer Descriptor Length (used only in SS mode for bulk endpoints).
608 /* ERDY Stream ID value (used in SS mode). */
612 /* EP_STS - bitmasks */
623 /* Stream Rejected (used only in SS mode) */
625 /* EXIT from MOVE DATA State (used only for stream transfers in SS mode). */
629 /* Not ready (used only in SS mode). */
637 /* Prime (used only in SS mode. */
639 /* Stream error (used only in SS mode). */
645 /* Host Packet Pending (only for SS mode). */
647 /* Stream Protocol State Machine State (only for Bulk stream endpoints). */
664 /* EP_STS_SID - bitmasks */
665 /* Stream ID (used only in SS mode). */
669 /* EP_STS_EN - bitmasks */
674 /* Stream Rejected enable. */
684 /* Stream error enable. */
695 /* DRBL- bitmasks */
700 /* EP_IEN - bitmasks */
705 /* EP_ISTS - bitmasks */
710 /* USB_PWR- bitmasks */
716 * Enables turning-off Reference Clock.
717 * This bit is optional and implemented only when support for OTG is
731 /* USB_CONF2- bitmasks */
734 * for DMULT mode.
740 * for DMULT mode.
745 /* USB_CAP1- bitmasks */
749 * 0x0 - OCP
750 * 0x1 - AHB,
751 * 0x2 - PLB
752 * 0x3 - AXI
753 * 0x4-0xF - reserved
763 * 0x0 - 8 bit interface,
764 * 0x1 - 16 bit interface,
765 * 0x2 - 32 bit interface
766 * 0x3 - 64 bit interface
767 * 0x4-0xF - reserved
777 * 0x0 - OCP
778 * 0x1 - AHB,
779 * 0x2 - PLB
780 * 0x3 - AXI
781 * 0x4-0xF - reserved
791 * 0x0 - reserved,
792 * 0x1 - reserved,
793 * 0x2 - 32 bit interface
794 * 0x3 - 64 bit interface
795 * 0x4-0xF - reserved
803 * 0x0 - USB PIPE,
804 * 0x1 - RMMI,
805 * 0x2-0xF - reserved
813 * 0x0 - 8 bit PIPE interface,
814 * 0x1 - 16 bit PIPE interface,
815 * 0x2 - 32 bit PIPE interface,
816 * 0x3 - 64 bit PIPE interface
817 * 0x4-0xF - reserved
834 * 0x0 - interface NOT implemented,
835 * 0x1 - interface implemented
841 * 0x0 - UTMI,
842 * 0x1 - ULPI
848 * 0x0 - 8 bit interface,
849 * 0x1 - 16 bit interface,
855 * 0x0 - pure device mode
856 * 0x1 - some features and ports for CDNS USB OTG controller are implemented.
862 * calculation basing on the size provided in TRB (TRB[22:17]) for DMULT mode
867 /* USB_CAP2- bitmasks */
869 * The actual size of the connected On-chip RAM memory in kB:
870 * - 0 means 256 kB (max supported mem size)
871 * - value other than 0 reflects the mem size in kB
876 * These field reflects width of on-chip RAM address bus width,
878 * 0x0-0x7 - reserved,
879 * 0x8 - support for 4kB mem,
880 * 0x9 - support for 8kB mem,
881 * 0xA - support for 16kB mem,
882 * 0xB - support for 32kB mem,
883 * 0xC - support for 64kB mem,
884 * 0xD - support for 128kB mem,
885 * 0xE - support for 256kB mem,
886 * 0xF - reserved
890 /* USB_CAP3- bitmasks */
893 /* USB_CAP4- bitmasks */
896 /* USB_CAP5- bitmasks */
899 /* USB_CAP6- bitmasks */
900 /* The USBSS-DEV Controller Internal build number. */
902 /* The USBSS-DEV Controller version number. */
910 /* DBG_LINK1- bitmasks */
923 * RXDET_BREAK_DIS value This parameter configures terminating the Far-end
927 * 1: USBSS_DEV will not terminate Far-end receiver termination
958 /* DMA_AXI_CTRL- bitmasks */
969 /*-------------------------------------------------------------------------*/
971 * USBSS-DEV DMA interface.
990 *Only for ISOC endpoints - maximum number of TRBs is calculated as
991 * pow(2, bInterval-1) * number of usb requests. It is limitation made by
1001 * struct cdns3_trb - represent Transfer Descriptor block.
1031 /* Cycle bit - indicates TRB ownership by driver or hw*/
1047 * - Shall be set to 0 by Software when putting TRB on the Transfer Ring
1048 * - Shall be set to 1 by Controller when Short Packet condition for this TRB
1055 /*Setting this bit enables FIFO DMA operation mode*/
1062 /* stream ID bitmasks. */
1067 /* Size of TD expressed in USB packets for HS/FS mode. */
1074 /* Size of TD expressed in USB packets for SS mode. */
1078 /* transfer_len bitmasks - bits 31:24 */
1085 /*-------------------------------------------------------------------------*/
1103 /*-------------------------------------------------------------------------*/
1109 * struct cdns3_endpoint - extended device side representation of USB endpoint.
1114 * @trb_pool: transfer ring - array of transaction buffers
1119 * @descmis_req: internal transfer object used for getting data from on-chip
1123 * @num: endpoint number (1 - 15)
1190 /* Stream related */
1200 * struct cdns3_aligned_buf - represent aligned buffer used for DMA transfer
1218 * struct cdns3_request - extended device side representation of usb_request
1258 * struct cdns3_device - represent USB device.
1268 * @zlp_buf - zlp buffer
1285 * @onchip_buffers: number of available on-chip buffers.
1286 * @onchip_used_size: actual size of on-chip memory assigned to endpoints.
1301 /* generic spin-lock for drivers */