u-boot/board/xilinx/zynq
Nathan Rossi 64b67fb24b ARM: zynq: Replace dram_init* functions with board_init_f safe ones
The dram_init* functions for the zynq board are not safe for use from
the board_init_f stage due to its use of the 'tmp' static variable.

This incorrect use of a static variable was causing rare issues where
the dram_init function would overwrite some parts the __rel_dyn section
which caused obscure failures.

Using the zynq_zybo configuration, U-Boot would generate the following
error during image load. This was caused due to dram_init overwriting
the relocations for the "image" variable within the do_bootm function.
Out of coincidence the un-initialized memory has a compression type
which is the same as the value for the relocation type R_ARM_RELATIVE.

   Uncompressing Invalid Image ... Unimplemented compression type 23

It should be noted that this is just one way the issue could surface,
other cases my not be observed in normal boot flow.

This change removes the existing code and copies the implementation of
the dram_init and dram_init_banksize from the
arch/arm/mach-uniphier/dram_init.c source. This version of these
functions does not use static variables and behaves the same (reading
banks from fdt, and using the first bank as the ram_size).

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks")
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-12-08 10:04:20 +01:00
..
zynq-microzed ARM: zynq: Simplify zynq configuration 2016-05-24 13:22:50 +02:00
zynq-zc702 ARM: zynq: Simplify zynq configuration 2016-05-24 13:22:50 +02:00
zynq-zc706 ARM: zynq: Simplify zynq configuration 2016-05-24 13:22:50 +02:00
zynq-zed ARM: zynq: Simplify zynq configuration 2016-05-24 13:22:50 +02:00
zynq-zybo ARM: zynq: Simplify zynq configuration 2016-05-24 13:22:50 +02:00
.gitignore ARM: zynq: add default ps7_init_gpl.c/h for Zed, MicroZed, ZC70x 2015-05-25 10:52:36 +02:00
board.c ARM: zynq: Replace dram_init* functions with board_init_f safe ones 2016-12-08 10:04:20 +01:00
MAINTAINERS ARM: zynq: Remove Jagan from list of maintainers 2015-04-08 18:43:51 -04:00
Makefile ARM: zynq: Simplify zynq configuration 2016-05-24 13:22:50 +02:00
xil_io.h zynq: Use GPLed files for SPL 2014-11-11 10:51:43 +01:00