[RFC PATCH v2 11/11] riscv: soc: Allwinner D1 GMAC driver only for temp use

Guo Ren guoren at kernel.org
Sun Jun 6 08:41:48 PDT 2021


On Sun, Jun 6, 2021 at 11:39 PM Jernej Škrabec <jernej.skrabec at gmail.com> wrote:
>
> Hi!
>
> Dne nedelja, 06. junij 2021 ob 17:32:22 CEST je Guo Ren napisal(a):
> >  ,
> >
> > On Sun, Jun 6, 2021 at 6:50 PM Andre Przywara <andre.przywara at arm.com>
> wrote:
> > > On Sun,  6 Jun 2021 09:04:09 +0000
> > > guoren at kernel.org wrote:
> > >
> > > Hi,
> > >
> > > > From: liush <liush at allwinnertech.com>
> > > >
> > > > This is a temporary driver, only guaranteed to work on allwinner
> > > > D1. In order to ensure the developer's demand for network usage.
> > >
> > > That looks like some Allwinner BSP driver, please don't endorse code
> > > of this quality (just look at all that commented code and the attempt
> > > for compile-time configuration).
> > >
> > > > It only could work at 1Gps mode.
> > > >
> > > > The correct gmac driver should follow (I guess)
> > > > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> > > >
> > > > If anyone is familiar with it and can help porting, I would be
> > > > very grateful.
> > >
> > > Have you tried compiling and using that driver? Ideally it should just
> > > work, Linux drivers are meant to be portable, by design. And the driver
> > > is already enabled by COMPILE_TEST.
> >
> > It still needs some work with dwmac-sun8i.c glue layer, eg:
> > tx/rx-delay setting, clk & pinmux drivers.
> >
> > The patch is just to help people using D1 with GMAC temporarily with
> > network function.
>
> It should be marked "DO NOT MERGE" or similar then.
Yes, thx for reminding. I'll fix it next time.

>
> Best regards,
> Jernej
>
> >
> > > But I guess you need some extra care to make the non-coherent DMA work?
> > > I haven't looked in detail, but are those new CMOs hooked into the
> > > generic DMA framework?
> >
> > Yes, we have the simliar principle with arm & csky for non-coherent:
> >  - Using PTE attributes setting Using PTE attributes to support
> > _PAGE_IOREMAP & _PAGE_WRITECOMBINE
> >  - Using CMO instructions deal SYNC_DMA_FOR_CPU/DEVICE.
> >
> > > Cheers,
> > > Andre
> > >
> > > > Signed-off-by: Liu Shaohua <liush at allwinnertech.com>
> > > > Tested-by: Guo Ren <guoren at kernel.org>
> > > > Signed-off-by: Guo Ren <guoren at kernel.org>
> > > > Cc: Maxime Ripard <mripard at kernel.org>
> > > > Cc: Corentin Labbe <clabbe at baylibre.com>
> > > > Cc: Samuel Holland <samuel at sholland.org>
> > > > Cc: Icenowy Zheng <icenowy at aosc.io>
> > > > Cc: LABBE Corentin <clabbe.montjoie at gmail.com>
> > > > Cc: Michael Walle <michael at walle.cc>
> > > > Cc: Chen-Yu Tsai <wens at csie.org>
> > > > Cc: Maxime Ripard <maxime at cerno.tech>
> > > > Cc: Wei Fu <wefu at redhat.com>
> > > > Cc: Wei Wu <lazyparser at gmail.com>
> > > > Signed-off-by: Guo Ren <guoren at linux.alibaba.com>
>
>
>


-- 
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/



More information about the linux-riscv mailing list