linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: alim.akhtar@gmail.com (Alim Akhtar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 1/1] dmaengine/amba-pl08x: Add support for s3c64xx DMAC
Date: Wed, 28 Sep 2011 14:29:30 +0530	[thread overview]
Message-ID: <CAGOxZ53Yu3fi7rNOMJ2BiT-vsFn2R9aGBTUc9s53AJsKa=AMBA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdZesKGuPGmUifLj4puN_e=kYAb4WyuQs+xERn9q7036rg@mail.gmail.com>

HI Linus,
Thanks for reviewing again.

On Wed, Sep 28, 2011 at 1:31 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> Sorry if I missed a few nitpicks last time, anyway it's looking much better now:
>
> On Wed, Sep 28, 2011 at 7:50 AM, Alim Akhtar <alim.akhtar@samsung.com> wrote:
>> + ? ? ? /*
>> + ? ? ? ?* Samsung pl080 DMAC has one exrta control register
>
> s/exrta/exstra
>
I will correct this.
>> + ? ? ? if (pl08x->vd->is_pl080_s3c) {
>> + ? ? ? ? ? ? ? writel(txd->ccfg, phychan->base + PL080S_CH_CONFIG);
>> + ? ? ? ? ? ? ? writel(lli->cctl1, phychan->base + PL080S_CH_CONTROL2);
>> + ? ? ? } else
>> + ? ? ? ? ? ? ? writel(txd->ccfg, phychan->base + PL080_CH_CONFIG);
>
> What do you think about adding a field to the struct pl08x
> like
>
> u32 config_reg
>
> that we set to the proper config register (PL080S_CH_CONFIG or
> PL080_CH_CONFIG in probe(), so the above
> becomes the simpler variant:
>
> writel(txd->ccfg, phychan->base + pl08x->config_reg);
> if (pl08x->vd->is_pl080_s3c)
> ? ?writel(lli->cctl1, phychan->base + PL080S_CH_CONTROL2);
>
I will try implement this way or as viresh has pointed out to remove
the code duplications.

>> + ? ? ? if (pl08x->vd->is_pl080_s3c) {
>> + ? ? ? ? ? ? ? val = readl(phychan->base + PL080S_CH_CONFIG);
>> + ? ? ? ? ? ? ? while ((val & PL080_CONFIG_ACTIVE) ||
>> + ? ? ? ? ? ? ? ? ? ? ? (val & PL080_CONFIG_ENABLE))
>> + ? ? ? ? ? ? ? ? ? ? ? val = readl(phychan->base + PL080S_CH_CONFIG);
>> +
>> + ? ? ? ? ? ? ? writel(val | PL080_CONFIG_ENABLE,
>> + ? ? ? ? ? ? ? ? ? ? ? phychan->base + PL080S_CH_CONFIG);
>> + ? ? ? } else {
>> ? ? ? ? ? ? ? ?val = readl(phychan->base + PL080_CH_CONFIG);
>> + ? ? ? ? ? ? ? ? ? ? ? while ((val & PL080_CONFIG_ACTIVE) ||
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (val & PL080_CONFIG_ENABLE))
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? val = readl(phychan->base + PL080_CH_CONFIG);
>>
>> - ? ? ? writel(val | PL080_CONFIG_ENABLE, phychan->base + PL080_CH_CONFIG);
>> + ? ? ? ? ? ? ? writel(val | PL080_CONFIG_ENABLE,
>> + ? ? ? ? ? ? ? ? ? ? ? phychan->base + PL080_CH_CONFIG);
>> + ? ? ? }
>
> This would also become much simpler with that approach I think...
>
OK, i will do that.
>> ? ? ? ?/* Set the HALT bit and wait for the FIFO to drain */
>> - ? ? ? val = readl(ch->base + PL080_CH_CONFIG);
>> - ? ? ? val |= PL080_CONFIG_HALT;
>> - ? ? ? writel(val, ch->base + PL080_CH_CONFIG);
>> -
>> + ? ? ? if (pl08x->vd->is_pl080_s3c) {
>> + ? ? ? ? ? ? ? val = readl(ch->base + PL080S_CH_CONFIG);
>> + ? ? ? ? ? ? ? val |= PL080_CONFIG_HALT;
>> + ? ? ? ? ? ? ? writel(val, ch->base + PL080S_CH_CONFIG);
>> + ? ? ? } else {
>> + ? ? ? ? ? ? ? val = readl(ch->base + PL080_CH_CONFIG);
>> + ? ? ? ? ? ? ? val |= PL080_CONFIG_HALT;
>> + ? ? ? ? ? ? ? writel(val, ch->base + PL080_CH_CONFIG);
>> + ? ? ? }
>
> This would become simply:
>
> val = readl(ch->base + pl08x->config_reg);
> val |= PL080_CONFIG_HALT;
> writel(val, ch->base + pl08x->config_reg);
>
>
ok, i will do that.
>> ? ? ? ?/* Clear the HALT bit */
>> - ? ? ? val = readl(ch->base + PL080_CH_CONFIG);
>> - ? ? ? val &= ~PL080_CONFIG_HALT;
>> - ? ? ? writel(val, ch->base + PL080_CH_CONFIG);
>> + ? ? ? if (pl08x->vd->is_pl080_s3c) {
>> + ? ? ? ? ? ? ? val = readl(ch->base + PL080S_CH_CONFIG);
>> + ? ? ? ? ? ? ? val &= ~PL080_CONFIG_HALT;
>> + ? ? ? ? ? ? ? writel(val, ch->base + PL080S_CH_CONFIG);
>> + ? ? ? } else {
>> + ? ? ? ? ? ? ? val = readl(ch->base + PL080_CH_CONFIG);
>> + ? ? ? ? ? ? ? val &= ~PL080_CONFIG_HALT;
>> + ? ? ? ? ? ? ? writel(val, ch->base + PL080_CH_CONFIG);
>> + ? ? ? }
>
> This would get rid of the if/else clauses
>
ok, understand
>> + ? ? ? if (pl08x->vd->is_pl080_s3c) {
>> + ? ? ? ? ? ? ? u32 val = readl(ch->base + PL080S_CH_CONFIG);
>> + ? ? ? ? ? ? ? val &= ~(PL080_CONFIG_ENABLE | PL080_CONFIG_ERR_IRQ_MASK |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PL080_CONFIG_TC_IRQ_MASK);
>> + ? ? ? ? ? ? ? writel(val, ch->base + PL080S_CH_CONFIG);
>> + ? ? ? } else {
>> + ? ? ? ? ? ? ? u32 val = readl(ch->base + PL080_CH_CONFIG);
>> + ? ? ? ? ? ? ? val &= ~(PL080_CONFIG_ENABLE | PL080_CONFIG_ERR_IRQ_MASK |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PL080_CONFIG_TC_IRQ_MASK);
>> + ? ? ? ? ? ? ? writel(val, ch->base + PL080_CH_CONFIG);
>> + ? ? ? }
>
> As would this...
>
>> + ? ? ? /* Samsung DMAC is PL080 variant*/
>> + ? ? ? {
>> + ? ? ? ? ? ? ? .id ? ? = 0x00041082,
>> + ? ? ? ? ? ? ? .mask ? = 0x000fffff,
>> + ? ? ? ? ? ? ? .data ? = &vendor_pl080_s3c,
>
> Does the hardware realy have this primecell number or is it something that is
> hardcoded from the board/device tree?
>
It is a hardcoded value as s3c64xx does not have Identification registers.

> If it is hardcoded then no objections.
>
> In the latter case, replace 0x41 (= 'A', ARM) with something like
> 0x55 'U' for Samsung or so. Or 0x51 'S'. Or whatever you like.
>
> Then add that to include/linux/amba/bus.h as
> AMBA_VENDOR_SAMSUNG = 0x55,
> so we have this under some kind of control.
>
> Yours,
> Linus Walleij
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>



-- 
aLim akHtaR
mAin hUn nA :-)

  reply	other threads:[~2011-09-28  8:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28  5:50 [PATCH V2 0/1] dmaengine/amba-pl08x: Add support for s3c64xx DMAC Alim Akhtar
2011-09-28  5:50 ` [PATCH V2 1/1] " Alim Akhtar
2011-09-28  7:45   ` Viresh Kumar
2011-09-28  8:50     ` Alim Akhtar
2011-09-28  9:54       ` Viresh Kumar
2011-09-28 11:54         ` Alim Akhtar
2011-09-29  4:22           ` Viresh Kumar
2011-09-28  8:01   ` Linus Walleij
2011-09-28  8:59     ` Alim Akhtar [this message]
2011-12-07 23:43 ` [PATCH V2 0/1] " Linus Walleij
2011-12-08  1:03   ` Alim Akhtar
2012-04-09 20:50     ` Linus Walleij
2012-05-28  4:41     ` Linus Walleij
2012-05-28  7:36       ` Russell King - ARM Linux
2012-05-29  9:23         ` Alim Akhtar
2012-07-09 20:47 ` 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='CAGOxZ53Yu3fi7rNOMJ2BiT-vsFn2R9aGBTUc9s53AJsKa=AMBA@mail.gmail.com' \
    --to=alim.akhtar@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).