FreeBSD kernel usb device Code
dwc3.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/condvar.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/gpio.h>
#include <machine/bus.h>
#include <dev/fdt/simplebus.h>
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/ofw_subr.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_busdma.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/xhci.h>
#include <dev/usb/controller/dwc3.h>
#include <dev/extres/clk/clk.h>
#include <dev/extres/phy/phy_usb.h>
#include "generic_xhci.h"
Include dependency graph for dwc3.c:

Go to the source code of this file.

Data Structures

struct  snps_dwc3_softc
 

Macros

#define DWC3_WRITE(_sc, _off, _val)    bus_space_write_4(_sc->bst, _sc->bsh, _off, _val)
 
#define DWC3_READ(_sc, _off)    bus_space_read_4(_sc->bst, _sc->bsh, _off)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int snps_dwc3_attach_xhci (device_t dev)
 
static void snps_dwc3_reset (struct snps_dwc3_softc *sc)
 
static void snps_dwc3_configure_host (struct snps_dwc3_softc *sc)
 
static void snps_dwc3_configure_phy (struct snps_dwc3_softc *sc)
 
static void snps_dwc3_do_quirks (struct snps_dwc3_softc *sc)
 
static int snps_dwc3_probe (device_t dev)
 
static int snps_dwc3_attach (device_t dev)
 
 DRIVER_MODULE (snps_dwc3, simplebus, snps_dwc3_driver, snps_dwc3_devclass, 0, 0)
 
 MODULE_DEPEND (snps_dwc3, xhci, 1, 1, 1)
 

Variables

static struct ofw_compat_data compat_data []
 
static device_method_t snps_dwc3_methods []
 
static driver_t snps_dwc3_driver
 
static devclass_t snps_dwc3_devclass
 

Macro Definition Documentation

◆ DWC3_READ

#define DWC3_READ (   _sc,
  _off 
)     bus_space_read_4(_sc->bst, _sc->bsh, _off)

Definition at line 87 of file dwc3.c.

◆ DWC3_WRITE

#define DWC3_WRITE (   _sc,
  _off,
  _val 
)     bus_space_write_4(_sc->bst, _sc->bsh, _off, _val)

Definition at line 85 of file dwc3.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( snps_dwc3  ,
simplebus  ,
snps_dwc3_driver  ,
snps_dwc3_devclass  ,
,
 
)

◆ MODULE_DEPEND()

MODULE_DEPEND ( snps_dwc3  ,
xhci  ,
,
,
 
)

◆ snps_dwc3_attach()

static int snps_dwc3_attach ( device_t  dev)
static

◆ snps_dwc3_attach_xhci()

◆ snps_dwc3_configure_host()

static void snps_dwc3_configure_host ( struct snps_dwc3_softc sc)
static

Definition at line 205 of file dwc3.c.

References DWC3_GCTL, DWC3_GCTL_PRTCAPDIR_HOST, DWC3_READ, DWC3_WRITE, and reg.

Referenced by snps_dwc3_attach().

Here is the caller graph for this function:

◆ snps_dwc3_configure_phy()

static void snps_dwc3_configure_phy ( struct snps_dwc3_softc sc)
static

◆ snps_dwc3_do_quirks()

◆ snps_dwc3_probe()

static int snps_dwc3_probe ( device_t  dev)
static

Definition at line 277 of file dwc3.c.

References compat_data, snps_dwc3_softc::dev, and snps_dwc3_softc::sc.

◆ snps_dwc3_reset()

static void snps_dwc3_reset ( struct snps_dwc3_softc sc)
static

Variable Documentation

◆ compat_data

struct ofw_compat_data compat_data[]
static
Initial value:
= {
{ "snps,dwc3", 1 },
{ NULL, 0 }
}

Definition at line 68 of file dwc3.c.

Referenced by snps_dwc3_probe().

◆ snps_dwc3_devclass

devclass_t snps_dwc3_devclass
static

Definition at line 350 of file dwc3.c.

◆ snps_dwc3_driver

driver_t snps_dwc3_driver
static
Initial value:
= {
"xhci",
sizeof(struct snps_dwc3_softc)
}
static device_method_t snps_dwc3_methods[]
Definition: dwc3.c:336

Definition at line 344 of file dwc3.c.

◆ snps_dwc3_methods

device_method_t snps_dwc3_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, snps_dwc3_probe),
DEVMETHOD(device_attach, snps_dwc3_attach),
DEVMETHOD_END
}
static int snps_dwc3_probe(device_t dev)
Definition: dwc3.c:277
static int snps_dwc3_attach(device_t dev)
Definition: dwc3.c:300

Definition at line 336 of file dwc3.c.