FreeBSD kernel usb device Code
ehci_mv.c File Reference
#include <sys/cdefs.h>
#include "opt_bus.h"
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_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_util.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/ehci.h>
#include <dev/usb/controller/ehcireg.h>
#include <arm/mv/mvreg.h>
#include <arm/mv/mvvar.h>
Include dependency graph for ehci_mv.c:

Go to the source code of this file.

Macros

#define EHCI_VENDORID_MRVL   0x1286
 
#define EHCI_HC_DEVSTR   "Marvell Integrated USB 2.0 controller"
 
#define MV_USB_HOST_OFST   0x0100
 
#define USB_BRIDGE_INTR_CAUSE   0x210
 
#define USB_BRIDGE_INTR_MASK   0x214
 
#define USB_BRIDGE_ERR_ADDR   0x21C
 
#define MV_USB_ADDR_DECODE_ERR   (1 << 0)
 
#define MV_USB_HOST_UNDERFLOW   (1 << 1)
 
#define MV_USB_HOST_OVERFLOW   (1 << 2)
 
#define MV_USB_DEVICE_UNDERFLOW   (1 << 3)
 

Enumerations

enum  mv_ehci_hwtype { HWTYPE_NONE = 0 , HWTYPE_MV_EHCI_V1 , HWTYPE_MV_EHCI_V2 }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int err_intr (void *arg)
 
static void mv_ehci_post_reset (struct ehci_softc *ehci_softc)
 
static int mv_ehci_probe (device_t self)
 
static int mv_ehci_attach (device_t self)
 
static int mv_ehci_detach (device_t self)
 
 DRIVER_MODULE (ehci_mv, simplebus, ehci_driver, ehci_devclass, 0, 0)
 
 MODULE_DEPEND (ehci_mv, usb, 1, 1, 1)
 

Variables

static device_attach_t mv_ehci_attach
 
static device_detach_t mv_ehci_detach
 
static struct resource * irq_err
 
static void * ih_err
 
static struct ofw_compat_data compat_data []
 
static device_method_t ehci_methods []
 
static driver_t ehci_driver
 
static devclass_t ehci_devclass
 

Macro Definition Documentation

◆ EHCI_HC_DEVSTR

#define EHCI_HC_DEVSTR   "Marvell Integrated USB 2.0 controller"

Definition at line 84 of file ehci_mv.c.

◆ EHCI_VENDORID_MRVL

#define EHCI_VENDORID_MRVL   0x1286

Definition at line 83 of file ehci_mv.c.

◆ MV_USB_ADDR_DECODE_ERR

#define MV_USB_ADDR_DECODE_ERR   (1 << 0)

Definition at line 101 of file ehci_mv.c.

◆ MV_USB_DEVICE_UNDERFLOW

#define MV_USB_DEVICE_UNDERFLOW   (1 << 3)

Definition at line 104 of file ehci_mv.c.

◆ MV_USB_HOST_OFST

#define MV_USB_HOST_OFST   0x0100

Definition at line 95 of file ehci_mv.c.

◆ MV_USB_HOST_OVERFLOW

#define MV_USB_HOST_OVERFLOW   (1 << 2)

Definition at line 103 of file ehci_mv.c.

◆ MV_USB_HOST_UNDERFLOW

#define MV_USB_HOST_UNDERFLOW   (1 << 1)

Definition at line 102 of file ehci_mv.c.

◆ USB_BRIDGE_ERR_ADDR

#define USB_BRIDGE_ERR_ADDR   0x21C

Definition at line 99 of file ehci_mv.c.

◆ USB_BRIDGE_INTR_CAUSE

#define USB_BRIDGE_INTR_CAUSE   0x210

Definition at line 97 of file ehci_mv.c.

◆ USB_BRIDGE_INTR_MASK

#define USB_BRIDGE_INTR_MASK   0x214

Definition at line 98 of file ehci_mv.c.

Enumeration Type Documentation

◆ mv_ehci_hwtype

