Deleted Added
sdiff udiff text old ( 227849 ) new ( 228483 )
full compact
1/*-
2 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
3 * All rights reserved.
4 *
5 * Developed by Semihalf.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 20 unchanged lines hidden (view full) ---

29 * SUCH DAMAGE.
30 */
31
32/*
33 * FDT attachment driver for the USB Enhanced Host Controller.
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ehci_mv.c 228483 2011-12-14 00:28:54Z hselasky $");
38
39#include "opt_bus.h"
40
41#include <sys/stdint.h>
42#include <sys/stddef.h>
43#include <sys/param.h>
44#include <sys/queue.h>
45#include <sys/types.h>

--- 30 unchanged lines hidden (view full) ---

76#include <arm/mv/mvreg.h>
77#include <arm/mv/mvvar.h>
78
79#define EHCI_VENDORID_MRVL 0x1286
80#define EHCI_HC_DEVSTR "Marvell Integrated USB 2.0 controller"
81
82static device_attach_t mv_ehci_attach;
83static device_detach_t mv_ehci_detach;
84
85static int err_intr(void *arg);
86
87static struct resource *irq_err;
88static void *ih_err;
89
90/* EHCI HC regs start at this offset within USB range */
91#define MV_USB_HOST_OFST 0x0100
92
93#define USB_BRIDGE_INTR_CAUSE 0x210
94#define USB_BRIDGE_INTR_MASK 0x214
95#define USB_BRIDGE_ERR_ADDR 0x21C
96
97#define MV_USB_ADDR_DECODE_ERR (1 << 0)
98#define MV_USB_HOST_UNDERFLOW (1 << 1)
99#define MV_USB_HOST_OVERFLOW (1 << 2)
100#define MV_USB_DEVICE_UNDERFLOW (1 << 3)
101
102static int
103mv_ehci_probe(device_t self)
104{
105
106 if (!ofw_bus_is_compatible(self, "mrvl,usb-ehci"))
107 return (ENXIO);
108
109 device_set_desc(self, EHCI_HC_DEVSTR);
110

--- 214 unchanged lines hidden (view full) ---

325 return (FILTER_HANDLED);
326}
327
328static device_method_t ehci_methods[] = {
329 /* Device interface */
330 DEVMETHOD(device_probe, mv_ehci_probe),
331 DEVMETHOD(device_attach, mv_ehci_attach),
332 DEVMETHOD(device_detach, mv_ehci_detach),
333 DEVMETHOD(device_suspend, bus_generic_suspend),
334 DEVMETHOD(device_resume, bus_generic_resume),
335 DEVMETHOD(device_shutdown, bus_generic_shutdown),
336
337 DEVMETHOD_END
338};
339
340static driver_t ehci_driver = {
341 "ehci",
342 ehci_methods,
343 sizeof(ehci_softc_t),
344};
345
346static devclass_t ehci_devclass;
347
348DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0);
349MODULE_DEPEND(ehci, usb, 1, 1, 1);