Lines Matching +full:maximum +full:- +full:speed

1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
3 * core.h - DesignWare HS OTG Controller common declarations
5 * Copyright (C) 2004-2013 Synopsys, Inc.
21 * - no_printk: Disable tracing
22 * - pr_info: Print this info to the console
23 * - trace_printk: Print this info to trace buffer (good for verbose logging)
32 dev_name(hsotg->dev), ##__VA_ARGS__)
37 dev_name(hsotg->dev), ##__VA_ARGS__)
39 /* Maximum number of Endpoints/HostChannels */
42 /* dwc2-hsotg declarations */
74 * struct dwc2_hsotg_ep - driver endpoint definition.
88 * @mc: Multi Count - number of transactions per microframe
94 * @send_zlp: Set if we need to send a zero-length packet.
119 * as in shared-fifo mode periodic in acts like a single-frame packet
162 * struct dwc2_hsotg_req - data transfer request
177 if ((_hs)->gadget.speed != USB_SPEED_UNKNOWN && \
178 (_hs)->driver && (_hs)->driver->_entry) { \
179 spin_unlock(&_hs->lock); \
180 (_hs)->driver->_entry(&(_hs)->gadget); \
181 spin_lock(&_hs->lock); \
209 * struct dwc2_core_params - Parameters for configuring the core
213 * - HNP and SRP capable
214 * - SRP Only capable
215 * - No HNP/SRP capable (always available)
217 * - OTG revision number the device is compliant with, in binary-coded
222 * 0 - Slave (always available)
223 * 1 - DMA (default, if available)
228 * 0 - Address DMA
229 * 1 - Descriptor DMA (default, if available)
232 * the data FIFOs in Full Speed mode only. The driver
235 * 0 - Address DMA
236 * 1 - Descriptor DMA in FS (default, if available)
237 * @speed: Specifies the maximum speed of operation in host and
238 * device mode. The actual speed depends on the speed of
240 * 0 - High Speed
242 * 1 - Full Speed
243 * (default when phy_type is Full Speed)
244 * @enable_dynamic_fifo: 0 - Use coreConsultant-specified FIFO size parameters
245 * 1 - Allow dynamic FIFO sizing (default, if available)
246 * @en_multiple_tx_fifo: Specifies whether dedicated per-endpoint transmit FIFOs
247 * are enabled for non-periodic IN endpoints in device
249 * @host_rx_fifo_size: Number of 4-byte words in the Rx FIFO in host mode when
252 * Actual maximum value is autodetected and also
254 * @host_nperio_tx_fifo_size: Number of 4-byte words in the non-periodic Tx FIFO
257 * Actual maximum value is autodetected and also
259 * @host_perio_tx_fifo_size: Number of 4-byte words in the periodic Tx FIFO in
262 * Actual maximum value is autodetected and also
264 * @max_transfer_size: The maximum transfer size supported, in bytes
266 * Actual maximum value is autodetected and also
268 * @max_packet_count: The maximum number of packets in a transfer
270 * Actual maximum value is autodetected and also
274 * Actual maximum value is autodetected and also
278 * 0 - Full Speed Phy
279 * 1 - UTMI+ Phy
280 * 2 - ULPI Phy
294 * 0 - single data rate ULPI interface with 8 bit wide
296 * 1 - double data rate ULPI interface with 4 bit wide
300 * 0 - Internal supply (default)
301 * 1 - External supply
303 * speed PHY. This parameter is only applicable if phy_type
305 * 0 - No (default)
306 * 1 - Yes
308 * 0 - Disable (default)
309 * 1 - Enable
311 * 0 - No
312 * 1 - Yes
314 * 0 - No (default)
315 * 1 - Yes
317 * when attached to a Full Speed or Low Speed device in
319 * 0 - Don't support low power mode (default)
320 * 1 - Support low power mode
322 * when connected to a Low Speed device in host
325 * 0 - 48 MHz
327 * 1 - 6 MHz
328 * (default when phy_type is Full Speed)
330 * 0 - Allow overcurrent condition to get detected
331 * 1 - Disable overcurrent condtion to get detected
333 * 0 - No (default)
334 * 1 - Yes
336 * 0 - No (default for core < 2.92a)
337 * 1 - Yes (default for core >= 2.92a)
340 * -1 - GAHBCFG value will be set to 0x06
342 * all others - GAHBCFG value will be overridden with
352 * 0 - No (default)
353 * 1 - Yes
358 * 0 - No (default)
359 * 1 - Partial power down
360 * 2 - Hibernation
362 * 0 - No (use clock gating)
363 * 1 - Yes (avoid it)
365 * 0 - No
366 * 1 - Yes
368 * 0 - No
369 * 1 - Yes
371 * 0 - No
372 * 1 - Yes
374 * 0 - No
375 * 1 - Yes
379 * 62500 - 16MHz
380 * 58823 - 17MHz
381 * 52083 - 19.2MHz
382 * 50000 - 20MHz
383 * 41666 - 24MHz
384 * 33333 - 30MHz (default)
385 * 25000 - 40MHz
393 * 0 - Deactivate the transceiver (default)
394 * 1 - Activate the transceiver
397 * 0 - Deactivate the external level detection (default)
398 * 1 - Activate the external level detection
401 * 0 - Deactivate the overcurrent detection
402 * 1 - Activate the overcurrent detection (default)
406 * DWORDS from 16-32768 (default: 2048 if
408 * @g_np_tx_fifo_size: The non-periodic tx fifo size for the device in
409 * DWORDS from 16-32768 (default: 1024 if
415 * 16-32768 (default: 256, 256, 256, 256, 768,
417 * @change_speed_quirk: Change speed configuration to DWC2_SPEED_PARAM_FULL
418 * while full&low speed device connect. And change speed
420 * 0 - No (default)
421 * 1 - Yes
423 * 0 - No
424 * 1 - Yes
428 * value of -1 (or any other out of range value) for any parameter means
439 u8 speed; member
505 * struct dwc2_hw_params - Autodetected parameters.
509 * supported or maximum value that can be configured in the
515 * 0 - HNP- and SRP-Capable OTG (Host & Device)
516 * 1 - SRP-Capable OTG (Host & Device)
517 * 2 - Non-HNP and Non-SRP Capable OTG (Host & Device)
518 * 3 - SRP-Capable Device
519 * 4 - Non-OTG Device
520 * 5 - SRP-Capable Host
521 * 6 - Non-OTG Host
523 * 0 - Slave only
524 * 1 - External DMA
525 * 2 - Internal DMA
527 * the worst-case scenario of Rx followed by Rx
530 * 0 - Don't support
531 * 1 - Support
544 * Non-Periodic Request Queue Depth
546 * @hs_phy_type: High-speed PHY interface type
547 * 0 - High-speed interface not supported
548 * 1 - UTMI+
549 * 2 - ULPI
550 * 3 - UTMI+ and ULPI
551 * @fs_phy_type: Full-speed PHY interface type
552 * 0 - Full speed interface not supported
553 * 1 - Dedicated full speed interface
554 * 2 - FS pins shared with UTMI+ pins
555 * 3 - FS pins shared with ULPI pins
559 * 0 - 8 bits
560 * 1 - 16 bits
561 * 2 - 8 or 16 bits
564 * @g_tx_fifo_size: Power-on values of TxFIFO sizes
569 * 0 - Address DMA
570 * 1 - Descriptor DMA (default, if available)
571 * @enable_dynamic_fifo: 0 - Use coreConsultant-specified FIFO size parameters
572 * 1 - Allow dynamic FIFO sizing (default, if available)
573 * @en_multiple_tx_fifo: Specifies whether dedicated per-endpoint transmit FIFOs
574 * are enabled for non-periodic IN endpoints in device
576 * @host_nperio_tx_fifo_size: Number of 4-byte words in the non-periodic Tx FIFO
579 * Actual maximum value is autodetected and also
581 * @host_perio_tx_fifo_size: Number of 4-byte words in the periodic Tx FIFO in
584 * Actual maximum value is autodetected and also
586 * @max_transfer_size: The maximum transfer size supported, in bytes
588 * Actual maximum value is autodetected and also
590 * @max_packet_count: The maximum number of packets in a transfer
592 * Actual maximum value is autodetected and also
596 * Actual maximum value is autodetected and also
598 * @dev_nperio_tx_fifo_size: Number of 4-byte words in the non-periodic Tx FIFO
601 * Actual maximum value is autodetected and also
604 * speed PHY. This parameter is only applicable if phy_type
606 * 0 - No (default)
607 * 1 - Yes
609 * 0 - Disable
610 * 1 - Enable
612 * 0 - Disable
613 * 1 - Enable
614 * @rx_fifo_size: Number of 4-byte words in the Rx FIFO when dynamic
616 * Actual maximum value is autodetected and also
620 * 0 - Disable
621 * 1 - Enable
662 * struct dwc2_gregs_backup - Holds global registers state before
696 * struct dwc2_dregs_backup - Holds device registers state before
729 * struct dwc2_hregs_backup - Holds host registers state before
750 * Constants related to high speed periodic scheduling
765 * We schedule 100us per uframe or 80% of 125us (the maximum amount you're
773 * - DWC2_HS_SCHEDULE_UFRAMES must even divide 0x4000 (HFNUM_MAX_FRNUM + 1)
774 * - DWC2_HS_SCHEDULE_UFRAMES must be 8 times DWC2_LS_SCHEDULE_FRAMES (probably
786 * Constants related to low speed scheduling
788 * For high speed we schedule every 1us. For low speed that's a bit overkill,
793 * Our low speed schedule can be as short as 1 frame or could be longer. When
796 * every 2048 frames will get time reserved in every frame. Our low speed
800 * Note: one other advantage of a short low speed schedule is that if we mess
808 * - DWC2_US_PER_SLICE must evenly divide DWC2_LS_PERIODIC_US_PER_FRAME.
828 * struct dwc2_hsotg - Holds the state of the driver, including the non-periodic
843 * - USB_DR_MODE_PERIPHERAL
844 * - USB_DR_MODE_HOST
845 * - USB_DR_MODE_OTG
849 * @hcd_enabled: Host mode sub-driver initialization indicator.
850 * @gadget_enabled: Peripheral mode sub-driver initialization indicator.
851 * @ll_hw_enabled: Status of low-level hardware resources.
874 * @queuing_high_bandwidth: True if multiple packets of a high-bandwidth
903 * @non_periodic_sched_inactive: Inactive QHs in the non-periodic schedule.
906 * @non_periodic_sched_active: Active QHs in the non-periodic schedule.
910 * non-periodic schedule
911 * @non_periodic_sched_waiting: Waiting QHs in the non-periodic schedule.
951 * host is in high speed mode; low speed schedules are
960 * host channel is available for non-periodic transactions.
961 * @non_periodic_channels: Number of host channels assigned to non-periodic
972 * @start_work: Delayed work for handling host A-cable connection
981 * @unaligned_cache: Kmem cache for DMA mode to handle non-aligned buf
986 * @dedicated_fifos: Set if the hardware has dedicated IN-EP fifos.
996 * @remote_wakeup_allowed: True if device is allowed to wake-up host by
997 * remote-wakeup signalling
1022 * @dumped_frame_num_array: 1 - if missed SOFs frame numbers dumbed
1023 * 0 - if missed SOFs frame numbers not dumbed
1209 val = readl(hsotg->regs + offset); in dwc2_readl()
1210 if (hsotg->needs_byte_swap) in dwc2_readl()
1218 if (hsotg->needs_byte_swap) in dwc2_writel()
1219 writel(swab32(value), hsotg->regs + offset); in dwc2_writel()
1221 writel(value, hsotg->regs + offset); in dwc2_writel()
1224 pr_info("info:: wrote %08x to %p\n", value, hsotg->regs + offset); in dwc2_writel()
1237 } while (--count); in dwc2_readl_rep()
1249 } while (--count); in dwc2_writel_rep()
1274 return (hsotg->hw_params.snpsid & 0xfff00000) == 0x55300000; in dwc2_is_iot()
1279 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55310000; in dwc2_is_fs_iot()
1284 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55320000; in dwc2_is_hs_iot()
1351 * These functions can be used before the internal hsotg->hw_params
1398 #define dwc2_is_device_connected(hsotg) (hsotg->connected)
1399 #define dwc2_is_device_enabled(hsotg) (hsotg->enabled)
1417 { hsotg->fifo_map = 0; } in dwc2_clear_fifo_map()
1487 { schedule_work(&hsotg->phy_reset_work); } in dwc2_host_schedule_phy_reset()