Page MenuHomeFreeBSD

D19986.1791059767.diff
No OneTemporary

Size
4 KB
Referenced Files
None
Subscribers
None

D19986.1791059767.diff

Index: sys/arm64/conf/GENERIC
===================================================================
--- sys/arm64/conf/GENERIC
+++ sys/arm64/conf/GENERIC
@@ -205,7 +205,7 @@
device ohci # OHCI USB interface
device ehci # EHCI USB interface (USB 2.0)
device ehci_mv # Marvell EHCI USB interface
-device xhci # XHCI PCI->USB interface (USB 3.0)
+device xhci # XHCI USB interface (USB 3.0)
device usb # USB Bus (required)
device ukbd # Keyboard
device umass # Disks/Mass storage - Requires scbus and da
Index: sys/conf/files.arm64
===================================================================
--- sys/conf/files.arm64
+++ sys/conf/files.arm64
@@ -265,7 +265,7 @@
dev/usb/controller/generic_ohci.c optional ohci fdt
dev/usb/controller/generic_usb_if.m optional ohci fdt
dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources
-dev/usb/controller/generic_xhci.c optional xhci fdt
+dev/usb/controller/generic_xhci.c optional xhci
dev/vnic/mrml_bridge.c optional vnic fdt
dev/vnic/nic_main.c optional vnic pci
dev/vnic/nicvf_main.c optional vnic pci pci_iov
Index: sys/dev/usb/controller/generic_xhci.c
===================================================================
--- sys/dev/usb/controller/generic_xhci.c
+++ sys/dev/usb/controller/generic_xhci.c
@@ -28,7 +28,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_bus.h"
+#include "opt_acpi.h"
+#include "opt_platform.h"
#include <sys/stdint.h>
#include <sys/stddef.h>
@@ -48,8 +49,10 @@
#include <sys/priv.h>
#include <sys/rman.h>
+#ifdef FDT
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
+#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -68,14 +71,20 @@
#include <dev/extres/phy/phy.h>
#endif
-#define XHCI_HC_DEVSTR "Marvell Integrated USB 3.0 controller"
-#define XHCI_HC_VENDOR "Marvell"
+#ifdef DEV_ACPI
+#include <contrib/dev/acpica/include/acpi.h>
+#include <dev/acpica/acpivar.h>
+#endif
+
+#define XHCI_HC_DEVSTR "Generic USB 3.0 controller"
+#define XHCI_HC_VENDOR "Generic"
#define IS_DMA_32B 1
static device_attach_t xhci_attach;
static device_detach_t xhci_detach;
+#ifdef FDT
static struct ofw_compat_data compat_data[] = {
{"marvell,armada-380-xhci", true},
{"marvell,armada3700-xhci", true},
@@ -85,7 +94,7 @@
};
static int
-xhci_probe(device_t dev)
+xhci_fdt_probe(device_t dev)
{
if (!ofw_bus_status_okay(dev))
@@ -98,6 +107,22 @@
return (BUS_PROBE_DEFAULT);
}
+#endif
+
+#ifdef DEV_ACPI
+static int
+xhci_acpi_probe(device_t dev)
+{
+ ACPI_HANDLE h;
+
+ if ((h = acpi_get_handle(dev)) == NULL ||
+ acpi_MatchHid(h, "PNP0D10") == ACPI_MATCHHID_NOMATCH)
+ return (ENXIO);
+
+ device_set_desc_copy(dev, XHCI_HC_DEVSTR);
+ return (BUS_PROBE_DEFAULT);
+}
+#endif
static int
xhci_attach(device_t dev)
@@ -219,9 +244,10 @@
return (0);
}
-static device_method_t xhci_methods[] = {
+#ifdef FDT
+static device_method_t xhci_fdt_methods[] = {
/* Device interface */
- DEVMETHOD(device_probe, xhci_probe),
+ DEVMETHOD(device_probe, xhci_fdt_probe),
DEVMETHOD(device_attach, xhci_attach),
DEVMETHOD(device_detach, xhci_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
@@ -231,13 +257,39 @@
DEVMETHOD_END
};
-static driver_t xhci_driver = {
+static driver_t xhci_fdt_driver = {
"xhci",
- xhci_methods,
+ xhci_fdt_methods,
sizeof(struct xhci_softc),
};
-static devclass_t xhci_devclass;
+static devclass_t xhci_fdt_devclass;
-DRIVER_MODULE(xhci, simplebus, xhci_driver, xhci_devclass, 0, 0);
-MODULE_DEPEND(xhci, usb, 1, 1, 1);
+DRIVER_MODULE(xhci_fdt, simplebus, xhci_fdt_driver, xhci_fdt_devclass, 0, 0);
+MODULE_DEPEND(xhci_fdt, usb, 1, 1, 1);
+#endif
+
+#ifdef DEV_ACPI
+static device_method_t xhci_acpi_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, xhci_acpi_probe),
+ DEVMETHOD(device_attach, xhci_attach),
+ DEVMETHOD(device_detach, xhci_detach),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+
+ DEVMETHOD_END
+};
+
+static driver_t xhci_acpi_driver = {
+ "xhci",
+ xhci_acpi_methods,
+ sizeof(struct xhci_softc),
+};
+
+static devclass_t xhci_acpi_devclass;
+
+DRIVER_MODULE(xhci_acpi, acpi, xhci_acpi_driver, xhci_acpi_devclass, 0, 0);
+MODULE_DEPEND(xhci_acpi, usb, 1, 1, 1);
+#endif

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 3, 8:36 PM (9 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30138644
Default Alt Text
D19986.1791059767.diff (4 KB)

Event Timeline