Skip to contentSkip to conversation

spl_nor.c: Support devicetree sizes different from 16k

PATCH Superseded Mike Looijmans 2 participants 5 messages Jul 26, 2016 – Aug 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 spl_nor.c: Support devicetree sizes different from 16k

The devicetrees for various platforms already exceed 16k. Add a define CONFIG_SYS_FDT_SIZE to specify the FDT size, and set to 16k for the two boards that define this CONFIG_SYS_FDT_BASE parameter. This allows platforms with larger devicetree blobs to boot from NOR.

---
v2: Instead of a default, just specify the value for the two boards that use it.

 common/spl/spl_nor.c                 | 4 ++--
 include/configs/a3m071.h             | 1 +
 include/configs/microblaze-generic.h | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)
common/spl/spl_nor.c +2 -2
index da2422f..8ea874c 100644
@@ -40,11 +40,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 {
include/configs/a3m071.h +1 -0
index 8f17dd1..ab2477c 100644
@@ -334,6 +334,7 @@
 
 #define CONFIG_SYS_OS_BASE	0xfc200000
 #define CONFIG_SYS_FDT_BASE	0xfc1e0000
+#define CONFIG_SYS_FDT_SIZE	(16<<10)
 
 #define	CONFIG_EXTRA_ENV_SETTINGS					\
 	"netdev=eth0\0"							\
include/configs/microblaze-generic.h +1 -0
index 047e756..e5bf700 100644
@@ -305,6 +305,7 @@
 					 0x60000)
 #define CONFIG_SYS_FDT_BASE		(CONFIG_SYS_FLASH_BASE + \
 					 0x40000)
+#define CONFIG_SYS_FDT_SIZE		(16<<10)
 #define CONFIG_SYS_SPL_ARGS_ADDR	(CONFIG_SYS_TEXT_BASE + \
 					 0x1000000)
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 spl_nor.c: Support devicetree sizes different from 16k

Quoted 11 lines · Mike Looijmans

The devicetrees for various platforms already exceed 16k. Add a define CONFIG_SYS_FDT_SIZE to specify the FDT size, and set to 16k for the two boards that define this CONFIG_SYS_FDT_BASE parameter. This allows platforms with larger devicetree blobs to boot from NOR.

---
v2: Instead of a default, just specify the value for the two boards that use it.

 common/spl/spl_nor.c                 | 4 ++--
 include/configs/a3m071.h             | 1 +
 include/configs/microblaze-generic.h | 1 +

This misses a few boards:

$ git grep SPL_NOR_SUPPORT include/configs
include/configs/a3m071.h:#define CONFIG_SPL_NOR_SUPPORT
include/configs/edminiv2.h:#define CONFIG_SPL_NOR_SUPPORT
include/configs/microblaze-generic.h:# define CONFIG_SPL_NOR_SUPPORT
include/configs/uniphier.h:#define CONFIG_SPL_NOR_SUPPORT
include/configs/x600.h:#define CONFIG_SPL_NOR_SUPPORT

Please update, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160726/f5505687/attachment.sig>
#2 lore raw

PATCH v2 1/1 spl_nor.c: Support devicetree sizes different from 16k

A non-text attachment was scrubbed...
Name: imageaa7d76.PNG
Type: image/png
Size: 9075 bytes
Desc: imageaa7d76.PNG
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160726/80addfe3/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image7b0ffb.JPG
Type: image/jpeg
Size: 1088 bytes
Desc: image7b0ffb.JPG
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160726/80addfe3/attachment.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image0143cd.JPG
Type: image/jpeg
Size: 1087 bytes
Desc: image0143cd.JPG
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160726/80addfe3/attachment-0001.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imageb1c9a1.JPG
Type: image/jpeg
Size: 1060 bytes
Desc: imageb1c9a1.JPG
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160726/80addfe3/attachment-0002.jpe>

#3 lore raw

PATCH v2 1/1 spl_nor.c: Support devicetree sizes different from 16k

Quoted 33 lines · Mike Looijmans
Quoted 15 lines · Tom Rini
Quoted 11 lines · Mike Looijmans

The devicetrees for various platforms already exceed 16k. Add a define CONFIG_SYS_FDT_SIZE to specify the FDT size, and set to 16k for the two boards that define this CONFIG_SYS_FDT_BASE parameter. This allows platforms with larger devicetree blobs to boot from NOR.

---
v2: Instead of a default, just specify the value for the two boards that use it.

  common/spl/spl_nor.c                 | 4 ++--
  include/configs/a3m071.h             | 1 +
  include/configs/microblaze-generic.h | 1 +

This misses a few boards:

Quoted 9 lines
$ git grep SPL_NOR_SUPPORT include/configs
include/configs/a3m071.h:#define CONFIG_SPL_NOR_SUPPORT
include/configs/edminiv2.h:#define CONFIG_SPL_NOR_SUPPORT
include/configs/microblaze-generic.h:# define CONFIG_SPL_NOR_SUPPORT
include/configs/uniphier.h:#define CONFIG_SPL_NOR_SUPPORT
include/configs/x600.h:#define CONFIG_SPL_NOR_SUPPORT

Please update, thanks!

Only boards that define "CONFIG_SYS_FDT_BASE" need to set "CONFIG_SYS_FDT_SIZE", since CONFIG_SYS_FDT_BASE is required as second arg for the memcpy call, boards that don't define it apparently don't support booting directly from NOR. Apparently, of the five boards with SPL_NOR support, only these two boards support booting into a kernel directly:

Quoted 6 lines
$ grep -r CONFIG_SYS_FDT_BASE *
common/spl/spl_nor.c:          (void *)(CONFIG_SYS_FDT_BASE),
include/configs/a3m071.h:#define CONFIG_SYS_FDT_BASE 0xfc1e0000
include/configs/a3m071.h: "fdt_addr=" __stringify(CONFIG_SYS_FDT_BASE) "\0"  \
include/configs/microblaze-generic.h:#define CONFIG_SYS_FDT_BASE
(CONFIG_SYS_FLASH_BASE + \

Ah, OK, thanks!

Signature · 1 line
Tom
#4 lore raw

PATCH v2 1/1 spl_nor.c: Support devicetree sizes different from 16k

In reply to Mike Looijmans
Quoted 6 lines · Mike Looijmans

The devicetrees for various platforms already exceed 16k. Add a define CONFIG_SYS_FDT_SIZE to specify the FDT size, and set to 16k for the two boards that define this CONFIG_SYS_FDT_BASE parameter. This allows platforms with larger devicetree blobs to boot from NOR.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160809/03aa0769/attachment.sig>