All of lore.kernel.org
 help / color / mirror / Atom feed
* Fwd: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver.
       [not found]   ` <AANLkTilXKWWvn6HLjfbcC0XFEn-Z7jSf4f6CKHBuW8Qb@mail.gmail.com>
@ 2010-06-02  6:19     ` Linus Walleij
  2010-06-03 10:42       ` Peter Pearse
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2010-06-02  6:19 UTC (permalink / raw)
  To: linux-arm-kernel

Oops this was onto the old list address, Peter is busy so does anybody
else know about
address boundaries in the RealViews?

Linus Walleij


---------- Forwarded message ----------
From: Linus Walleij <linus.ml.walleij@gmail.com>
Date: 2010/5/30
Subject: Re: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver.
To: Peter Pearse <peter.pearse@arm.com>
Kopia: linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>


Hi,

as you know I'm hacking around with this PL08x driver since the Versatile
support is in the way for getting my DMA work merged.

Now this piece I don't quite get:

2008/11/21 Peter Pearse <protected@arm.com>:


> +/*
> + * Return number of bytes to fill to boundary, or len
> + */
> +static int pl08x_pre_boundary(int addr, int len)
> +{
> + ? ? ? int boundary;
> +
> + ? ? ? if (len <= 0)
> + ? ? ? ? ? ? ? printk(KERN_ERR "PL08X::pre_boundary() - zero length\n");
> +
> + ? ? ? boundary = ((addr >> PL08X_BOUNDARY_SHIFT) + 1) << PL08X_BOUNDARY_SHIFT;
> +
> + ? ? ? if (boundary < addr + len)
> + ? ? ? ? ? ? ? return boundary - addr;
> + ? ? ? else
> + ? ? ? ? ? ? ? return len;
> +}

This PL08X_BOUNDARY_SHIFT is defined to
#define PL08X_BOUNDARY_SHIFT ? ? ? ? ? (10) ? ?/* 1KB 0x400 */
#define PL08X_BOUNDARY_SIZE ? ? ? ? ? ?(1 << PL08X_BOUNDARY_SHIFT)

And then later:

> +/*
> + * Note that we assume we never have to change the burst sizes
> + */
> +int fill_LLIS_for_desc(struct pl08x_txd *local_txd, int pl08x_chan_num)
> +{
> (...)
> + ? ? ? ? ? ? ? /*
> + ? ? ? ? ? ? ? ?* Make largest possible LLIs until less than one bus width left
> + ? ? ? ? ? ? ? ?*/
> + ? ? ? ? ? ? ? while (remainder > (mbus->buswidth - 1)) {
> + ? ? ? ? ? ? ? ? ? ? ? int lli_len, target_len;
> + ? ? ? ? ? ? ? ? ? ? ? int tsize;
> + ? ? ? ? ? ? ? ? ? ? ? int odd_bytes;
> + ? ? ? ? ? ? ? ? ? ? ? /*
> + ? ? ? ? ? ? ? ? ? ? ? ?* If enough left try to send max possible,
> + ? ? ? ? ? ? ? ? ? ? ? ?* otherwise try to send the remainder
> + ? ? ? ? ? ? ? ? ? ? ? ?*/
> + ? ? ? ? ? ? ? ? ? ? ? target_len = remainder;
> + ? ? ? ? ? ? ? ? ? ? ? if (remainder > max_bytes_per_lli)
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? target_len = max_bytes_per_lli;
> + ? ? ? ? ? ? ? ? ? ? ? /*
> + ? ? ? ? ? ? ? ? ? ? ? ?* ?Set bus lengths for incrementing busses
> + ? ? ? ? ? ? ? ? ? ? ? ?* ?to number of bytes which fill
> + ? ? ? ? ? ? ? ? ? ? ? ?* ?to next memory boundary
> + ? ? ? ? ? ? ? ? ? ? ? ?*/
> + ? ? ? ? ? ? ? ? ? ? ? if (cctl_parm.bits.si)
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? local_txd->srcbus.fill_bytes
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = pl08x_pre_boundary(local_txd->srcbus.addr
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? , remainder);
> + ? ? ? ? ? ? ? ? ? ? ? else
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? local_txd->srcbus.fill_bytes
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = max_bytes_per_lli;

Here the transfer lengths for lli:s crawls up tp a boundary.
Now, the DMAC PL08x cannot move past a 0x400 boundary on the RealViews,
so much is clear. But: is this a thing that will affect:

- All RealView / Versatile equipment
- All implementations of PL08x on all silicon
- All ARM architectures and nothing to do with the PL08x at all, rather
?with some AMBA stuff or so?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller  driver.
  2010-06-02  6:19     ` Fwd: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver Linus Walleij
