]> git.baikalelectronics.ru Git - uboot.git/commit
arm: socfpga: fix SPL on gen5 after moving to DM serial
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Mon, 13 Aug 2018 07:33:44 +0000 (09:33 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 13 Aug 2018 13:29:54 +0000 (15:29 +0200)
commitfb6035de045827c4fc6a1a9164d9442c562861e5
tree26d27a84a99218a149d8619a127854e455bea05e
parentd3462eac2b4b5ce6ce30c35e781d4ba8e0dfbed5
arm: socfpga: fix SPL on gen5 after moving to DM serial

There were NULL pointers dereferenced because DM was used
too early without correct initialization:
- malloc_simple returned NULL when called from preloader_console_init()
  because gd->malloc_limit was 0
- uclass_add dereferenced gd->uclass_root members which were NULL because
  dm_init (or one of its relatives) has not been called.

All this is fixed by calling spl_early_init before calling
preloader_console_init.

This fixes commit 31af9164470e ("ARM: socfpga: Convert to DM serial")

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
arch/arm/mach-socfpga/spl_gen5.c