]> git.dujemihanovic.xyz Git - u-boot.git/commit
fdt: add memory bank decoding functions for board setup
authorNathan Rossi <nathan@nathanrossi.com>
Sun, 18 Dec 2016 14:03:34 +0000 (00:03 +1000)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 20 Dec 2016 08:15:28 +0000 (09:15 +0100)
commit623f60198b38c4fdae596038cd5956e44b6224a4
tree4c1868e61c4dc1ea970aec32a0c0a7a5e3200379
parent91d11536da7c34a88db34d6dee20cc6ea6e06bdc
fdt: add memory bank decoding functions for board setup

Add two functions for use by board implementations to decode the memory
banks of the /memory node so as to populate the global data with
ram_size and board info for memory banks.

The fdtdec_setup_memory_size() function decodes the first memory bank
and sets up the gd->ram_size with the size of the memory bank. This
function should be called from the boards dram_init().

The fdtdec_setup_memory_banksize() function decode the memory banks
(up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size
into the gd->bd->bi_dram array of banks. This function should be called
from the boards dram_init_banksize().

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Michal Simek <monstr@monstr.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
include/fdtdec.h
lib/fdtdec.c