Page MenuHomeFreeBSD

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

Authored by skra on Nov 27 2015, 8:54 PM.
Tags
Referenced Files
F106057062: D4303.id10547.diff
Tue, Dec 24, 3:55 PM
F106052536: D4303.id10547.diff
Tue, Dec 24, 1:51 PM
F106050829: D4303.id13365.diff
Tue, Dec 24, 1:02 PM
Unknown Object (File)
Sat, Dec 21, 3:55 PM
Unknown Object (File)
Sat, Dec 21, 1:13 PM
Unknown Object (File)
Fri, Dec 20, 12:26 PM
Unknown Object (File)
Thu, Dec 19, 7:09 AM
Unknown Object (File)
Nov 24 2024, 1:16 AM
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.