\hypertarget{dwc3_8c_source}{}\doxysection{dwc3.\+c}
\label{dwc3_8c_source}\index{dev/usb/controller/dwc3.c@{dev/usb/controller/dwc3.c}}
\mbox{\hyperlink{dwc3_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2019 Emmanuel Vadot <manu@FreeBSD.Org>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00006}00006 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00007}00007 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00008}00008 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00009}00009 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00011}00011 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00013}00013 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00014}00014 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00015}00015 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00016}00016 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00017}00017 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00018}00018 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00019}00019 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00020}00020 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00021}00021 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00022}00022 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00023}00023 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00024}00024 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00025}00025 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00026}00026 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00027}00027 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00029}00029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00032}\mbox{\hyperlink{dwc3_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00032}} \mbox{\hyperlink{dwc3_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/gpio.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <dev/fdt/simplebus.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <dev/fdt/fdt\_common.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_bus.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_bus\_subr.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_subr.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__core_8h}{dev/usb/usb\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__busdma_8h}{dev/usb/usb\_busdma.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__controller_8h}{dev/usb/usb\_controller.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__bus_8h}{dev/usb/usb\_bus.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{xhci_8h}{dev/usb/controller/xhci.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{dwc3_8h}{dev/usb/controller/dwc3.h}}>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <dev/extres/clk/clk.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <dev/extres/phy/phy\_usb.h>}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00066}00066 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{generic__xhci_8h}{generic\_xhci.h}}"{}}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00068}\mbox{\hyperlink{dwc3_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{00068}} \textcolor{keyword}{static} \textcolor{keyword}{struct }ofw\_compat\_data \mbox{\hyperlink{dwc3_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{compat\_data}}[] = \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00069}00069         \{ \textcolor{stringliteral}{"{}snps,dwc3"{}},  1 \},}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00070}00070         \{ NULL,         0 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00071}00071 \};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00073}\mbox{\hyperlink{structsnps__dwc3__softc}{00073}} \textcolor{keyword}{struct }\mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00074}\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{00074}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}}     \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00075}\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{00075}}         device\_t                \mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00076}\mbox{\hyperlink{structsnps__dwc3__softc_abb1bd9a4ae6ac7483cdfde577a6d59f2}{00076}}         \textcolor{keywordtype}{char}                    \mbox{\hyperlink{structsnps__dwc3__softc_abb1bd9a4ae6ac7483cdfde577a6d59f2}{dr\_mode}}[16];}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00077}\mbox{\hyperlink{structsnps__dwc3__softc_afc95b9a3bc6bdec0f0ec99521a38fdd8}{00077}}         \textcolor{keyword}{struct }resource *       \mbox{\hyperlink{structsnps__dwc3__softc_afc95b9a3bc6bdec0f0ec99521a38fdd8}{mem\_res}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00078}\mbox{\hyperlink{structsnps__dwc3__softc_a611c38f0f8dad30abd5e9acfd29fd8cf}{00078}}         bus\_space\_tag\_t         \mbox{\hyperlink{structsnps__dwc3__softc_a611c38f0f8dad30abd5e9acfd29fd8cf}{bst}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00079}\mbox{\hyperlink{structsnps__dwc3__softc_a5226ba6d85c2811697dbf2768933a713}{00079}}         bus\_space\_handle\_t      \mbox{\hyperlink{structsnps__dwc3__softc_a5226ba6d85c2811697dbf2768933a713}{bsh}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00080}\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{00080}}         phandle\_t               \mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00081}\mbox{\hyperlink{structsnps__dwc3__softc_a45cdc2601a07aa899dc9d4ceda2918ea}{00081}}         phy\_t                   \mbox{\hyperlink{structsnps__dwc3__softc_a45cdc2601a07aa899dc9d4ceda2918ea}{usb2\_phy}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00082}\mbox{\hyperlink{structsnps__dwc3__softc_a15e7c27a1e0936f1062a5266b8362b3a}{00082}}         phy\_t                   \mbox{\hyperlink{structsnps__dwc3__softc_a15e7c27a1e0936f1062a5266b8362b3a}{usb3\_phy}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00083}00083 \};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00085}\mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{00085}} \textcolor{preprocessor}{\#define DWC3\_WRITE(\_sc, \_off, \_val)             \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00086}00086 \textcolor{preprocessor}{    bus\_space\_write\_4(\_sc-\/>bst, \_sc-\/>bsh, \_off, \_val)}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00087}\mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{00087}} \textcolor{preprocessor}{\#define DWC3\_READ(\_sc, \_off)            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00088}00088 \textcolor{preprocessor}{    bus\_space\_read\_4(\_sc-\/>bst, \_sc-\/>bsh, \_off)}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00090}00090 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00091}\mbox{\hyperlink{dwc3_8c_aced7b6e52ff36a1e873e922865944f42}{00091}} \mbox{\hyperlink{dwc3_8c_aced7b6e52ff36a1e873e922865944f42}{snps\_dwc3\_attach\_xhci}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00092}00092 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00093}00093         \textcolor{keyword}{struct }\mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *snps\_sc = device\_get\_softc(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00094}00094         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \&snps\_sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00095}00095         \textcolor{keywordtype}{int} err = 0, rid = 0;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00097}00097         sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}} = snps\_sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_afc95b9a3bc6bdec0f0ec99521a38fdd8}{mem\_res}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00098}00098         sc-\/>\mbox{\hyperlink{structxhci__softc_a1799bfc499a6df8fca1eb12ea0b9e5c4}{sc\_io\_tag}} = snps\_sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a611c38f0f8dad30abd5e9acfd29fd8cf}{bst}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00099}00099         sc-\/>\mbox{\hyperlink{structxhci__softc_a8c82dbc3063b75607dc15851c1e4bcf6}{sc\_io\_hdl}} = snps\_sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a5226ba6d85c2811697dbf2768933a713}{bsh}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00100}00100         sc-\/>\mbox{\hyperlink{structxhci__softc_adf07260a74f6221c49d38f504c884e4a}{sc\_io\_size}} = rman\_get\_size(snps\_sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_afc95b9a3bc6bdec0f0ec99521a38fdd8}{mem\_res}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00102}00102         sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00103}00103             RF\_SHAREABLE | RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00104}00104         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00105}00105                 device\_printf(dev, \textcolor{stringliteral}{"{}Failed to allocate IRQ\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00106}00106                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00107}00107         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00109}00109         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} = device\_add\_child(dev, \textcolor{stringliteral}{"{}usbus"{}}, -\/1);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00110}00110         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00111}00111                 device\_printf(dev, \textcolor{stringliteral}{"{}Failed to add USB device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00112}00112                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00113}00113         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00115}00115         device\_set\_ivars(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}}, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00117}00117         sprintf(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}, \textcolor{stringliteral}{"{}Synopsys"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00118}00118         device\_set\_desc(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}}, \textcolor{stringliteral}{"{}Synopsys"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00120}00120         err = bus\_setup\_intr(dev, sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}}, INTR\_TYPE\_BIO | INTR\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00121}00121             NULL, (driver\_intr\_t *)\mbox{\hyperlink{xhci_8c_ae78994eb0559b8dc21a1d11c751483cf}{xhci\_interrupt}}, sc, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00122}00122         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00123}00123                 device\_printf(dev, \textcolor{stringliteral}{"{}Failed to setup IRQ, \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00124}00124                 sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}} = NULL;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00125}00125                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00126}00126         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00128}00128         err = \mbox{\hyperlink{xhci_8c_a064d5971b294586b6c68154ba681cd12}{xhci\_init}}(sc, dev, 1);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00129}00129         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00130}00130                 device\_printf(dev, \textcolor{stringliteral}{"{}Failed to init XHCI, with error \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00131}00131                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00132}00132         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00134}00134         err = \mbox{\hyperlink{xhci_8c_ab493057cb5a03075152f14e3bf8c8e7f}{xhci\_start\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00135}00135         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00136}00136                 device\_printf(dev, \textcolor{stringliteral}{"{}Failed to start XHCI controller, with error \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00137}00137                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00138}00138         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00140}00140         device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}}, \textcolor{stringliteral}{"{}trying to attach\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00141}00141         err = device\_probe\_and\_attach(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00142}00142         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00143}00143                 device\_printf(dev, \textcolor{stringliteral}{"{}Failed to initialize USB, with error \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00144}00144                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00145}00145         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00147}00147         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00148}00148 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00150}00150 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00151}00151 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00152}00152 snsp\_dwc3\_dump\_regs(\textcolor{keyword}{struct} \mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00153}00153 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00154}00154         uint32\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00156}00156         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_a57fa3cb180da66666d0f51b96fa61f5c}{DWC3\_GCTL}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00157}00157         device\_printf(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}GCTL: \%x\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00158}00158         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_ab3bcf090a0866345e1e3952514f17abd}{DWC3\_GUCTL1}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00159}00159         device\_printf(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}GUCTL1: \%x\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00160}00160         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00161}00161         device\_printf(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}GUSB2PHYCFG0: \%x\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00162}00162         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_ae00861bdd5a1ea6048fd18d33fbd7b9a}{DWC3\_GUSB3PIPECTL0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00163}00163         device\_printf(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}GUSB3PIPECTL0: \%x\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00164}00164         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_adedfbb0f853b5fd9a695c6e072ff26d1}{DWC3\_DCFG}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00165}00165         device\_printf(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}DCFG: \%x\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00166}00166 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00167}00167 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00169}00169 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00170}\mbox{\hyperlink{dwc3_8c_a8f49582b05ad4469b4817a30b61085bd}{00170}} \mbox{\hyperlink{dwc3_8c_a8f49582b05ad4469b4817a30b61085bd}{snps\_dwc3\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00171}00171 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00172}00172         uint32\_t gctl, phy2, phy3;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00174}00174         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a45cdc2601a07aa899dc9d4ceda2918ea}{usb2\_phy}})}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00175}00175                 phy\_enable(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a45cdc2601a07aa899dc9d4ceda2918ea}{usb2\_phy}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00176}00176         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a15e7c27a1e0936f1062a5266b8362b3a}{usb3\_phy}})}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00177}00177                 phy\_enable(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a15e7c27a1e0936f1062a5266b8362b3a}{usb3\_phy}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00179}00179         gctl = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_a57fa3cb180da66666d0f51b96fa61f5c}{DWC3\_GCTL}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00180}00180         gctl |= \mbox{\hyperlink{dwc3_8h_a97e30ad3414547eddee9bb64546f1959}{DWC3\_GCTL\_CORESOFTRESET}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00181}00181         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_a57fa3cb180da66666d0f51b96fa61f5c}{DWC3\_GCTL}}, gctl);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00183}00183         phy2 = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00184}00184         phy2 |= \mbox{\hyperlink{dwc3_8h_aca4dadd693224d4b42b33695e4ad1af7}{DWC3\_GUSB2PHYCFG0\_PHYSOFTRST}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00185}00185         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}}, phy2);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00187}00187         phy3 = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_ae00861bdd5a1ea6048fd18d33fbd7b9a}{DWC3\_GUSB3PIPECTL0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00188}00188         phy3 |= \mbox{\hyperlink{dwc3_8h_a92006247929c7822d577ae1d17e007cc}{DWC3\_GUSB3PIPECTL0\_PHYSOFTRST}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00189}00189         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_ae00861bdd5a1ea6048fd18d33fbd7b9a}{DWC3\_GUSB3PIPECTL0}}, phy3);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00191}00191         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00193}00193         phy2 \&= \string~DWC3\_GUSB2PHYCFG0\_PHYSOFTRST;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00194}00194         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}}, phy2);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00196}00196         phy3 \&= \string~DWC3\_GUSB3PIPECTL0\_PHYSOFTRST;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00197}00197         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_ae00861bdd5a1ea6048fd18d33fbd7b9a}{DWC3\_GUSB3PIPECTL0}}, phy3);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00199}00199         gctl \&= \string~DWC3\_GCTL\_CORESOFTRESET;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00200}00200         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_a57fa3cb180da66666d0f51b96fa61f5c}{DWC3\_GCTL}}, gctl);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00202}00202 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00204}00204 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00205}\mbox{\hyperlink{dwc3_8c_a4fce414c947c12b30f7c5773bb7e04b4}{00205}} \mbox{\hyperlink{dwc3_8c_a4fce414c947c12b30f7c5773bb7e04b4}{snps\_dwc3\_configure\_host}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00206}00206 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00207}00207         uint32\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00209}00209         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_a57fa3cb180da66666d0f51b96fa61f5c}{DWC3\_GCTL}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00210}00210         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \&= \string~DWC3\_GCTL\_PRTCAPDIR\_MASK;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00211}00211         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a46ad3eb2244ce9a4beb5b0eef786471b}{DWC3\_GCTL\_PRTCAPDIR\_HOST}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00212}00212         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_a57fa3cb180da66666d0f51b96fa61f5c}{DWC3\_GCTL}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00213}00213 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00215}00215 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00216}\mbox{\hyperlink{dwc3_8c_a2b18e4797b40cdaee8c5de39c9df7aea}{00216}} \mbox{\hyperlink{dwc3_8c_a2b18e4797b40cdaee8c5de39c9df7aea}{snps\_dwc3\_configure\_phy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00217}00217 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00218}00218         \textcolor{keywordtype}{char} *phy\_type;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00219}00219         uint32\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00220}00220         \textcolor{keywordtype}{int} nphy\_types;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00222}00222         phy\_type = NULL;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00223}00223         nphy\_types = OF\_getprop\_alloc(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}phy\_type"{}}, (\textcolor{keywordtype}{void} **)\&phy\_type);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00224}00224         \textcolor{keywordflow}{if} (nphy\_types <= 0)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00225}00225                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00227}00227         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00228}00228         \textcolor{keywordflow}{if} (strncmp(phy\_type, \textcolor{stringliteral}{"{}utmi\_wide"{}}, 9) == 0) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00229}00229                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \&= \string~(\mbox{\hyperlink{dwc3_8h_a6b3fb37ce1740dc08db80dfbaae70f1b}{DWC3\_GUSB2PHYCFG0\_PHYIF}} | \mbox{\hyperlink{dwc3_8h_a0add09b6c8722a016dd19c0fe8102508}{DWC3\_GUSB2PHYCFG0\_USBTRDTIM}}(0xf));}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00230}00230                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a6b3fb37ce1740dc08db80dfbaae70f1b}{DWC3\_GUSB2PHYCFG0\_PHYIF}} |}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00231}00231                         \mbox{\hyperlink{dwc3_8h_a0add09b6c8722a016dd19c0fe8102508}{DWC3\_GUSB2PHYCFG0\_USBTRDTIM}}(\mbox{\hyperlink{dwc3_8h_a73aeaf8016e2c68ebb134d19db7e3e1b}{DWC3\_GUSB2PHYCFG0\_USBTRDTIM\_16BITS}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00232}00232         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00233}00233                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \&= \string~(\mbox{\hyperlink{dwc3_8h_a6b3fb37ce1740dc08db80dfbaae70f1b}{DWC3\_GUSB2PHYCFG0\_PHYIF}} | \mbox{\hyperlink{dwc3_8h_a0add09b6c8722a016dd19c0fe8102508}{DWC3\_GUSB2PHYCFG0\_USBTRDTIM}}(0xf));}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00234}00234                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a6b3fb37ce1740dc08db80dfbaae70f1b}{DWC3\_GUSB2PHYCFG0\_PHYIF}} |}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00235}00235                         \mbox{\hyperlink{dwc3_8h_a0add09b6c8722a016dd19c0fe8102508}{DWC3\_GUSB2PHYCFG0\_USBTRDTIM}}(\mbox{\hyperlink{dwc3_8h_a465dc85d9db8fb144d9a7fa2c4b8ad62}{DWC3\_GUSB2PHYCFG0\_USBTRDTIM\_8BITS}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00236}00236         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00237}00237         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00238}00238         OF\_prop\_free(phy\_type);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00241}00241 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00242}\mbox{\hyperlink{dwc3_8c_a11b17257ec6843eb9dcbb971e66695ee}{00242}} \mbox{\hyperlink{dwc3_8c_a11b17257ec6843eb9dcbb971e66695ee}{snps\_dwc3\_do\_quirks}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00243}00243 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00244}00244         uint32\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00246}00246         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00247}00247         \textcolor{keywordflow}{if} (OF\_hasprop(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}snps,dis-\/u2-\/freeclk-\/exists-\/quirk"{}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00248}00248                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \&= \string~DWC3\_GUSB2PHYCFG0\_U2\_FREECLK\_EXISTS;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00249}00249         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00250}00250                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a63d05ec012a7b058126723f1323de511}{DWC3\_GUSB2PHYCFG0\_U2\_FREECLK\_EXISTS}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00251}00251         \textcolor{keywordflow}{if} (OF\_hasprop(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}snps,dis\_u2\_susphy\_quirk"{}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00252}00252                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \&= \string~DWC3\_GUSB2PHYCFG0\_SUSPENDUSB20;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00253}00253         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00254}00254                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a6e864056da742f6eda0c66f3c8e3e721}{DWC3\_GUSB2PHYCFG0\_SUSPENDUSB20}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00255}00255         \textcolor{keywordflow}{if} (OF\_hasprop(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}snps,dis\_enblslpm\_quirk"{}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00256}00256                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \&= \string~DWC3\_GUSB2PHYCFG0\_ENBLSLPM;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00257}00257         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00258}00258                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_ab9b979829ada94444c05d77db91ba6e9}{DWC3\_GUSB2PHYCFG0\_ENBLSLPM}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00260}00260         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_aa51a09d47265e128fe2e786d650610d5}{DWC3\_GUSB2PHYCFG0}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00262}00262         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_ab3bcf090a0866345e1e3952514f17abd}{DWC3\_GUCTL1}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00263}00263         \textcolor{keywordflow}{if} (OF\_hasprop(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}snps,dis-\/tx-\/ipgap-\/linecheck-\/quirk"{}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00264}00264                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a6f62357ccd896dfbbdb7df60c001fb3f}{DWC3\_GUCTL1\_TX\_IPGAP\_LINECHECK\_DIS}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00265}00265         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_ab3bcf090a0866345e1e3952514f17abd}{DWC3\_GUCTL1}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00267}00267         \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} = \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(sc, \mbox{\hyperlink{dwc3_8h_ae00861bdd5a1ea6048fd18d33fbd7b9a}{DWC3\_GUSB3PIPECTL0}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00268}00268         \textcolor{keywordflow}{if} (OF\_hasprop(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}snps,dis-\/del-\/phy-\/power-\/chg-\/quirk"{}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00269}00269                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_a1b90b55b71b5ae7e063424373b4fdf40}{DWC3\_GUSB3PIPECTL0\_DELAYP1TRANS}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00270}00270         \textcolor{keywordflow}{if} (OF\_hasprop(sc-\/>\mbox{\hyperlink{structsnps__dwc3__softc_a67890fbc3df3ac63280c70d1aa259986}{node}}, \textcolor{stringliteral}{"{}snps,dis\_rxdet\_inp3\_quirk"{}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00271}00271                 \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} |= \mbox{\hyperlink{dwc3_8h_acfb951df6c1f79ebc263ef223915cda5}{DWC3\_GUSB3PIPECTL0\_DISRXDETINP3}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00272}00272         \mbox{\hyperlink{dwc3_8c_af9b5f577c2c88f27a653230e5507625a}{DWC3\_WRITE}}(sc, \mbox{\hyperlink{dwc3_8h_ae00861bdd5a1ea6048fd18d33fbd7b9a}{DWC3\_GUSB3PIPECTL0}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00274}00274 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00276}00276 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00277}\mbox{\hyperlink{dwc3_8c_a943ecddd575dfcfe0284bbb44001b2eb}{00277}} \mbox{\hyperlink{dwc3_8c_a943ecddd575dfcfe0284bbb44001b2eb}{snps\_dwc3\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00278}00278 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00279}00279         \textcolor{keyword}{struct }\mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00280}00280 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00281}00281         \textcolor{keywordflow}{if} (!ofw\_bus\_status\_okay(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}))}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00282}00282                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00284}00284         \textcolor{keywordflow}{if} (ofw\_bus\_search\_compatible(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \mbox{\hyperlink{dwc3_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{compat\_data}})-\/>ocd\_data == 0)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00285}00285                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00287}00287         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}} = device\_get\_softc(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00288}00288         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>node = ofw\_bus\_get\_node(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00289}00289         OF\_getprop(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>node, \textcolor{stringliteral}{"{}dr\_mode"{}}, \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>dr\_mode, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>dr\_mode));}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00290}00290         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>dr\_mode, \textcolor{stringliteral}{"{}host"{}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00291}00291                 device\_printf(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}Only host mode is supported\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00292}00292                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00293}00293         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00295}00295         device\_set\_desc(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}Synopsys Designware DWC3"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00296}00296         \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00297}00297 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00299}00299 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00300}\mbox{\hyperlink{dwc3_8c_ab63886ae3744aba71209e0b1ccb5a1ae}{00300}} \mbox{\hyperlink{dwc3_8c_ab63886ae3744aba71209e0b1ccb5a1ae}{snps\_dwc3\_attach}}(device\_t \mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}})}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00301}00301 \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00302}00302         \textcolor{keyword}{struct }\mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}} *\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00303}00303         \textcolor{keywordtype}{int} rid = 0;}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00305}00305         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}} = device\_get\_softc(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00306}00306         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>dev = \mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00308}00308         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>mem\_res = bus\_alloc\_resource\_any(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, SYS\_RES\_MEMORY, \&rid,}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00309}00309             RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00310}00310         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>mem\_res == NULL) \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00311}00311                 device\_printf(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}Failed to map memory\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00312}00312                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00313}00313         \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00314}00314         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>bst = rman\_get\_bustag(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>mem\_res);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00315}00315         \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>bsh = rman\_get\_bushandle(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>mem\_res);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00317}00317         \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00318}00318                 device\_printf(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \textcolor{stringliteral}{"{}snps id: \%x\(\backslash\)n"{}}, \mbox{\hyperlink{dwc3_8c_ae47dd95bb5d66d41a1c98ed27939ea1b}{DWC3\_READ}}(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}, \mbox{\hyperlink{dwc3_8h_ac954438589deea27c556388a353b9b56}{DWC3\_GSNPSID}}));}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00320}00320         \textcolor{comment}{/* Get the phys */}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00321}00321         phy\_get\_by\_ofw\_name(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>node, \textcolor{stringliteral}{"{}usb2-\/phy"{}}, \&\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>usb2\_phy);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00322}00322         phy\_get\_by\_ofw\_name(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}}, \mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>node, \textcolor{stringliteral}{"{}usb3-\/phy"{}}, \&\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}}-\/>usb3\_phy);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00324}00324         \mbox{\hyperlink{dwc3_8c_a8f49582b05ad4469b4817a30b61085bd}{snps\_dwc3\_reset}}(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00325}00325         \mbox{\hyperlink{dwc3_8c_a4fce414c947c12b30f7c5773bb7e04b4}{snps\_dwc3\_configure\_host}}(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00326}00326         \mbox{\hyperlink{dwc3_8c_a2b18e4797b40cdaee8c5de39c9df7aea}{snps\_dwc3\_configure\_phy}}(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00327}00327         \mbox{\hyperlink{dwc3_8c_a11b17257ec6843eb9dcbb971e66695ee}{snps\_dwc3\_do\_quirks}}(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00328}00328 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00329}00329         snsp\_dwc3\_dump\_regs(\mbox{\hyperlink{structsnps__dwc3__softc_ab3b6edeffa781ddc651cd0ae0db352c3}{sc}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00330}00330 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00331}00331         \mbox{\hyperlink{dwc3_8c_aced7b6e52ff36a1e873e922865944f42}{snps\_dwc3\_attach\_xhci}}(\mbox{\hyperlink{structsnps__dwc3__softc_abc2c35d61d4b44d988749c4c697b4e8e}{dev}});}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00333}00333         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00334}00334 \}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00336}\mbox{\hyperlink{dwc3_8c_aa775440ccd459d2c2fd5428420e98096}{00336}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{dwc3_8c_aa775440ccd459d2c2fd5428420e98096}{snps\_dwc3\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00337}00337         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00338}00338         DEVMETHOD(device\_probe,         \mbox{\hyperlink{dwc3_8c_a943ecddd575dfcfe0284bbb44001b2eb}{snps\_dwc3\_probe}}),}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00339}00339         DEVMETHOD(device\_attach,        \mbox{\hyperlink{dwc3_8c_ab63886ae3744aba71209e0b1ccb5a1ae}{snps\_dwc3\_attach}}),}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00341}00341         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00342}00342 \};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00344}\mbox{\hyperlink{dwc3_8c_a7e7ff65b501660dac04ae8fe758219fc}{00344}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{dwc3_8c_a7e7ff65b501660dac04ae8fe758219fc}{snps\_dwc3\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00345}00345         \textcolor{stringliteral}{"{}xhci"{}},}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00346}00346         \mbox{\hyperlink{dwc3_8c_aa775440ccd459d2c2fd5428420e98096}{snps\_dwc3\_methods}},}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00347}00347         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structsnps__dwc3__softc}{snps\_dwc3\_softc}})}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00348}00348 \};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00350}\mbox{\hyperlink{dwc3_8c_a7c0bae0d1f6ed8acbcd41b7585c557ee}{00350}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{dwc3_8c_a7c0bae0d1f6ed8acbcd41b7585c557ee}{snps\_dwc3\_devclass}};}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00351}\mbox{\hyperlink{dwc3_8c_ae9f720ad814d008a1f88ed49caffa033}{00351}} \mbox{\hyperlink{dwc3_8c_ae9f720ad814d008a1f88ed49caffa033}{DRIVER\_MODULE}}(snps\_dwc3, simplebus, \mbox{\hyperlink{dwc3_8c_a7e7ff65b501660dac04ae8fe758219fc}{snps\_dwc3\_driver}}, \mbox{\hyperlink{dwc3_8c_a7c0bae0d1f6ed8acbcd41b7585c557ee}{snps\_dwc3\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{dwc3_8c_source_l00352}\mbox{\hyperlink{dwc3_8c_a101ad9a7272196e54a8182a8c6c67248}{00352}} \mbox{\hyperlink{dwc3_8c_a101ad9a7272196e54a8182a8c6c67248}{MODULE\_DEPEND}}(snps\_dwc3, xhci, 1, 1, 1);}

\end{DoxyCode}
