FreeBSD kernel usb device Code
dwc_otg.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dwc_otg_td
 
struct  dwc_otg_tt_info
 
struct  dwc_otg_std_temp
 
struct  dwc_otg_config_desc
 
union  dwc_otg_hub_temp
 
struct  dwc_otg_flags
 
struct  dwc_otg_profile
 
struct  dwc_otg_chan_state
 
struct  dwc_otg_softc
 

Macros

#define DWC_OTG_MAX_DEVICES   MIN(USB_MAX_DEVICES, 32)
 
#define DWC_OTG_FRAME_MASK   0x7FF
 
#define DWC_OTG_MAX_TXP   4
 
#define DWC_OTG_MAX_TXN   (0x200 * DWC_OTG_MAX_TXP)
 
#define DWC_OTG_MAX_CHANNELS   16
 
#define DWC_OTG_MAX_ENDPOINTS   16
 
#define DWC_OTG_HOST_TIMER_RATE   10 /* ms */
 
#define DWC_OTG_TT_SLOT_MAX   8
 
#define DWC_OTG_SLOT_IDLE_MAX   3
 
#define DWC_OTG_SLOT_IDLE_MIN   2
 
#define DWC_OTG_TX_MAX_FIFO_SIZE   DWC_OTG_MAX_TXN
 
#define DWC_OTG_READ_4(sc, reg)    bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg)
 
#define DWC_OTG_WRITE_4(sc, reg, data)    bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data)
 
#define DWC_CHAN_ST_START   0
 
#define DWC_CHAN_ST_WAIT_ANE   1
 
#define DWC_CHAN_ST_WAIT_S_ANE   2
 
#define DWC_CHAN_ST_WAIT_C_ANE   3
 
#define DWC_CHAN_ST_WAIT_C_PKT   4
 
#define DWC_CHAN_ST_TX_WAIT_ISOC   5
 
#define DWC_OTG_PHY_ULPI   1
 
#define DWC_OTG_PHY_HSIC   2
 
#define DWC_OTG_PHY_INTERNAL   3
 
#define DWC_OTG_PHY_UTMI   4
 
#define DWC_MODE_OTG   0 /* both modes */
 
#define DWC_MODE_DEVICE   1 /* device only */
 
#define DWC_MODE_HOST   2 /* host only */
 

Typedefs

