[U-Boot] [PATCH 1/2] usb: extend generic EHCI driver with PHY

Marek Vasut marex at denx.de
Fri May 12 13:20:06 UTC 2017


On 05/12/2017 03:13 PM, patrice.chotard at st.com wrote:
> From: Patrice Chotard <patrice.chotard at st.com>
> 
> Add support of generic PHY framework
> Replace printf() by error()
> 
> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
> ---
>  drivers/usb/host/ehci-generic.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
> index 2190adb..d744a57 100644
> --- a/drivers/usb/host/ehci-generic.c
> +++ b/drivers/usb/host/ehci-generic.c
> @@ -6,6 +6,8 @@
>  
>  #include <common.h>
>  #include <clk.h>
> +#include <fdtdec.h>
> +#include <generic-phy.h>
>  #include <reset.h>
>  #include <asm/io.h>
>  #include <dm.h>
> @@ -24,6 +26,7 @@ static int ehci_usb_probe(struct udevice *dev)
>  {
>  	struct ehci_hccr *hccr;
>  	struct ehci_hcor *hcor;
> +	struct phy usb_phy;
>  	int i;
>  
>  	for (i = 0; ; i++) {
> @@ -34,7 +37,7 @@ static int ehci_usb_probe(struct udevice *dev)
>  		if (ret < 0)
>  			break;
>  		if (clk_enable(&clk))
> -			printf("failed to enable clock %d\n", i);
> +			error("failed to enable clock %d\n", i);

Separate patch please

>  		clk_free(&clk);
>  	}
>  
> @@ -46,10 +49,14 @@ static int ehci_usb_probe(struct udevice *dev)
>  		if (ret < 0)
>  			break;
>  		if (reset_deassert(&reset))
> -			printf("failed to deassert reset %d\n", i);
> +			error("failed to deassert reset %d\n", i);

DTTO

>  		reset_free(&reset);
>  	}
>  
> +	if (!generic_phy_get_by_index(dev, 0, &usb_phy))
> +		if (generic_phy_init(&usb_phy))
> +			error("failed to init usb phy %d\n", i);

Is there any de-init for the PHY ?

>  	hccr = map_physmem(dev_get_addr(dev), 0x100, MAP_NOCACHE);
>  	hcor = (struct ehci_hcor *)((uintptr_t)hccr +
>  				    HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list