aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Babu2017-01-13 02:10:15 -0600
committerPraneeth Bajjuri2017-01-19 16:14:59 -0600
commit2e715798ce798eb33b4e15648495e7d524eec68e (patch)
tree1b3d3b1cc73c612dac88389e83766162f52a0e90
parent2da3c80161fdc9922d28731d494010699e8f8fdb (diff)
downloadu-boot-2e715798ce798eb33b4e15648495e7d524eec68e.tar.gz
u-boot-2e715798ce798eb33b4e15648495e7d524eec68e.tar.xz
u-boot-2e715798ce798eb33b4e15648495e7d524eec68e.zip
boot: fdt: fixup the memory dt nodes falcon boot
In single stage bootmode or falcon boot mode, the SPL shall update the memory dt nodes based on DDR configuration for specific platform. This patch fixes kernel crash observed during single stage qspi boot mode. Change-Id: Ie7b52c9cf1f8dc2deb006be10ab8a18c53a88db7 Signed-off-by: Ravi Babu <ravibabu@ti.com>
-rw-r--r--common/spl/spl.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index f3df1164d7..b09fa4af33 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -19,6 +19,7 @@
19#include <dm/root.h> 19#include <dm/root.h>
20#include <linux/compiler.h> 20#include <linux/compiler.h>
21#include <omap_remoteproc.h> 21#include <omap_remoteproc.h>
22#include <fdt_support.h>
22 23
23DECLARE_GLOBAL_DATA_PTR; 24DECLARE_GLOBAL_DATA_PTR;
24 25
@@ -55,6 +56,33 @@ __weak int spl_start_uboot(void)
55} 56}
56#endif 57#endif
57 58
59void spl_fixup_fdt(void)
60{
61#ifdef CONFIG_SPL_OF_LIBFDT
62 void *fdt_blob = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
63 int err;
64
65 err = fdt_check_header(fdt_blob);
66 if (err < 0) {
67 printf("fdt_root: %s\n", fdt_strerror(err));
68 return;
69 }
70
71 /* fixup the memory dt node */
72 err = fdt_shrink_to_minimum(fdt_blob);
73 if (err == 0) {
74 printf("spl: fdt_shrink_to_minimum err - %d\n", err);
75 return;
76 }
77
78 err = arch_fixup_fdt(fdt_blob);
79 if (err) {
80 printf("spl: arch_fixup_fdt err - %d\n", err);
81 return;
82 }
83#endif
84}
85
58/* 86/*
59 * Weak default function for board specific cleanup/preparation before 87 * Weak default function for board specific cleanup/preparation before
60 * Linux boot. Some boards/platforms might not need it, so just provide 88 * Linux boot. Some boards/platforms might not need it, so just provide
@@ -538,6 +566,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
538#ifdef CONFIG_SPL_OS_BOOT 566#ifdef CONFIG_SPL_OS_BOOT
539 case IH_OS_LINUX: 567 case IH_OS_LINUX:
540 debug("Jumping to Linux\n"); 568 debug("Jumping to Linux\n");
569 spl_fixup_fdt();
541 spl_board_prepare_for_linux(); 570 spl_board_prepare_for_linux();
542 jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR); 571 jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR);
543#endif 572#endif