typedef uint8_t() dwc_otg_cmd_t(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
 

Functions

int dwc_otg_init (struct dwc_otg_softc *)
 
void dwc_otg_uninit (struct dwc_otg_softc *)
 

Variables

struct dwc_otg_config_desc __packed
 
driver_filter_t dwc_otg_filter_interrupt
 
driver_intr_t dwc_otg_interrupt
 

Macro Definition Documentation

◆ DWC_CHAN_ST_START

#define DWC_CHAN_ST_START   0

Definition at line 80 of file dwc_otg.h.

◆ DWC_CHAN_ST_TX_WAIT_ISOC

#define DWC_CHAN_ST_TX_WAIT_ISOC   5

Definition at line 85 of file dwc_otg.h.

◆ DWC_CHAN_ST_WAIT_ANE

#define DWC_CHAN_ST_WAIT_ANE   1

Definition at line 81 of file dwc_otg.h.

◆ DWC_CHAN_ST_WAIT_C_ANE

#define DWC_CHAN_ST_WAIT_C_ANE   3

Definition at line 83 of file dwc_otg.h.

◆ DWC_CHAN_ST_WAIT_C_PKT

#define DWC_CHAN_ST_WAIT_C_PKT   4

Definition at line 84 of file dwc_otg.h.

◆ DWC_CHAN_ST_WAIT_S_ANE

#define DWC_CHAN_ST_WAIT_S_ANE   2

Definition at line 82 of file dwc_otg.h.

◆ DWC_MODE_DEVICE

#define DWC_MODE_DEVICE   1 /* device only */

Definition at line 212 of file dwc_otg.h.

◆ DWC_MODE_HOST

#define DWC_MODE_HOST   2 /* host only */

Definition at line 213 of file dwc_otg.h.

◆ DWC_MODE_OTG

#define DWC_MODE_OTG   0 /* both modes */

Definition at line 211 of file dwc_otg.h.

◆ DWC_OTG_FRAME_MASK

#define DWC_OTG_FRAME_MASK   0x7FF

Definition at line 33 of file dwc_otg.h.

◆ DWC_OTG_HOST_TIMER_RATE

#define DWC_OTG_HOST_TIMER_RATE   10 /* ms */

Definition at line 38 of file dwc_otg.h.

◆ DWC_OTG_MAX_CHANNELS

#define DWC_OTG_MAX_CHANNELS   16

Definition at line 36 of file dwc_otg.h.

◆ DWC_OTG_MAX_DEVICES

#define DWC_OTG_MAX_DEVICES   MIN(USB_MAX_DEVICES, 32)

Definition at line 32 of file dwc_otg.h.

◆ DWC_OTG_MAX_ENDPOINTS

#define DWC_OTG_MAX_ENDPOINTS   16

Definition at line 37 of file dwc_otg.h.

◆ DWC_OTG_MAX_TXN

#define DWC_OTG_MAX_TXN   (0x200 * DWC_OTG_MAX_TXP)

Definition at line 35 of file dwc_otg.h.

◆ DWC_OTG_MAX_TXP

#define DWC_OTG_MAX_TXP   4

Definition at line 34 of file dwc_otg.h.

◆ DWC_OTG_PHY_HSIC

#define DWC_OTG_PHY_HSIC   2

Definition at line 199 of file dwc_otg.h.

◆ DWC_OTG_PHY_INTERNAL

#define DWC_OTG_PHY_INTERNAL   3

Definition at line 200 of file dwc_otg.h.

◆ DWC_OTG_PHY_ULPI

#define DWC_OTG_PHY_ULPI   1

Definition at line 198 of file dwc_otg.h.

◆ DWC_OTG_PHY_UTMI

#define DWC_OTG_PHY_UTMI   4

Definition at line 201 of file dwc_otg.h.

◆ DWC_OTG_READ_4

#define DWC_OTG_READ_4 (   sc,
  reg 
)     bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg)

Definition at line 46 of file dwc_otg.h.

◆ DWC_OTG_SLOT_IDLE_MAX

#define DWC_OTG_SLOT_IDLE_MAX   3

Definition at line 40 of file dwc_otg.h.

◆ DWC_OTG_SLOT_IDLE_MIN

#define DWC_OTG_SLOT_IDLE_MIN   2

Definition at line 41 of file dwc_otg.h.

◆ DWC_OTG_TT_SLOT_MAX

#define DWC_OTG_TT_SLOT_MAX   8

Definition at line 39 of file dwc_otg.h.

◆ DWC_OTG_TX_MAX_FIFO_SIZE

#define DWC_OTG_TX_MAX_FIFO_SIZE   DWC_OTG_MAX_TXN

Definition at line 43 of file dwc_otg.h.

◆ DWC_OTG_WRITE_4

#define DWC_OTG_WRITE_4 (   sc,
  reg,
  data 
)     bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data)

Definition at line 49 of file dwc_otg.h.

Typedef Documentation

◆ dwc_otg_cmd_t

typedef uint8_t() dwc_otg_cmd_t(struct dwc_otg_softc *sc, struct dwc_otg_td *td)

Definition at line 55 of file dwc_otg.h.

Function Documentation

◆ dwc_otg_init()

int dwc_otg_init ( struct dwc_otg_softc sc)

Definition at line 3836 of file dwc_otg.c.

