[U-Boot] [PATCH] usb: dwc3: add UniPhier specific glue layer

Tom Rini trini at konsulko.com
Fri Sep 29 14:45:29 UTC 2017


On Fri, Sep 29, 2017 at 10:31:53AM +0900, Masahiro Yamada wrote:
> Hi Marek,
> 
> 
> 2017-09-29 0:26 GMT+09:00 Marek Vasut <marex at denx.de>:
> > On 09/28/2017 03:01 PM, Masahiro Yamada wrote:
> >> Add UniPhier platform specific glue layer to support USB3 Host mode
> >> on Synopsys DWC3 IP.
> >>
> >> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> >> Reviewed-by: Marek Vasut <marex at denx.de>
> >
> > [...]
> >
> >> +static int uniphier_pro4_dwc3_init(void __iomem *regs)
> >> +{
> >> +     u32 tmp;
> >> +
> >> +     tmp = readl(regs + UNIPHIER_PRO4_DWC3_RESET);
> >> +     tmp &= ~UNIPHIER_PRO4_DWC3_RESET_PHY_SS;
> >> +     tmp |= UNIPHIER_PRO4_DWC3_RESET_XIOMMU | UNIPHIER_PRO4_DWC3_RESET_XLINK;
> >> +     writel(tmp, regs + UNIPHIER_PRO4_DWC3_RESET);
> >
> > Do I even want to nag you about clrsetbits_le32() or not ?
> > What do you think?
> 
> 
> I did not know this macro.
> 
> This seems to come from PPC Linux
> (defined in arch/powerpc/include/asm/io.h)
> probably in order to abstract the endianness.
> 
> Of course, it makes drivers ppc-specific,
> disabling COMPILE_TEST coverage.
> 
> 
> In U-Boot, more architectures support this macro, ARM as well.
> (probably people wanted to write the code shorter?)
> 
> I am reluctant with it because I do not want to diverge from Linux.

This is one of those funny cases where perhaps some generic shuffling of
code in Linux might help?  Having whacked things for sandbox this
morning in https://patchwork.ozlabs.org/patch/819919/ and looking at
drivers/crypto/caam/regs.h in the kernel now, it's either a helpful
thing that should be more widely available / used (drop it into say
include/asm-generic/io.h) or time has moved on, and there's a better
convention to use now.  Just a thought.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170929/6b9f2d5f/attachment.sig>


More information about the U-Boot mailing list