[RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver.

Peter Pearse peter.pearse at arm.com
Thu Jun 3 06:42:48 EDT 2010


 

> -----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 at 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 at arm.com>
> Kopia: linux-arm-kernel <linux-arm-kernel at 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 at 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
> 





More information about the linux-arm-kernel mailing list