From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 6 Nov 2011 00:13:52 +0100 Subject: [U-Boot] [PATCH] ulpi: add generic ULPI functionality In-Reply-To: References: <1320526223-30474-1-git-send-email-fermata7@gmail.com> <201111052237.11105.marek.vasut@gmail.com> Message-ID: <201111060013.52683.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > 2011/11/5 Marek Vasut > > > > +int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask) > > > > So this works only with EHCI? How generic is it then ? > > I thought until now that ULPI is EHCI-dependent, but isn't... Ok, what else > should be supported? OHCI? I haven't any hardware to test it, but I could > give it a try. What about xHCI? I have no idea about OHCI, but why won't you be able to have OHCI and ULPI PHY? > > > > +void ulpi_iface_ctrl_flags > > > + (struct usb_ehci *ehci, struct ulpi_regs *ulpi, int access_mode, > > > > u32 > > > > > flags) +{ > > > + switch (access_mode) { > > > + case WRITE: > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write, flags); > > > + break; > > > + case SET: > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_set, flags); > > > + break; > > > + case CLEAR: > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_clear, flags); > > > + break; > > > + } > > > + > > > +} > > > > Is this crap from linux or something? > > No, Linux has offset-based access to ULPI registers, some structure > otg_transceiver, where the driver sets the bits which it wants to be set in > ULPI registers (if I understand it well) and family of functions, which set > bits according to informations in otg_transceiver. Ok, you have writel() functions, why do you need this switch stuff ?