@ 2010-06-03 10:42       ` Peter Pearse
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Pearse @ 2010-06-03 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

 

> -----Original Message-----
> From: linux-arm-kernel-bounces at lists.infradead.org 
> [mailto:linux-arm-kernel-bounces at lists.infradead.org] On 
> Behalf Of Linus Walleij
> Sent: 02 June 2010 07:19
> To: linux-arm-kernel at lists.infradead.org
> Subject: Fwd: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA 
> Controller driver.
> 
> Oops this was onto the old list address, Peter is busy so 
> does anybody else know about address boundaries in the RealViews?
> 
> Linus Walleij
> 
> 
> ---------- Forwarded message ----------
> From: Linus Walleij <linus.ml.walleij@gmail.com>
> Date: 2010/5/30
> Subject: Re: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA 
> Controller driver.
> To: Peter Pearse <peter.pearse@arm.com>
> Kopia: linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>
> 
> 
> Hi,
> 
> as you know I'm hacking around with this PL08x driver since 
> the Versatile support is in the way for getting my DMA work merged.
> 
> Now this piece I don't quite get:
> 
> 2008/11/21 Peter Pearse <protected@arm.com>:
> 
> 
> > +/*
> > + * Return number of bytes to fill to boundary, or len  */ 
> static int 
> > +pl08x_pre_boundary(int addr, int len) {
> > + ? ? ? int boundary;
> > +
> > + ? ? ? if (len <= 0)
> > + ? ? ? ? ? ? ? printk(KERN_ERR "PL08X::pre_boundary() - zero 
> > + length\n");
> > +
> > + ? ? ? boundary = ((addr >> PL08X_BOUNDARY_SHIFT) + 1) << 
> > + PL08X_BOUNDARY_SHIFT;
> > +
> > + ? ? ? if (boundary < addr + len)
> > + ? ? ? ? ? ? ? return boundary - addr;
> > + ? ? ? else
> > + ? ? ? ? ? ? ? return len;
> > +}
> 
> This PL08X_BOUNDARY_SHIFT is defined to
> #define PL08X_BOUNDARY_SHIFT ? ? ? ? ? (10) ? ?/* 1KB 0x400 
> */ #define PL08X_BOUNDARY_SIZE ? ? ? ? ? ?(1 << PL08X_BOUNDARY_SHIFT)
> 
> And then later:
> 
> > +/*
> > + * Note that we assume we never have to change the burst sizes  */ 
> > +int fill_LLIS_for_desc(struct pl08x_txd *local_txd, int 
> > +pl08x_chan_num) {
> > (...)
> > + ? ? ? ? ? ? ? /*
> > + ? ? ? ? ? ? ? ?* Make largest possible LLIs until less 
> than one bus 
> > + width left
> > + ? ? ? ? ? ? ? ?*/
> > + ? ? ? ? ? ? ? while (remainder > (mbus->buswidth - 1)) {
> > + ? ? ? ? ? ? ? ? ? ? ? int lli_len, target_len;
> > + ? ? ? ? ? ? ? ? ? ? ? int tsize;
> > + ? ? ? ? ? ? ? ? ? ? ? int odd_bytes;
> > + ? ? ? ? ? ? ? ? ? ? ? /*
> > + ? ? ? ? ? ? ? ? ? ? ? ?* If enough left try to send max possible,
> > + ? ? ? ? ? ? ? ? ? ? ? ?* otherwise try to send the remainder
> > + ? ? ? ? ? ? ? ? ? ? ? ?*/
> > + ? ? ? ? ? ? ? ? ? ? ? target_len = remainder;
> > + ? ? ? ? ? ? ? ? ? ? ? if (remainder > max_bytes_per_lli)
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? target_len = max_bytes_per_lli;
> > + ? ? ? ? ? ? ? ? ? ? ? /*
> > + ? ? ? ? ? ? ? ? ? ? ? ?* ?Set bus lengths for incrementing busses
> > + ? ? ? ? ? ? ? ? ? ? ? ?* ?to number of bytes which fill
> > + ? ? ? ? ? ? ? ? ? ? ? ?* ?to next memory boundary
> > + ? ? ? ? ? ? ? ? ? ? ? ?*/
> > + ? ? ? ? ? ? ? ? ? ? ? if (cctl_parm.bits.si)
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? local_txd->srcbus.fill_bytes
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = 
> > + pl08x_pre_boundary(local_txd->srcbus.addr
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? , 
> > + remainder);
> > + ? ? ? ? ? ? ? ? ? ? ? else
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? local_txd->srcbus.fill_bytes
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = max_bytes_per_lli;
> 
> Here the transfer lengths for lli:s crawls up tp a boundary.
> Now, the DMAC PL08x cannot move past a 0x400 boundary on the 
> RealViews, so much is clear. But: is this a thing that will affect:
> 
> - All RealView / Versatile equipment
> - All implementations of PL08x on all silicon

Both pl08x manuals have
3.5 Address generation
Address generation can be either incrementing or non-incrementing. Address
wrapping
is not supported. Bursts do not cross the 1KB address boundary.


Although our partners may choose to adapt their implementations to cross
boundaries

the driver should play safe......



> - All ARM architectures and nothing to do with the PL08x at 
> all, rather
> ?with some AMBA stuff or so?
> 
> Yours,
> Linus Walleij
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-03 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1227275251-12005-1-git-send-email-protected@arm.com>
     [not found] ` <1227275251-12005-2-git-send-email-protected@arm.com>
     [not found]   ` <AANLkTilXKWWvn6HLjfbcC0XFEn-Z7jSf4f6CKHBuW8Qb@mail.gmail.com>
2010-06-02  6:19     ` Fwd: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver Linus Walleij
2010-06-03 10:42       ` Peter Pearse

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.