ARM: PL08X: Add PL08x AMBA DMA Controller driver.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
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 <[email protected]>
Date: 2010/5/30
Subject: Re: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver.
To: Peter Pearse <[email protected]>
Kopia: linux-arm-kernel <[email protected]>
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 <[email protected]>:
Quoted 7 lines
(quoted diff) +7
-0+/* + * Return number of bytes to fill to boundary, or len + */ +static int pl08x_pre_boundary(int addr, int len) +{ + ? ? ? int boundary; +
Review
Quoted 10 lines
(quoted diff) +10
-0+ ? ? ? 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:
Quoted 22 lines
(quoted diff) +21
-0+/* + * 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
Review
Quoted 10 lines
(quoted diff) +10
-0+ ? ? ? ? ? ? ? ? ? ? ? ?* ?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
RFC PATCH 1/3 ARM: PL08X: Add PL08x AMBA DMA Controller driver.
Quoted 97 lines
-----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 <[email protected]>
Date: 2010/5/30
Subject: Re: [RFC, PATCH 1/3] ARM: PL08X: Add PL08x AMBA DMA Controller driver.
To: Peter Pearse <[email protected]>
Kopia: linux-arm-kernel <[email protected]>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 <[email protected]>:
Quoted 2 lines
+/*
+ * Return number of bytes to fill to boundary, or len */static int
Quoted 5 lines
(quoted diff) +5
-0+pl08x_pre_boundary(int addr, int len) { + ? ? ? int boundary; + + ? ? ? if (len <= 0) + ? ? ? ? ? ? ? printk(KERN_ERR "PL08X::pre_boundary() - zeroReview
Quoted 10 lines
(quoted diff) +10
-0+ length\n"); + + ? ? ? boundary = ((addr >> PL08X_BOUNDARY_SHIFT) + 1) << + PL08X_BOUNDARY_SHIFT; + + ? ? ? if (boundary < addr + len) + ? ? ? ? ? ? ? return boundary - addr; + ? ? ? else + ? ? ? ? ? ? ? return len; +}This
PL08X_BOUNDARY_SHIFTis defined to
#definePL08X_BOUNDARY_SHIFT? ? ? ? ? (10) ? ?/* 1KB0x400*/ #definePL08X_BOUNDARY_SIZE? ? ? ? ? ?(1 <<PL08X_BOUNDARY_SHIFT)And then later:
Review
Quoted 7 lines
(quoted diff) +6
-0+/* + * 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 lessthan one bus
Quoted 19 lines
+ width left
+ ? ? ? ? ? ? ? ?*/
+ ? ? ? ? ? ? ? while (remainder > (mbus->buswidth- 1)) {
+ ? ? ? ? ? ? ? ? ? ? ? intlli_len,target_len;
+ ? ? ? ? ? ? ? ? ? ? ? int tsize;
+ ? ? ? ? ? ? ? ? ? ? ? intodd_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)Quoted 8 lines
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
local_txd->srcbus.fill_bytes
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? =
+ pl08x_pre_boundary(local_txd->srcbus.addr
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ,
+ remainder);
+ ? ? ? ? ? ? ? ? ? ? ? else
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?local_txd->srcbus.fill_bytes
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? =max_bytes_per_lli;
Quoted 6 lines
Here the transfer lengths for lli:s crawls up tp a boundary. Now, the DMAC PL08x cannot move past a
0x400boundary 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......
Quoted 12 lines
- 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