[U-Boot] [PATCH 4/4] usb: add USB support for Efika

Marek Vasut marek.vasut at gmail.com
Thu Sep 29 01:59:05 CEST 2011


On Thursday, September 29, 2011 01:52:51 AM Jana Rapava wrote:
> This commit adds USB support for EfikaMX and EfikaSB.
> 
> Signed-off-by: Jana Rapava <fermata7 at gmail.com>
> Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> Cc: Remy Bohmer <linux at bohmer.net>
> Cc: Stefano Babic <sbabic at denx.de>
> ---
>  board/efikamx/Makefile      |    3 +
>  board/efikamx/efika.h       |   30 +++
>  board/efikamx/efikamx-usb.c |  420
> +++++++++++++++++++++++++++++++++++++++++++ board/efikamx/efikamx.c     | 
>   3 +
>  include/configs/efikamx.h   |   16 ++
>  5 files changed, 472 insertions(+), 0 deletions(-)
>  create mode 100644 board/efikamx/efika.h
>  create mode 100644 board/efikamx/efikamx-usb.c

[...]

> 
> +
> +int ulpi_wakeup(struct usb_ehci *ehci)
> +{
> +	if (readl(&ehci->ulpi_viewpoint) & ULPI_SS)
> +		return 0; /* already awake */
> +	return ulpi_wait(ehci, ULPI_WU, ULPI_WU);
> +}
> +
> +void ulpi_write(struct usb_ehci *ehci, u32 reg, u32 value)
> +{
> +	if (ulpi_wakeup(ehci)) {
> +		printf("ULPI wakeup timed out\n");
> +		return;
> +	}
> +
> +	if (ulpi_wait(ehci, ULPI_RWRUN | ULPI_RWCTRL |
> +	reg << ULPI_ADDR_SHIFT | ulpi_write_mask(value), ULPI_RWRUN))
> +		printf("ULPI write timed out\n");

Please use temp. variable here and fix indent.
> +}
> +
> +u32 ulpi_read(struct usb_ehci *ehci, u32 reg)
> +{
> +	if (ulpi_wakeup(ehci)) {
> +		printf("ULPI wakeup timed out\n");
> +		return 0;
> +	}
> +
> +	if (ulpi_wait(ehci, ULPI_RWRUN | reg << ULPI_ADDR_SHIFT, ULPI_RWRUN)) {
> +		printf("ULPI read timed out\n");
> +		return 0;
> +	}

Newline

> +	return ulpi_read_mask(readl(&ehci->ulpi_viewpoint));
> +}


More information about the U-Boot mailing list