David VomLehn ca36c36b78 MIPS: PowerTV: Use O(1) algorthm for phys_to_dma/dma_to_phys
Replace phys_to_dma()/dma_to_phys() looping algorithm with an O(1) algorithm
The approach taken is inspired by the sparse memory implementation: take a
certain number of high-order bits off the address them, use this as an
index into a table containing an offset to the desired address and add
it to the original value. There is a table for mapping physical addresses
to DMA addresses and another one for the reverse mapping. The table sizes
depend on how fine-grained the mappings need to be; Coarser granularity
less to smaller tables.  On a processor with 32-bit physical and DMA
addresses, with 4 MIB granularity, memory usage is two 2048-byte arrays.
Each 32-byte cache line thus covers 64 MiB of address space.

Also, renames phys_to_bus() to phys_to_dma() and bus_to_phys() to
dma_to_phys() to align with kernel usage.

[Ralf: Fixed silly build breakage due to stackoverflow warning caused by
huge array on stack.]

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1257/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05 13:25:40 +01:00
..
2010-02-27 12:53:30 +01:00
2009-09-17 20:07:42 +02:00
2010-02-27 12:53:14 +01:00
2009-07-03 15:45:26 +01:00
2008-12-12 18:12:23 +00:00
2010-02-27 12:53:42 +01:00
2010-02-27 12:53:06 +01:00
2009-12-05 09:10:12 -08:00
2009-12-17 01:57:30 +00:00
2010-02-27 12:53:27 +01:00
2010-02-27 12:53:14 +01:00
2009-07-03 15:45:29 +01:00
2010-04-12 17:26:14 +01:00
2009-06-07 05:01:00 -07:00
2009-12-17 11:03:24 -05:00
2009-12-17 01:57:32 +00:00
2009-05-14 13:50:29 +01:00
2010-02-27 12:53:12 +01:00
2009-06-17 11:06:28 +01:00
2010-01-05 15:34:49 +09:00
2008-10-20 08:52:41 -07:00
2010-04-12 17:26:14 +01:00
2010-04-12 17:26:14 +01:00
2010-02-27 12:53:14 +01:00
2010-02-27 12:53:14 +01:00
2010-02-27 12:53:27 +01:00
2009-07-03 15:45:27 +01:00
2010-02-27 12:53:27 +01:00
2009-11-02 12:00:01 +01:00
2010-02-27 12:53:14 +01:00
2010-02-27 12:53:42 +01:00
2010-02-27 12:53:42 +01:00
2009-06-17 11:06:31 +01:00
2010-02-27 12:53:06 +01:00
2010-02-27 12:53:27 +01:00
2010-07-26 19:08:17 +01:00
2010-04-12 17:26:14 +01:00