]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
mpc86xx: set the DDR BATs after calculating true DDR size
authorTimur Tabi <timur@freescale.com>
Mon, 29 Mar 2010 17:51:07 +0000 (12:51 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 30 Mar 2010 15:50:22 +0000 (10:50 -0500)
commit9ff32d8ccf0e23b5577c25610f001af8d761b4a2
tree43cce2d1c3caf0a05fdbb33f6a44855f4965433f
parent33f57bd553edf29dffef5a6c7d76e169c79a6049
mpc86xx: set the DDR BATs after calculating true DDR size

After determining how much DDR is actually in the system, set DBAT0 and
IBAT0 accordingly.  This ensures that the CPU won't attempt to access
(via speculation) addresses outside of actual memory.

On 86xx systems, DBAT0 and IBAT0 (the BATs for DDR) are initialized to 2GB
and kept that way.  If the system has less than 2GB of memory (typical for
an MPC8610 HPCD), the CPU may attempt to access this memory during
speculation.  The zlib code is notorious for generating such memory reads,
and indeed on the MPC8610, uncompressing the Linux kernel causes a machine
check (without this patch).

Currently we are limited to power of two sized DDR since we only use a
single bat.  If a non-power of two size is used that is less than
CONFIG_MAX_MEM_MAPPED u-boot will crash.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
board/freescale/mpc8610hpcd/mpc8610hpcd.c
board/freescale/mpc8641hpcn/mpc8641hpcn.c
cpu/mpc86xx/cpu.c
cpu/mpc86xx/cpu_init.c
include/asm-ppc/mmu.h
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/mpc86xx.h