imxusbvar.h revision 1.2 1 #ifndef _ARM_IMX_IMXUSBVAR_H
2 #define _ARM_IMX_IMXUSBVAR_H
3
4 struct imxehci_softc;
5
6 enum imx_usb_role {
7 IMXUSB_HOST,
8 IMXUSB_DEVICE
9 };
10
11 struct imxusbc_softc {
12 device_t sc_dev;
13 bus_space_tag_t sc_iot;
14 bus_space_handle_t sc_ioh;
15
16 /* filled in by platform dependent routine */
17 void (* sc_init_md_hook)(struct imxehci_softc *);
18 void (* sc_setup_md_hook)(struct imxehci_softc *, enum imx_usb_role);
19 };
20
21 struct imxusbc_attach_args {
22 bus_space_tag_t aa_iot;
23 bus_space_handle_t aa_ioh;
24 bus_dma_tag_t aa_dmat;
25 int aa_unit; /* 0: OTG, 1: HOST1, 2: HOST2 ... */
26 int aa_irq;
27 };
28
29 enum imx_usb_if {
30 IMXUSBC_IF_UTMI,
31 IMXUSBC_IF_PHILIPS,
32 IMXUSBC_IF_ULPI,
33 IMXUSBC_IF_SERIAL,
34 IMXUSBC_IF_UTMI_WIDE
35 };
36
37 struct imxehci_softc {
38 ehci_softc_t sc_hsc;
39
40 bus_space_tag_t sc_iot;
41 bus_space_handle_t sc_ioh;
42 struct imxusbc_softc *sc_usbc;
43 uint sc_unit;
44 enum imx_usb_if sc_iftype;
45 };
46
47 int imxusbc_attach_common(device_t, device_t, bus_space_tag_t);
48 void imxehci_select_interface(struct imxehci_softc *, enum imx_usb_if);
49 void imxehci_host_mode(struct imxehci_softc *);
50 void imxehci_reset(struct imxehci_softc *);
51
52 #endif /* _ARM_IMX_IMXUSBVAR_H */
53