Page MenuHomeFreeBSD

ARM - fix bcm2835 DMA driver (rpi-b, rpi2)
ClosedPublic

Authored by skra on Nov 27 2015, 8:54 PM.
Tags
Referenced Files
Unknown Object (File)
Sat, Apr 27, 12:26 AM
Unknown Object (File)
Fri, Apr 26, 10:48 PM
Unknown Object (File)
Fri, Apr 26, 10:48 PM
Unknown Object (File)
Fri, Apr 26, 10:27 PM
Unknown Object (File)
Feb 16 2024, 7:37 AM
Unknown Object (File)
Jan 10 2024, 12:50 PM
Unknown Object (File)
Jan 10 2024, 12:50 PM
Unknown Object (File)
Jan 10 2024, 12:50 PM
Subscribers

Details

Summary

It turned out that there are some DMA channels either reserved and/or used by GPU. Thus "broadcom,channels" fdt property is used to get free DMA channels mask. Further, channels known that they are used by GPU are masked out too.

More small changes was done:
(1) All remaining channels are enabled now.
(2) CS_RESET bit is used for initial channel reset.
(3) Interrupts for reserved channels are not enabled.
(4) SDHCI controller does not allocate any specific DMA channel.

As channel 3 is used by GPU, this patch solves the following warnings:
bcm_dma0: unused DMA intr CH=3, CS=20f10027

Test Plan

Tested on both rpi-b and rpi2.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

skra retitled this revision from to ARM - fix bcm2835 DMA driver (rpi-b, rpi2).
skra updated this object.
skra edited the test plan for this revision. (Show Details)
skra added reviewers: andrew, gonzo, kib.
skra set the repository for this revision to rS FreeBSD src repository - subversion.
skra added a project: ARM.
skra added a subscriber: ARM.

Shouldn't we be using the brcm,dma-channel-mask property? It's missing from our dts, but should be added.

In D4303#90643, @andrew wrote:

Shouldn't we be using the brcm,dma-channel-mask property? It's missing from our dts, but should be added.

Yes, but there is broadcom,channels property in out dts which means same. I'm not sure if it's worth to change only this property to be consistent with linux dts. The driver, of course, could try to read both properties. But what is wanted final state? If it's a conversion of all rpi like drivers for linux dts, then I think it's not necessary to do it now just for one property. Right?

Looks like broadcom,channels is older way to handle this thing. It's filled by VideoCore, brcm,dma-channel-mask is set in dtb (it's not referenced anywhere in firmware). I suggest trying brcm,dma-channel-mask and falling back to broadcom,channels if it's not provided.

This revision was automatically updated to reflect the committed changes.