1/*-
2 * Copyright (c) 2008 Sam Leffler. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
--- 13 unchanged lines hidden (view full) ---
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25/*
26 * IXP435 attachment driver for the USB Enhanced Host Controller.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ehci_ixp4xx.c 228483 2011-12-14 00:28:54Z hselasky $");
31
32#include "opt_bus.h"
33
34#include <sys/stdint.h>
35#include <sys/stddef.h>
36#include <sys/param.h>
37#include <sys/queue.h>
38#include <sys/types.h>
--- 34 unchanged lines hidden (view full) ---
73 ehci_softc_t base; /* storage for EHCI code */
74 bus_space_tag_t iot;
75 bus_space_handle_t ioh;
76 struct bus_space tag; /* tag for private bus space ops */
77};
78
79static device_attach_t ehci_ixp_attach;
80static device_detach_t ehci_ixp_detach;
81
82static uint8_t ehci_bs_r_1(void *, bus_space_handle_t, bus_size_t);
83static void ehci_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t);
84static uint16_t ehci_bs_r_2(void *, bus_space_handle_t, bus_size_t);
85static void ehci_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t);
86static uint32_t ehci_bs_r_4(void *, bus_space_handle_t, bus_size_t);
87static void ehci_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t);
88
89static int
90ehci_ixp_probe(device_t self)
91{
92
93 device_set_desc(self, EHCI_HC_DEVSTR);
94
95 return (BUS_PROBE_DEFAULT);
96}
97
--- 190 unchanged lines hidden (view full) ---
288 bus_space_write_4((bus_space_tag_t) t, h, 0x100 + o, v);
289}
290
291static device_method_t ehci_methods[] = {
292 /* Device interface */
293 DEVMETHOD(device_probe, ehci_ixp_probe),
294 DEVMETHOD(device_attach, ehci_ixp_attach),
295 DEVMETHOD(device_detach, ehci_ixp_detach),
296 DEVMETHOD(device_suspend, bus_generic_suspend),
297 DEVMETHOD(device_resume, bus_generic_resume),
298 DEVMETHOD(device_shutdown, bus_generic_shutdown),
299
300 DEVMETHOD_END
301};
302
303static driver_t ehci_driver = {
304 "ehci",
305 ehci_methods,
306 sizeof(struct ixp_ehci_softc),
307};
308
309static devclass_t ehci_devclass;
310
311DRIVER_MODULE(ehci, ixp, ehci_driver, ehci_devclass, 0, 0);
312MODULE_DEPEND(ehci, usb, 1, 1, 1);
2 * Copyright (c) 2008 Sam Leffler. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
--- 13 unchanged lines hidden (view full) ---
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25/*
26 * IXP435 attachment driver for the USB Enhanced Host Controller.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ehci_ixp4xx.c 228483 2011-12-14 00:28:54Z hselasky $");
31
32#include "opt_bus.h"
33
34#include <sys/stdint.h>
35#include <sys/stddef.h>
36#include <sys/param.h>
37#include <sys/queue.h>
38#include <sys/types.h>
--- 34 unchanged lines hidden (view full) ---
73 ehci_softc_t base; /* storage for EHCI code */
74 bus_space_tag_t iot;
75 bus_space_handle_t ioh;
76 struct bus_space tag; /* tag for private bus space ops */
77};
78
79static device_attach_t ehci_ixp_attach;
80static device_detach_t ehci_ixp_detach;
81
82static uint8_t ehci_bs_r_1(void *, bus_space_handle_t, bus_size_t);
83static void ehci_bs_w_1(void *, bus_space_handle_t, bus_size_t, u_int8_t);
84static uint16_t ehci_bs_r_2(void *, bus_space_handle_t, bus_size_t);
85static void ehci_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t);
86static uint32_t ehci_bs_r_4(void *, bus_space_handle_t, bus_size_t);
87static void ehci_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t);
88
89static int
90ehci_ixp_probe(device_t self)
91{
92
93 device_set_desc(self, EHCI_HC_DEVSTR);
94
95 return (BUS_PROBE_DEFAULT);
96}
97
--- 190 unchanged lines hidden (view full) ---
288 bus_space_write_4((bus_space_tag_t) t, h, 0x100 + o, v);
289}
290
291static device_method_t ehci_methods[] = {
292 /* Device interface */
293 DEVMETHOD(device_probe, ehci_ixp_probe),
294 DEVMETHOD(device_attach, ehci_ixp_attach),
295 DEVMETHOD(device_detach, ehci_ixp_detach),
296 DEVMETHOD(device_suspend, bus_generic_suspend),
297 DEVMETHOD(device_resume, bus_generic_resume),
298 DEVMETHOD(device_shutdown, bus_generic_shutdown),
299
300 DEVMETHOD_END
301};
302
303static driver_t ehci_driver = {
304 "ehci",
305 ehci_methods,
306 sizeof(struct ixp_ehci_softc),
307};
308
309static devclass_t ehci_devclass;
310
311DRIVER_MODULE(ehci, ixp, ehci_driver, ehci_devclass, 0, 0);
312MODULE_DEPEND(ehci, usb, 1, 1, 1);