]> git.baikalelectronics.ru Git - uboot.git/commit
fdt: fix get_next_memory_node()
authorMarek Vasut <marek.vasut@gmail.com>
Sun, 9 Sep 2018 14:30:11 +0000 (16:30 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 10 Sep 2018 13:05:41 +0000 (09:05 -0400)
commit6b360bd20abb0d62061fb603a2c7b558152a59b6
tree33104232a8e4f5298a940fb265ea5f1f27374f49
parentb417820ef99d3824a4529b8a6995632eab36d1ca
fdt: fix get_next_memory_node()

The get_next_memory_node() always sets mem to -1 , which is incorrect,
because then every iteration of memory bank parsing will start from the
first memory bank instead of the previous one.

On systems with 1 memory bank defined in DT and CONFIG_NR_DRAM_BANKS=4 ,
like ie. r8a77965-salvator-x , this will result in U-Boot incorrectly
reporting four identical memory banks with the same memory configuration.

Fix this by setting mem to startoffset value, which restores the behavior
before the fixed patch was applied.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Fixes: 97a42c833a79 ("fdt: fix fdtdec_setup_memory_banksize()")
Tested-by: Michal Simek <michal.simek@xilinx.com> [on ZynqMP}
lib/fdtdec.c