All of lore.kernel.org
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180
Date: Thu, 27 Jan 2011 14:07:21 +0100	[thread overview]
Message-ID: <AANLkTikLABG5yWDYcOe12mfy_Hco15k_ByqYX15GH9Cy@mail.gmail.com> (raw)
In-Reply-To: <20110125102351.GA11507@n2100.arm.linux.org.uk>

2011/1/25 Russell King - ARM Linux <linux@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.

Yours,
Linus Walleij

  reply	other threads:[~2011-01-27 13:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06  9:42 [PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180 Linus Walleij
2010-12-19 16:32 ` Russell King - ARM Linux
2010-12-19 19:59   ` Russell King - ARM Linux
2010-12-21 13:54     ` Russell King - ARM Linux
2010-12-21 15:59       ` Russell King - ARM Linux
2010-12-22 21:55         ` Linus Walleij
2011-01-24 16:01           ` Russell King - ARM Linux
2011-01-24 21:06             ` Linus Walleij
2011-01-24 21:22               ` Russell King - ARM Linux
2011-01-25  8:33                 ` Linus Walleij
2011-01-26  9:24                   ` Russell King - ARM Linux
2011-01-26  9:50                   ` Russell King - ARM Linux
2011-01-25  9:36                 ` Linus Walleij
2011-01-25  9:47                 ` Linus Walleij
2011-01-25 10:23                   ` Russell King - ARM Linux
2011-01-27 13:07                     ` Linus Walleij [this message]
2011-02-01 13:30                       ` Russell King - ARM Linux
2011-02-01 14:15                         ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikLABG5yWDYcOe12mfy_Hco15k_ByqYX15GH9Cy@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.