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