References usb_bus::bdev, usb_bus::bus_mtx, DCTL_CGNPINNAK, DCTL_CGOUTNAK, DCTL_SFTDISCON, usb_bus::devices, usb_bus::devices_max, DIEPMSK_XFERCOMPLMSK, usb_bus::dma_bits, DOTG_DAINTMSK, DOTG_DCTL, DOTG_DEACHINTMSK, DOTG_DIEPEACHINTMSK, DOTG_DIEPMSK, DOTG_DOEPEACHINTMSK, DOTG_DOEPMSK, DOTG_GAHBCFG, DOTG_GGPIO, DOTG_GGPIO_I2CPADEN, DOTG_GGPIO_NOVBUSSENS, DOTG_GGPIO_PWRDWN, DOTG_GGPIO_VBUSASEN, DOTG_GGPIO_VBUSBSEN, DOTG_GHWCFG2, DOTG_GHWCFG3, DOTG_GHWCFG4, DOTG_GINTMSK, DOTG_GLPMCFG, DOTG_GOTGCTL, DOTG_GRSTCTL, DOTG_GSNPSID, DOTG_GUSBCFG, DOTG_HCFG, DOTG_PCGCCTL, DPRINTF, DWC_MODE_DEVICE, DWC_MODE_HOST, DWC_MODE_OTG, dwc_otg_bus_methods, dwc_otg_clocks_off(), dwc_otg_clocks_on(), dwc_otg_do_poll(), dwc_otg_filter_interrupt(), dwc_otg_init_fifo(), dwc_otg_interrupt(), DWC_OTG_MAX_CHANNELS, DWC_OTG_MAX_DEVICES, DWC_OTG_MAX_ENDPOINTS, DWC_OTG_MSK_GINT_THREAD_IRQ, DWC_OTG_PHY_HSIC, DWC_OTG_PHY_INTERNAL, dwc_otg_phy_type, DWC_OTG_PHY_ULPI, DWC_OTG_PHY_UTMI, DWC_OTG_READ_4, dwc_otg_vbus_interrupt(), DWC_OTG_WRITE_4, GAHBCFG_GLBLINTRMSK, GHWCFG2_MPI, GHWCFG2_NUMDEVEPS_GET, GHWCFG2_NUMHSTCHNL_GET, GHWCFG3_DFIFODEPTH_GET, GHWCFG4_NUM_IN_EP_GET, GLPMCFG_HSIC_CONN, GOTGCTL_ASESVLD, GOTGCTL_BSESVLD, GRSTCTL_CSFTRST, GUSBCFG_FORCEDEVMODE, GUSBCFG_FORCEHOSTMODE, GUSBCFG_PHYIF, GUSBCFG_PHYSEL, GUSBCFG_TRD_TIM_SET, GUSBCFG_ULPI_UTMI_SEL, HCFG_FSLSPCLKSEL_MASK, HCFG_FSLSPCLKSEL_SHIFT, HCFG_FSLSSUPP, usb_bus::methods, usb_bus::parent, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_dev_ep_max, dwc_otg_softc::sc_dev_in_ep_max, dwc_otg_softc::sc_devices, dwc_otg_softc::sc_fifo_size, dwc_otg_softc::sc_host_ch_max, dwc_otg_softc::sc_intr_hdl, dwc_otg_softc::sc_io_hdl, dwc_otg_softc::sc_io_res, dwc_otg_softc::sc_io_size, dwc_otg_softc::sc_io_tag, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_irq_res, dwc_otg_softc::sc_mode, dwc_otg_softc::sc_phy_bits, dwc_otg_softc::sc_phy_type, dwc_otg_softc::sc_timer, USB_BUS_LOCK, usb_bus_mem_alloc_all(), USB_BUS_UNLOCK, usb_callout_init_mtx, USB_GET_DMA_TAG, usb_pause_mtx(), USB_REV_2_0, and usb_bus::usbrev.

Referenced by dwc_otg_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dwc_otg_uninit()

Variable Documentation

◆ __packed

◆ dwc_otg_filter_interrupt

driver_filter_t dwc_otg_filter_interrupt

Definition at line 222 of file dwc_otg.h.

◆ dwc_otg_interrupt

driver_intr_t dwc_otg_interrupt

Definition at line 223 of file dwc_otg.h.