[PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180
linus.walleij at linaro.org
Thu Jan 27 08:07:21 EST 2011
2011/1/25 Russell King - ARM Linux <linux at arm.linux.org.uk>:
> The DMA controller must be programmed with the right burst size for the
> peripheral, which in this case would be 8 words, otherwise the 'last'
> burst signalling goes wrong.
Now I think I found the real bug behind this...
In the Vendor data we set this:
.dmareg_enable = 1 << 12, /* DMAREQCTRL */
This actually means:
DMAREQCTL: DMA requests control.
0: SREQ are generated when data to be transferred is
less than 8 words.
1: no SREQ is generated when data to be transferred
is less than 8 words, LBREQ is generated instead.
Which will work for all MMC card transfers I believe, since
these are even 512 byte multiples. No problem...
Then comes an SDIO request and it is 7 bytes so LBREQ
is emitted 7 times instead of 6 * SREQ + 1 LSREQ.
Which works if you set down the burst size to 1 byte,
firing 7 consecutive bursts each terminated with LBREQ
which the DMA controller is perfectly happy with.
So while setting the burstsize down to 1 byte works
since it matches the twisted logic of DMAREQCTL,
instead flipping the bit in DMAREQCTL to 0
if (size % 8 != 0) makes some more kind of sense.
This needs to be tested to see whether it works or
not, so I'll see what we can do.
More information about the linux-arm-kernel