summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/dwc_otg_fdt.c
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2015-03-08 13:52:07 +0000
committerandrew <andrew@FreeBSD.org>2015-03-08 13:52:07 +0000
commita542258e7db83d5be1c791fbb0a8614f792bb6d6 (patch)
tree3db71de85fc78d654160fe9d63c54d87bbf0d3b2 /sys/dev/usb/controller/dwc_otg_fdt.c
parentcb8a3dcc1e39d1c66b678c8e818e76978cb5df0b (diff)
downloadFreeBSD-src-a542258e7db83d5be1c791fbb0a8614f792bb6d6.zip
FreeBSD-src-a542258e7db83d5be1c791fbb0a8614f792bb6d6.tar.gz
Add support for enabling the USB on the Raspberry Pi boards when it hasn't
been done by U-Boot. This allows the USB to work when we load the kernel directly. No dma sync is performed after these operations as the data we read/write is not used by the cpu after the calls to the maimbox driver. Differential Revision: https://reviews.freebsd.org/D1940 Reviewed by: imp, Michal Meloun (meloun AT miracle.cz) MFC after: 1 Week Sponsored by: ABT Systems Ltd
Diffstat (limited to 'sys/dev/usb/controller/dwc_otg_fdt.c')
-rw-r--r--sys/dev/usb/controller/dwc_otg_fdt.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/usb/controller/dwc_otg_fdt.c b/sys/dev/usb/controller/dwc_otg_fdt.c
index a6209ff..73df72e 100644
--- a/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -53,15 +53,11 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/dwc_otg.h>
+#include <dev/usb/controller/dwc_otg_fdt.h>
static device_probe_t dwc_otg_probe;
-static device_attach_t dwc_otg_attach;
static device_detach_t dwc_otg_detach;
-struct dwc_otg_super_softc {
- struct dwc_otg_softc sc_otg; /* must be first */
-};
-
static int
dwc_otg_probe(device_t dev)
{
@@ -74,13 +70,13 @@ dwc_otg_probe(device_t dev)
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller");
- return (0);
+ return (BUS_PROBE_DEFAULT);
}
-static int
+int
dwc_otg_attach(device_t dev)
{
- struct dwc_otg_super_softc *sc = device_get_softc(dev);
+ struct dwc_otg_fdt_softc *sc = device_get_softc(dev);
char usb_mode[24];
int err;
int rid;
@@ -161,7 +157,7 @@ error:
static int
dwc_otg_detach(device_t dev)
{
- struct dwc_otg_super_softc *sc = device_get_softc(dev);
+ struct dwc_otg_fdt_softc *sc = device_get_softc(dev);
device_t bdev;
int err;
@@ -212,10 +208,10 @@ static device_method_t dwc_otg_methods[] = {
DEVMETHOD_END
};
-static driver_t dwc_otg_driver = {
+driver_t dwc_otg_driver = {
.name = "dwcotg",
.methods = dwc_otg_methods,
- .size = sizeof(struct dwc_otg_super_softc),
+ .size = sizeof(struct dwc_otg_fdt_softc),
};
static devclass_t dwc_otg_devclass;
OpenPOWER on IntegriCloud