FreeBSD kernel usb device Code
|
#include <sys/cdefs.h>
#include "opt_bus.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/queue.h>
#include <sys/lock.h>
#include <sys/lockmgr.h>
#include <sys/condvar.h>
#include <sys/rman.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 <machine/bus.h>
#include <machine/clock.h>
#include <machine/resource.h>
#include <powerpc/include/tlb.h>
#include "opt_platform.h"
Go to the source code of this file.
Macros | |
#define | FSL_EHCI_REG_OFF 0x100 |
#define | FSL_EHCI_REG_SIZE 0x300 |
#define | SNOOP_RANGE_2GB 0x1E |
#define | PORT_POWER_MASK 0x00001000 |
Enumerations | |
enum | internal_reg { SNOOP1 = 0x400 , SNOOP2 = 0x404 , AGE_CNT_THRESH = 0x408 , SI_CTRL = 0x410 , CONTROL = 0x500 } |
enum | control_flags { USB_EN = 0x00000004 , UTMI_PHY_EN = 0x00000200 , ULPI_INT_EN = 0x00000001 } |
enum | si_ctrl_flags { FETCH_32 = 1 , FETCH_64 = 0 } |
enum | special_op_reg { USBMODE = 0x0A8 , PORTSC = 0x084 , ULPI_VIEWPORT = 0x70 } |
enum | usbmode_flags { HOST_MODE = 0x3 , DEVICE_MODE = 0x2 } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | fsl_ehci_attach (device_t self) |
static int | fsl_ehci_detach (device_t self) |
static int | fsl_ehci_probe (device_t self) |
DRIVER_MODULE (ehci, simplebus, ehci_driver, ehci_devclass, 0, 0) | |
MODULE_DEPEND (ehci, usb, 1, 1, 1) | |
static void | set_to_host_mode (ehci_softc_t *sc) |
static void | enable_usb (device_t dev, bus_space_tag_t iot, bus_space_handle_t ioh) |
static void | set_32b_prefetch (bus_space_tag_t iot, bus_space_handle_t ioh) |
static void | set_snooping (bus_space_tag_t iot, bus_space_handle_t ioh) |
static void | clear_port_power (ehci_softc_t *sc) |
Variables | |
static device_method_t | ehci_methods [] |
static driver_t | ehci_driver |
static devclass_t | ehci_devclass |
#define FSL_EHCI_REG_OFF 0x100 |
Definition at line 104 of file ehci_fsl.c.
#define FSL_EHCI_REG_SIZE 0x300 |
Definition at line 105 of file ehci_fsl.c.
#define PORT_POWER_MASK 0x00001000 |
Definition at line 150 of file ehci_fsl.c.
#define SNOOP_RANGE_2GB 0x1E |
Definition at line 132 of file ehci_fsl.c.
enum control_flags |
Enumerator | |
---|---|
USB_EN | |
UTMI_PHY_EN | |
ULPI_INT_EN |
Definition at line 120 of file ehci_fsl.c.
enum internal_reg |
Enumerator | |
---|---|
SNOOP1 | |
SNOOP2 | |
AGE_CNT_THRESH | |
SI_CTRL | |
CONTROL |
Definition at line 111 of file ehci_fsl.c.
enum si_ctrl_flags |
Enumerator | |
---|---|
FETCH_32 | |
FETCH_64 |
Definition at line 127 of file ehci_fsl.c.
enum special_op_reg |
Enumerator | |
---|---|
USBMODE | |
PORTSC | |
ULPI_VIEWPORT |
Definition at line 138 of file ehci_fsl.c.
enum usbmode_flags |
Enumerator | |
---|---|
HOST_MODE | |
DEVICE_MODE |
Definition at line 145 of file ehci_fsl.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 201 of file ehci_fsl.c.
References PORT_POWER_MASK, PORTSC, ehci_softc::sc_io_hdl, and ehci_softc::sc_io_tag.
Referenced by fsl_ehci_attach().
DRIVER_MODULE | ( | ehci | , |
simplebus | , | ||
ehci_driver | , | ||
ehci_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
Definition at line 166 of file ehci_fsl.c.
References CONTROL, dev, USB_EN, and UTMI_PHY_EN.
Referenced by fsl_ehci_attach().
|
static |
Definition at line 229 of file ehci_fsl.c.
References usb_bus::bdev, clear_port_power(), usb_bus::devices, usb_bus::devices_max, usb_bus::dma_bits, ehci_init(), ehci_interrupt(), ehci_iterate_hw_softc, EHCI_MAX_DEVICES, ehci_reset(), EHCI_SCFLG_DONEINIT, EHCI_SCFLG_DONTRESET, EHCI_SCFLG_NORESTERM, enable_usb(), fsl_ehci_detach(), FSL_EHCI_REG_OFF, FSL_EHCI_REG_SIZE, usb_bus::parent, rid, ehci_softc::sc_bus, ehci_softc::sc_devices, ehci_softc::sc_flags, ehci_softc::sc_id_vendor, ehci_softc::sc_intr_hdl, ehci_softc::sc_io_hdl, ehci_softc::sc_io_res, ehci_softc::sc_io_tag, ehci_softc::sc_irq_res, ehci_softc::sc_vendor, set_32b_prefetch(), set_snooping(), set_to_host_mode(), usb_bus_mem_alloc_all(), and USB_GET_DMA_TAG.
|
static |
Definition at line 377 of file ehci_fsl.c.
References usb_bus::bdev, ehci_detach(), EHCI_SCFLG_DONEINIT, EHCI_USBINTR, ehci_softc::sc_bus, ehci_softc::sc_flags, ehci_softc::sc_intr_hdl, ehci_softc::sc_io_hdl, ehci_softc::sc_io_res, ehci_softc::sc_io_tag, and ehci_softc::sc_irq_res.
Referenced by fsl_ehci_attach().
|
static |
Definition at line 213 of file ehci_fsl.c.
References dev.
MODULE_DEPEND | ( | ehci | , |
usb | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
|
static |
Definition at line 186 of file ehci_fsl.c.
References FETCH_32, and SI_CTRL.
Referenced by fsl_ehci_attach().
|
static |
Definition at line 193 of file ehci_fsl.c.
References SNOOP1, SNOOP2, and SNOOP_RANGE_2GB.
Referenced by fsl_ehci_attach().
|
static |
Definition at line 157 of file ehci_fsl.c.
References HOST_MODE, ehci_softc::sc_io_hdl, ehci_softc::sc_io_tag, and USBMODE.
Referenced by fsl_ehci_attach().
|
static |
Definition at line 96 of file ehci_fsl.c.
|
static |
Definition at line 90 of file ehci_fsl.c.
|
static |
Definition at line 75 of file ehci_fsl.c.