[U-Boot] [PATCH] drivers/usb/ehci: Use platform-specific accessors

Marek Vasut marex at denx.de
Fri Feb 10 20:33:01 UTC 2017


On 02/10/2017 09:23 PM, Alexey Brodkin wrote:
> Current implementation doesn't allow utilization of platform-specific
> reads and writes.
> 
> But some arches or platforms may want to use their accessors that do
> some extra work like adding barriers for data serialization etc.
> 
> Interesting enough OHCI accessors already do that so just aligning
> EHCI to it now.
> 
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Mateusz Kulikowski <mateusz.kulikowski at gmail.com>

IMO looks OK,

Acked-by: Marek Vasut <marex at denx.de>

I'd like to have a few more reviews of this before applying it for
2017.05 . Also CCing Wills, it'd be great to get a test on atheros
MIPS .

Thanks!

> ---
>  drivers/usb/host/ehci.h | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
> index 734d7f036278..2ab830df5155 100644
> --- a/drivers/usb/host/ehci.h
> +++ b/drivers/usb/host/ehci.h
> @@ -102,13 +102,11 @@ struct usb_linux_config_descriptor {
>  } __attribute__ ((packed));
>  
>  #if defined CONFIG_EHCI_DESC_BIG_ENDIAN
> -#define ehci_readl(x)		cpu_to_be32((*((volatile u32 *)(x))))
> -#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
> -					cpu_to_be32(((volatile u32)b)))
> +#define ehci_readl(x)		cpu_to_be32(readl(x))
> +#define ehci_writel(a, b)	writel(cpu_to_be32(b), a)
>  #else
> -#define ehci_readl(x)		cpu_to_le32((*((volatile u32 *)(x))))
> -#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
> -					cpu_to_le32(((volatile u32)b)))
> +#define ehci_readl(x)		cpu_to_le32(readl(x))
> +#define ehci_writel(a, b)	writel(cpu_to_le32(b), a)
>  #endif
>  
>  #if defined CONFIG_EHCI_MMIO_BIG_ENDIAN
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list