diff mbox

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

Message ID 1469445639-16995-1-git-send-email-mike.looijmans@topic.nl
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Mike Looijmans July 25, 2016, 11:20 a.m. UTC
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@topic.nl>
---
 common/spl/spl_nor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Tom Rini July 25, 2016, 1:48 p.m. UTC | #1
On Mon, Jul 25, 2016 at 01:20:39PM +0200, Mike Looijmans wrote:

> 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.

Ug, yes, that is too small.

> Signed-off-by: Mike Looijmans <mike.looijmans@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

There's not a lot of CONFIG_SPL_NOR_SUPPORT boards today, so can we
please move this into the config.h file for all, rather than "hide" this
here?  Thanks!
Mike Looijmans July 26, 2016, 5:32 a.m. UTC | #2

diff mbox

Patch

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 {