sun7i DMA support

46 views
Skip to first unread message

Pablo De Paulis

unread,
Aug 1, 2022, 10:13:00 AM8/1/22
to linux-sunxi
Greetings,
  I recently joined this group, so apologies in advance if I'm off here, but my understanding is that the group consists of several notorious contributors in the effort to bring sun7i linux (stuck in 3.x kernel) to mainline Linux kernel.
We've been trying to find out if a DMA support for the A20 SoC has been merged.

We are using Olimex-linux 5.10.105 (for a A20-OLinuXino-micro offshoot), and when trying to build a kernel module we can't find some files, in particular what used to be:

linux-sunxi/arch/arm/mach-sun7i/include/mach/dma.h

Found a message from Mr. Masson circa 2013 with a patch for spi_sunixi unified sun7i support which included the aforementioned dma.h, among others. That patch never really made it.

The last message I found Benoit mentioned something along the lines of "using Ryan’s sun7i Normal DMA version".

There's also extensive work from Mr. Ripard and Mr. Lopez on patches to support the DMA engine present on Allwinner A10, A13, A10S and A20 SoCs circa 2015, but somehow the interface provided by the sunxi 3.4 Linux is not there.

Looking into the Bootlin I can also not find the aforementioned file. Also looked in the olimex-linux menuconfig in DMA support, but there's nothing that resembles A20 DMA support.

So, it looks like that particular DMA interface never made it into mainline.

Again, apologies in advance if this is not the right place for these types of questions, but if anyone has any leads or information it'd be appreciated.

Best,
  Pablo

Clément Péron

unread,
Aug 1, 2022, 12:03:45 PM8/1/22
to pdep...@sangoma.com, linux-sunxi
Hi Pablo,


On Mon, 1 Aug 2022 at 16:13, 'Pablo De Paulis' via linux-sunxi
<linux...@googlegroups.com> wrote:
>
> Greetings,
> I recently joined this group, so apologies in advance if I'm off here, but my understanding is that the group consists of several notorious contributors in the effort to bring sun7i linux (stuck in 3.x kernel) to mainline Linux kernel.
> We've been trying to find out if a DMA support for the A20 SoC has been merged.
>
> We are using Olimex-linux 5.10.105 (for a A20-OLinuXino-micro offshoot), and when trying to build a kernel module we can't find some files, in particular what used to be:
>
> linux-sunxi/arch/arm/mach-sun7i/include/mach/dma.h
>
> Found a message from Mr. Masson circa 2013 with a patch for spi_sunixi unified sun7i support which included the aforementioned dma.h, among others. That patch never really made it.
>
> The last message I found Benoit mentioned something along the lines of "using Ryan’s sun7i Normal DMA version".
>
> There's also extensive work from Mr. Ripard and Mr. Lopez on patches to support the DMA engine present on Allwinner A10, A13, A10S and A20 SoCs circa 2015, but somehow the interface provided by the sunxi 3.4 Linux is not there.
>
> Looking into the Bootlin I can also not find the aforementioned file. Also looked in the olimex-linux menuconfig in DMA support, but there's nothing that resembles A20 DMA support.
>
> So, it looks like that particular DMA interface never made it into mainline.

https://linux-sunxi.org/Linux_mainlining_effort#Status_Matrix
Show DMA for A20 merged in 4.3

Seems also present in device-tree:
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L327-L333

Also your board seems supported:
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts

Regards

>
> Again, apologies in advance if this is not the right place for these types of questions, but if anyone has any leads or information it'd be appreciated.
>
> Best,
> Pablo
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/83038138-f6d9-4929-92f0-a1a50ce939f4n%40googlegroups.com.

Pablo De Paulis

unread,
Aug 1, 2022, 2:15:21 PM8/1/22
to linux-sunxi
Hi Clement,
  Yes, indeed we have our Olimex board working in 5.10 for the most part, so its device tree is indeed merged in.

I saw that Status Matrix awhile back indeed, and so we were encouraged; however we hit a wall when a bunch of DMA source files, in particular:
<mach/platform.h>
<plat/sys_config.h>   
<mach/dma.h>                    #linux-sunxi/arch/arm/mach-sun7i/include/mach/dma.h
<mach/clock.h>

aren't available in the 5.10 source tree.
There are other dma.h in the 5.10 source tree but none has the definitions found in the sunxi 3.4 source tree, i.e.:

Our board adds a device for telephone interface that uses the A20 DMA and its module requires these dma-interface files to build it, so we are not able to build it in the 5.10.

Again the only reference to, at least some of these files was in the conversation from Benoit Masson circa 2013 with a patch for spi_sunixi unified sun7i support.

  Pablo

Clément Péron

unread,
Aug 1, 2022, 3:48:27 PM8/1/22
to pdep...@sangoma.com, linux-sunxi
Hi Pablo,

On Mon, 1 Aug 2022 at 20:15, 'Pablo De Paulis' via linux-sunxi
<linux...@googlegroups.com> wrote:
>
> Hi Clement,
> Yes, indeed we have our Olimex board working in 5.10 for the most part, so its device tree is indeed merged in.
>
> I saw that Status Matrix awhile back indeed, and so we were encouraged; however we hit a wall when a bunch of DMA source files, in particular:
> <mach/platform.h>
> <plat/sys_config.h>
> <mach/dma.h> #linux-sunxi/arch/arm/mach-sun7i/include/mach/dma.h
> <mach/clock.h>
>
> aren't available in the 5.10 source tree.
> There are other dma.h in the 5.10 source tree but none has the definitions found in the sunxi 3.4 source tree, i.e.:
> https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/arch/arm/mach-sun7i/include/mach/dma.h

This DMA API is vendor specific and can't be upstreamed.

The kernel have one:
https://www.kernel.org/doc/html/v5.10/driver-api/dma-buf.html

>
> Our board adds a device for telephone interface that uses the A20 DMA and its module requires these dma-interface files to build it, so we are not able to build it in the 5.10.

You need to convert your module to use the kernel one.

Regards,
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/d9cc8750-268d-4049-8397-97f22719ff64n%40googlegroups.com.

Pablo De Paulis

unread,
Aug 1, 2022, 3:53:51 PM8/1/22
to Clément Péron, linux-sunxi
Thank you Clement!
Ah, ok, yes from Allwinner I suppose.

Good day,
  Pablo
Reply all
Reply to author
Forward
0 new messages