linux/arch/arm/plat-orion
Thomas Petazzoni 217bef3d37 arm: plat-orion: fix address decoding when > 4GB is used
During the system initialization, the orion_setup_cpu_mbus_target()
function reads the SDRAM address decoding registers to find out how
many chip-selects of SDRAM have been enabled, and builds a small array
with one entry per chip-select. This array is then used by device
drivers (XOR, Ethernet, etc.) to configure their own address decoding
windows to the SDRAM.

However, devices can only access the first 32 bits of the physical
memory. Even though LPAE is not supported for now, some Marvell boards
are now showing up with 8 GB of RAM, configured using two SDRAM
address decoding windows: the first covering the first 4 GB, the
second covering the last 4 GB. The array built by
orion_setup_cpu_mbus_target() has therefore two entries, and device
drivers try to set up two address decoding windows to the
SDRAM. However, in the device registers for the address decoding, the
base address is only 32 bits, so those two windows overlap each other,
and the devices do not work at all.

This patch makes sure that the array built by
orion_setup_cpu_mbus_target() only contains the SDRAM decoding windows
that correspond to the first 4 GB of the memory. To do that, it
ignores the SDRAM decoding windows for which the 4 low-order bits are
not zero (the 4 low-order bits of the base register are used to store
bits 32:35 of the base address, so they actually indicate whether the
base address is above 4 GB).

This patch allows the newly introduced armada-xp-gp board to properly
operate when it is mounted with more than 4 GB of RAM. Without that,
all devices doing DMA (for example XOR and Ethernet) do not work at
all.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2013-03-08 22:07:19 +00:00
..
include/plat arm: plat-orion: Add coherency attribute when setup mbus target 2012-11-21 17:07:49 +01:00
addr-map.c arm: plat-orion: fix address decoding when > 4GB is used 2013-03-08 22:07:19 +00:00
common.c dma: mv_xor: remove the pool_size from platform_data 2012-11-20 15:59:00 +01:00
gpio.c ARM: orion: move custom gpio functions to orion-gpio.h 2012-09-14 09:21:59 -05:00
irq.c ARM: Kirkwood: Make use of mvebu pincltl and gpio drivers 2012-11-24 02:57:35 +00:00
Makefile ARM: mvebu: fix build breaks from multi-platform conversion 2012-09-28 22:27:07 +02:00
mpp.c arm: plat-orion: fix printing of "MPP config unavailable on this hardware" 2013-01-23 14:37:52 +00:00
pcie.c ARM: Kirkwood: Replace clock gating 2012-05-08 16:34:04 -07:00
time.c ARM: use clockevents_config_and_register() where possible 2013-01-14 10:12:42 -08:00