Lines Matching +full:default +full:- +full:mode

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__)
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
219 * @host_dma: Specifies whether to use slave or DMA mode for accessing
222 * 0 - Slave (always available)
223 * 1 - DMA (default, if available)
224 * @dma_desc_enable: When DMA mode is enabled, specifies whether to use
225 * address DMA mode or descriptor DMA mode for accessing
228 * 0 - Address DMA
229 * 1 - Descriptor DMA (default, if available)
230 * @dma_desc_fs_enable: When DMA mode is enabled, specifies whether to use
231 * address DMA mode or descriptor DMA mode for accessing
232 * the data FIFOs in Full Speed mode only. The driver
235 * 0 - Address DMA
236 * 1 - Descriptor DMA in FS (default, if available)
238 * device mode. The actual speed depends on the speed of
240 * 0 - High Speed
241 * (default when phy_type is UTMI+ or ULPI)
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
248 * mode.
249 * @host_rx_fifo_size: Number of 4-byte words in the Rx FIFO in host mode when
253 * the default.
254 * @host_nperio_tx_fifo_size: Number of 4-byte words in the non-periodic Tx FIFO
255 * in host mode when dynamic FIFO sizing is enabled
258 * the default.
259 * @host_perio_tx_fifo_size: Number of 4-byte words in the periodic Tx FIFO in
260 * host mode when dynamic FIFO sizing is enabled
263 * the default.
267 * the default.
271 * the default.
275 * the default.
276 * @phy_type: Specifies the type of PHY interface to use. By default,
278 * 0 - Full Speed Phy
279 * 1 - UTMI+ Phy
280 * 2 - ULPI Phy
290 * 8 or 16 (default 16 if available)
294 * 0 - single data rate ULPI interface with 8 bit wide
295 * data bus (default)
296 * 1 - double data rate ULPI interface with 4 bit wide
300 * 0 - Internal supply (default)
301 * 1 - External supply
305 * 0 - No (default)
306 * 1 - Yes
308 * 0 - Disable (default)
309 * 1 - Enable
311 * 0 - No
312 * 1 - Yes
313 * @ulpi_fs_ls: Make ULPI phy operate in FS/LS mode only
314 * 0 - No (default)
315 * 1 - Yes
316 * @host_support_fs_ls_low_power: Specifies whether low power mode is supported
318 * host mode.
319 * 0 - Don't support low power mode (default)
320 * 1 - Support low power mode
321 * @host_ls_low_power_phy_clk: Specifies the PHY clock rate in low power mode
323 * mode. This parameter is applicable only if
325 * 0 - 48 MHz
326 * (default when phy_type is UTMI+ or ULPI)
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)
338 * @ahbcfg: This field allows the default value of the GAHBCFG
340 * -1 - GAHBCFG value will be set to 0x06
341 * (INCR, default)
342 * all others - GAHBCFG value will be overridden with
352 * 0 - No (default)
353 * 1 - Yes
356 * power_down in both peripheral and host mode when
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)
403 * @g_dma: Enables gadget dma usage (default: autodetect).
404 * @g_dma_desc: Enables gadget descriptor DMA (default: autodetect).
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
412 * mode. Each value corresponds to one EP
415 * 16-32768 (default: 256, 256, 256, 256, 768,
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
430 * default described above.
505 * struct dwc2_hw_params - Autodetected parameters.
514 * @op_mode: Mode of Operation
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
537 * @dev_token_q_depth: Device Mode IN Token Sequence Learning Queue
541 * Host Mode Periodic Request Queue Depth
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
565 * @dma_desc_enable: When DMA mode is enabled, specifies whether to use
566 * address DMA mode or descriptor DMA mode for accessing
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
575 * mode.
576 * @host_nperio_tx_fifo_size: Number of 4-byte words in the non-periodic Tx FIFO
577 * in host mode when dynamic FIFO sizing is enabled
580 * the default.
581 * @host_perio_tx_fifo_size: Number of 4-byte words in the periodic Tx FIFO in
582 * host mode when dynamic FIFO sizing is enabled
585 * the default.
589 * the default.
593 * the default.
597 * the default.
598 * @dev_nperio_tx_fifo_size: Number of 4-byte words in the non-periodic Tx FIFO
599 * in device mode when dynamic FIFO sizing is enabled
602 * the default.
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
617 * the default.
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
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
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
842 * @dr_mode: Requested mode of operation, one of following:
843 * - USB_DR_MODE_PERIPHERAL
844 * - USB_DR_MODE_HOST
845 * - USB_DR_MODE_OTG
847 * @role_sw_default_mode: default operation mode of controller while usb role
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.
853 * @in_ppd: True if core is partial power down mode.
874 * @queuing_high_bandwidth: True if multiple packets of a high-bandwidth
888 * These are for host mode:
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
983 * These are for peripheral mode:
986 * @dedicated_fifos: Set if the hardware has dedicated IN-EP fifos.
995 * @test_mode: USB test mode requested by the host
996 * @remote_wakeup_allowed: True if device is allowed to wake-up host by
997 * remote-wakeup signalling
1021 * @dumped_frame_num_array: 1 - if missed SOFs frame numbers dumbed
1022 * 0 - if missed SOFs frame numbers not dumbed
1027 * @connected: Used in slave mode. True if device connected with host
1030 * @new_connection: Used in host mode. True if there are new connected
1207 val = readl(hsotg->regs + offset); in dwc2_readl()
1208 if (hsotg->needs_byte_swap) in dwc2_readl()
1216 if (hsotg->needs_byte_swap) in dwc2_writel()
1217 writel(swab32(value), hsotg->regs + offset); in dwc2_writel()
1219 writel(value, hsotg->regs + offset); in dwc2_writel()
1222 pr_info("info:: wrote %08x to %p\n", value, hsotg->regs + offset); in dwc2_writel()
1235 } while (--count); in dwc2_readl_rep()
1247 } while (--count); in dwc2_writel_rep()
1272 return (hsotg->hw_params.snpsid & 0xfff00000) == 0x55300000; in dwc2_is_iot()
1277 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55310000; in dwc2_is_fs_iot()
1282 return (hsotg->hw_params.snpsid & 0xffff0000) == 0x55320000; in dwc2_is_hs_iot()
1309 * device or host mode.
1345 * The following functions check the controller's OTG operation mode
1348 * These functions can be used before the internal hsotg->hw_params
1358 * Returns the mode of operation, host or device
1395 #define dwc2_is_device_connected(hsotg) (hsotg->connected)
1396 #define dwc2_is_device_enabled(hsotg) (hsotg->enabled)
1414 { hsotg->fifo_map = 0; } in dwc2_clear_fifo_map()
1484 { schedule_work(&hsotg->phy_reset_work); } in dwc2_host_schedule_phy_reset()