Enumerator
HWTYPE_NONE 
HWTYPE_MV_EHCI_V1 
HWTYPE_MV_EHCI_V2 

Definition at line 106 of file ehci_mv.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( ehci_mv  ,
simplebus  ,
ehci_driver  ,
ehci_devclass  ,
,
 
)

◆ err_intr()

static int err_intr ( void *  arg)
static

Definition at line 337 of file ehci_mv.c.

References addr, EREAD4, EWRITE4, MV_USB_ADDR_DECODE_ERR, MV_USB_DEVICE_UNDERFLOW, MV_USB_HOST_OVERFLOW, MV_USB_HOST_UNDERFLOW, USB_BRIDGE_ERR_ADDR, and USB_BRIDGE_INTR_CAUSE.

Referenced by mv_ehci_attach().

Here is the caller graph for this function:

◆ MODULE_DEPEND()

MODULE_DEPEND ( ehci_mv  ,
usb  ,
,
,
 
)

◆ mv_ehci_attach()

◆ mv_ehci_detach()

static int mv_ehci_detach ( device_t  self)
static

◆ mv_ehci_post_reset()

static void mv_ehci_post_reset ( struct ehci_softc ehci_softc)
static

Definition at line 120 of file ehci_mv.c.

References EHCI_UM_CM_HOST, EHCI_USBMODE_NOLPM, EOREAD4, and EOWRITE4.

Referenced by mv_ehci_attach().

Here is the caller graph for this function:

◆ mv_ehci_probe()

static int mv_ehci_probe ( device_t  self)
static

Definition at line 132 of file ehci_mv.c.

References compat_data, and EHCI_HC_DEVSTR.

Variable Documentation

◆ compat_data

struct ofw_compat_data compat_data[]
static
Initial value:
= {
{"mrvl,usb-ehci", HWTYPE_MV_EHCI_V1},
{"marvell,orion-ehci", HWTYPE_MV_EHCI_V2},
{"marvell,armada-3700-ehci", HWTYPE_MV_EHCI_V2},
{NULL, HWTYPE_NONE}
}
@ HWTYPE_MV_EHCI_V1
Definition: ehci_mv.c:108
@ HWTYPE_NONE
Definition: ehci_mv.c:107
@ HWTYPE_MV_EHCI_V2
Definition: ehci_mv.c:109

Definition at line 112 of file ehci_mv.c.

Referenced by mv_ehci_attach(), and mv_ehci_probe().

◆ ehci_devclass

devclass_t ehci_devclass
static

Definition at line 384 of file ehci_mv.c.

◆ ehci_driver

driver_t ehci_driver
static
Initial value:
= {
"ehci",
sizeof(ehci_softc_t),
}
struct ehci_softc ehci_softc_t
static device_method_t ehci_methods[]
Definition: ehci_mv.c:366

Definition at line 378 of file ehci_mv.c.

◆ ehci_methods

device_method_t ehci_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, mv_ehci_probe),
DEVMETHOD(device_attach, mv_ehci_attach),
DEVMETHOD(device_detach, mv_ehci_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD_END
}
static int mv_ehci_probe(device_t self)
Definition: ehci_mv.c:132
static device_detach_t mv_ehci_detach
Definition: ehci_mv.c:87
static device_attach_t mv_ehci_attach
Definition: ehci_mv.c:86

Definition at line 366 of file ehci_mv.c.

◆ ih_err

void* ih_err
static

Definition at line 92 of file ehci_mv.c.

Referenced by mv_ehci_attach(), and mv_ehci_detach().

◆ irq_err

struct resource* irq_err
static

Definition at line 91 of file ehci_mv.c.

Referenced by mv_ehci_attach(), and mv_ehci_detach().

◆ mv_ehci_attach

device_attach_t mv_ehci_attach
static

Definition at line 86 of file ehci_mv.c.

◆ mv_ehci_detach

device_detach_t mv_ehci_detach
static

Definition at line 87 of file ehci_mv.c.

Referenced by mv_ehci_attach().