imxusbvar.h revision 1.5 1 1.5 hkenken /* $NetBSD: imxusbvar.h,v 1.5 2019/06/20 08:16:19 hkenken Exp $ */
2 1.5 hkenken /*
3 1.5 hkenken * Copyright (c) 2019 Genetec Corporation. All rights reserved.
4 1.5 hkenken * Written by Hashimoto Kenichi for Genetec Corporation.
5 1.5 hkenken *
6 1.5 hkenken * Redistribution and use in source and binary forms, with or without
7 1.5 hkenken * modification, are permitted provided that the following conditions
8 1.5 hkenken * are met:
9 1.5 hkenken * 1. Redistributions of source code must retain the above copyright
10 1.5 hkenken * notice, this list of conditions and the following disclaimer.
11 1.5 hkenken * 2. Redistributions in binary form must reproduce the above copyright
12 1.5 hkenken * notice, this list of conditions and the following disclaimer in the
13 1.5 hkenken * documentation and/or other materials provided with the distribution.
14 1.5 hkenken *
15 1.5 hkenken * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
16 1.5 hkenken * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 1.5 hkenken * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 1.5 hkenken * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
19 1.5 hkenken * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 1.5 hkenken * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 1.5 hkenken * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 1.5 hkenken * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 1.5 hkenken * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 1.5 hkenken * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 1.5 hkenken * POSSIBILITY OF SUCH DAMAGE.
26 1.5 hkenken */
27 1.5 hkenken
28 1.1 bsh #ifndef _ARM_IMX_IMXUSBVAR_H
29 1.1 bsh #define _ARM_IMX_IMXUSBVAR_H
30 1.1 bsh
31 1.1 bsh struct imxehci_softc;
32 1.1 bsh
33 1.1 bsh enum imx_usb_role {
34 1.1 bsh IMXUSB_HOST,
35 1.1 bsh IMXUSB_DEVICE
36 1.1 bsh };
37 1.1 bsh
38 1.1 bsh struct imxusbc_softc {
39 1.1 bsh device_t sc_dev;
40 1.1 bsh bus_space_tag_t sc_iot;
41 1.1 bsh bus_space_handle_t sc_ioh;
42 1.1 bsh
43 1.5 hkenken struct clk *sc_clk;
44 1.5 hkenken
45 1.4 ryo /* filled in by platform dependent param & routine */
46 1.4 ryo bus_size_t sc_ehci_size;
47 1.1 bsh void (* sc_init_md_hook)(struct imxehci_softc *);
48 1.1 bsh void (* sc_setup_md_hook)(struct imxehci_softc *, enum imx_usb_role);
49 1.1 bsh };
50 1.1 bsh
51 1.1 bsh struct imxusbc_attach_args {
52 1.1 bsh bus_space_tag_t aa_iot;
53 1.1 bsh bus_space_handle_t aa_ioh;
54 1.1 bsh bus_dma_tag_t aa_dmat;
55 1.1 bsh int aa_unit; /* 0: OTG, 1: HOST1, 2: HOST2 ... */
56 1.1 bsh int aa_irq;
57 1.1 bsh };
58 1.1 bsh
59 1.1 bsh enum imx_usb_if {
60 1.1 bsh IMXUSBC_IF_UTMI,
61 1.1 bsh IMXUSBC_IF_PHILIPS,
62 1.1 bsh IMXUSBC_IF_ULPI,
63 1.2 hkenken IMXUSBC_IF_SERIAL,
64 1.4 ryo IMXUSBC_IF_UTMI_WIDE,
65 1.4 ryo IMXUSBC_IF_HSIC
66 1.1 bsh };
67 1.1 bsh
68 1.1 bsh struct imxehci_softc {
69 1.1 bsh ehci_softc_t sc_hsc;
70 1.1 bsh
71 1.1 bsh bus_space_tag_t sc_iot;
72 1.1 bsh bus_space_handle_t sc_ioh;
73 1.1 bsh struct imxusbc_softc *sc_usbc;
74 1.1 bsh uint sc_unit;
75 1.1 bsh enum imx_usb_if sc_iftype;
76 1.1 bsh };
77 1.1 bsh
78 1.1 bsh int imxusbc_attach_common(device_t, device_t, bus_space_tag_t);
79 1.1 bsh void imxehci_reset(struct imxehci_softc *);
80 1.1 bsh
81 1.1 bsh #endif /* _ARM_IMX_IMXUSBVAR_H */
82