linux/arch
Trent Piepho a097a78c1e powerpc/fsl-pci: Better ATMU setup for 85xx/86xx
The code that sets up the outbound ATMU windows, which is used to map CPU
physical addresses into PCI bus addresses where BARs will be mapped, didn't
work so well.

For one, it leaked the ioremap() of the ATMU registers.  Another small bug
was the high 20 bits of the PCI bus address were left as zero.  It's legal
for prefetchable memory regions to be above 32 bits, so the high 20 bits
might not be zero.

Mainly, it couldn't handle ranges that were not a power of two in size or
were not naturally aligned.  The ATMU windows have these requirements (size
& alignment), but the code didn't bother to check if the ranges it was
programming met them.  If they didn't, the windows would silently be
programmed incorrectly.

This new code can handle ranges which are not power of two sized nor
naturally aligned.  It simply splits the ranges into multiple valid ATMU
windows.  As there are only four windows, pooly aligned or sized ranges
(which didn't even work before) may run out of windows.  In this case an
error is printed and an effort is made to disable the unmapped resources.

An improvement that could be made would be to make use of the default
outbound window.  Iff hose->pci_mem_offset is zero, then it's possible that
some or all of the ranges might not need an outbound window and could just
use the default window.

The default ATMU window can support a pci_mem_offset less than zero too,
but pci_mem_offset is unsigned.  One could say the abilities allowed a
powerpc pci_controller is neither subset nor a superset of the abilities of
a Freescale PCIe controller.  Thankfully, the most useful bits are in the
intersection of the two abilities.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-01-07 15:32:54 -06:00
..
alpha take init_fs to saner place 2008-12-31 18:07:42 -05:00
arm take init_fs to saner place 2008-12-31 18:07:42 -05:00
avr32 take init_fs to saner place 2008-12-31 18:07:42 -05:00
blackfin take init_fs to saner place 2008-12-31 18:07:42 -05:00
cris take init_fs to saner place 2008-12-31 18:07:42 -05:00
frv take init_fs to saner place 2008-12-31 18:07:42 -05:00
h8300 take init_fs to saner place 2008-12-31 18:07:42 -05:00
ia64 take init_fs to saner place 2008-12-31 18:07:42 -05:00
m32r take init_fs to saner place 2008-12-31 18:07:42 -05:00
m68k take init_fs to saner place 2008-12-31 18:07:42 -05:00
m68knommu take init_fs to saner place 2008-12-31 18:07:42 -05:00
mips take init_fs to saner place 2008-12-31 18:07:42 -05:00
mn10300 take init_fs to saner place 2008-12-31 18:07:42 -05:00
parisc take init_fs to saner place 2008-12-31 18:07:42 -05:00
powerpc powerpc/fsl-pci: Better ATMU setup for 85xx/86xx 2009-01-07 15:32:54 -06:00
s390 take init_fs to saner place 2008-12-31 18:07:42 -05:00
sh take init_fs to saner place 2008-12-31 18:07:42 -05:00
sparc take init_fs to saner place 2008-12-31 18:07:42 -05:00
um take init_fs to saner place 2008-12-31 18:07:42 -05:00
x86 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2008-12-31 15:57:56 -08:00
xtensa take init_fs to saner place 2008-12-31 18:07:42 -05:00
.gitignore
Kconfig oprofile: select RING_BUFFER 2008-12-12 09:46:31 +01:00