[U-Boot] [PATCH] spl_nor.c: Support devicetree sizes different from 16k

Mike Looijmans mike.looijmans at topic.nl
Mon Jul 25 13:20:39 CEST 2016


The devicetrees for various platforms already exceed 16k. Add a define
CONFIG_SYS_FDT_SIZE to specify the FDT size, and default to 16k. This
allows platforms with larger devicetree blobs to boot from NOR.

Signed-off-by: Mike Looijmans <mike.looijmans at topic.nl>
---
 common/spl/spl_nor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index da2422f..b37a023 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -7,6 +7,11 @@
 #include <common.h>
 #include <spl.h>
 
+/* 16 KiB default size for DT */
+#ifndef CONFIG_SYS_FDT_SIZE
+# define CONFIG_SYS_FDT_SIZE (16<<10)
+#endif
+
 int spl_nor_load_image(void)
 {
 	int ret;
@@ -40,11 +45,11 @@ int spl_nor_load_image(void)
 
 			/*
 			 * Copy DT blob (fdt) to SDRAM. Passing pointer to
-			 * flash doesn't work (16 KiB should be enough for DT)
+			 * flash doesn't work
 			 */
 			memcpy((void *)CONFIG_SYS_SPL_ARGS_ADDR,
 			       (void *)(CONFIG_SYS_FDT_BASE),
-			       (16 << 10));
+			       CONFIG_SYS_FDT_SIZE);
 
 			return 0;
 		} else {
-- 
1.9.1



More information about the U-Boot mailing list