pci/fsl_pci_init: Rework PCI ATMU setup to handle >4G of memory
authorKumar Gala <galak@kernel.crashing.org>
Wed, 5 Aug 2009 12:59:35 +0000 (07:59 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 28 Aug 2009 22:12:36 +0000 (17:12 -0500)
commitad19e7a5d2de337064ce7728d6504df9648f5d31
treeb9f8344338ac6397703851476bec6b43b55847f0
parent8295b94400449586505ffe34ec024feb3d2c8fe4
pci/fsl_pci_init: Rework PCI ATMU setup to handle >4G of memory

The old PCI ATMU setup code would just mimic the PCI regions into the
ATMU registers.  For simple memory maps in which all memory, MMIO, etc
space fit into 4G this works ok.  However there are issues with we have
>4G of memory as we know can't access all of memory and we need to
ensure that PCICSRBAR (PEXCSRBAR on PCIe) isn't overlapping with
anything since we can't turn it off.

We first setup outbound windows based on what the board code setup
in the pci regions for MMIO and IO access.  Next we place PCICSRBAR
below the MMIO window.  After which we try to setup the inbound windows
to map as much of memory as possible.

On PCIe based controllers we are able to overmap the ATMU setup since
RX & TX links are separate but report the proper amount of inbound
address space to the region tracking to ensure there is no overlap.

On PCI based controllers we use as many inbound windows as available to
map as much of the memory as possible.

Additionally we changed all the CCSR register access to use proper IO
accessor functions.  Also had to add CONFIG_SYS_CCSRBAR_PHYS to some
86xx platforms that didn't have it defined.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/pci/fsl_pci_init.c
include/configs/MPC8610HPCD.h
include/configs/sbc8641d.h