Skip to contentSkip to conversation

add optional hex output of u-boot-spl

PATCH New Dalon Westergreen 4 participants 20 messages Sep 10, 2018 – Sep 12, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

cover add optional hex output of u-boot-spl

This patch set adds a possible hex output of the u-boot-spl elf and enables said output for the Intel Stratix10 device. Stratix10 requires a hex output of the elf for creating the secure device manager configuration bitstream.

Dalon Westergreen (3):
common: add spl/u-boot-spl.hex target
arm: socfpga: stratix10: add CONFIG_SPL_TARGET arm; socfpga: stratix10: Add CONFIG_OF_EMBED

 Makefile                                  | 5 +++++
 configs/socfpga_stratix10_defconfig       | 1 +
 include/configs/socfpga_stratix10_socdk.h | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 common: add spl/u-boot-spl.hex target

Some devices, namely Intel's stratix10 SoC, require u-boot-spl in a hex format. This patch adds spl/u-boot-spl.hex as a possible target.

---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)
Makefile +5 -0
index f30dd8e9b7..133d7ac773 100644
@@ -985,6 +985,11 @@ spl/u-boot-spl.srec: spl/u-boot-spl FORCE
 OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
 		$(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec)
 
+OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex)
+
+spl/u-boot-spl.hex: spl/u-boot-spl FORCE
+	$(call if_changed,objcopy)
+
 binary_size_check: u-boot-nodtb.bin FORCE
 	@file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
 	map_size=$(shell cat u-boot.map | \
Signature · 1 line
2.17.1
Applied
#2 lore raw

PATCH 1/3 common: add spl/u-boot-spl.hex target

Quoted 16 lines · Dalon Westergreen

Some devices, namely Intel's stratix10 SoC, require u-boot-spl in a hex format. This patch adds spl/u-boot-spl.hex as a possible target.

---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)
Makefile +0 -0
index f30dd8e9b7..133d7ac773 100644
@@ -985,6 +985,11 @@ spl/u-boot-spl.srec: spl/u-boot-spl FORCE
 OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \

Makefile spl/u-boot-spl.srec: spl/u-boot-spl FORCE · line 995

Quoted 10 lines
Makefile +5 -0
 		$(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec)
 
+OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex)
+
+spl/u-boot-spl.hex: spl/u-boot-spl FORCE
+	$(call if_changed,objcopy)
+
 binary_size_check: u-boot-nodtb.bin FORCE
 	@file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
 	map_size=$(shell cat u-boot.map | \

Applied to socfpga/master, thanks

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

PATCH 2/3 arm: socfpga: stratix10: add CONFIG_SPL_TARGET

In reply to Dalon Westergreen

Stratix10 combines the u-boot-spl image into the fpga configuration bitstream so that the SDM can load the processors memory. This process requires a hex format of the u-boot-spl image. CONFIG_SPL_TARGET is set to "spl/u-boot-spl.hex"

---
 include/configs/socfpga_stratix10_socdk.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/socfpga_stratix10_socdk.h +1 -0
index b58f478004..91315a0031 100644
@@ -202,6 +202,7 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
  * 0x8000_0000 ...... End of SDRAM_1 (assume 2GB)
  *
  */
+#define CONFIG_SPL_TARGET		"spl/u-boot-spl.hex"
 #define CONFIG_SPL_TEXT_BASE		CONFIG_SYS_INIT_RAM_ADDR
 #define CONFIG_SPL_MAX_SIZE		CONFIG_SYS_INIT_RAM_SIZE
 #define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
Signature · 1 line
2.17.1
Applied
#4 lore raw

PATCH 2/3 arm: socfpga: stratix10: add CONFIG_SPL_TARGET

Quoted 16 lines · Dalon Westergreen

Stratix10 combines the u-boot-spl image into the fpga configuration bitstream so that the SDM can load the processors memory. This process requires a hex format of the u-boot-spl image. CONFIG_SPL_TARGET is set to "spl/u-boot-spl.hex"

---
 include/configs/socfpga_stratix10_socdk.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/socfpga_stratix10_socdk.h +0 -0
index b58f478004..91315a0031 100644

include/configs/socfpga_stratix10_socdk.h unsigned int cm_get_l4_sys_free_clk_hz(void); · line 208

Quoted 7 lines
include/configs/socfpga_stratix10_socdk.h +1 -0
@@ -202,6 +202,7 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
  * 0x8000_0000 ...... End of SDRAM_1 (assume 2GB)
  *
  */
+#define CONFIG_SPL_TARGET		"spl/u-boot-spl.hex"
 #define CONFIG_SPL_TEXT_BASE		CONFIG_SYS_INIT_RAM_ADDR
 #define CONFIG_SPL_MAX_SIZE		CONFIG_SYS_INIT_RAM_SIZE
 #define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR

Applied to socfpga/master, thanks

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

In reply to Dalon Westergreen

The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now also includes the dtb.

---
 configs/socfpga_stratix10_defconfig       | 1 +
 include/configs/socfpga_stratix10_socdk.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +1 -0
index c27985ad43..b6d804f38e 100644
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y
include/configs/socfpga_stratix10_socdk.h +1 -1
index 91315a0031..e190b3d988 100644
@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 
 /* SPL SDMMC boot support */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
 #endif	/* __CONFIG_H */
Signature · 1 line
2.17.1
#6 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 5 lines · Dalon Westergreen

The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now

Tiny typo: replace comma by dot.
Although this side effect seems a little unwanted...?

Quoted 29 lines

also includes the dtb.

---
  configs/socfpga_stratix10_defconfig       | 1 +
  include/configs/socfpga_stratix10_socdk.h | 2 +-
  2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +1 -0
index c27985ad43..b6d804f38e 100644
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
  CONFIG_USB_DWC2=y
  CONFIG_USB_STORAGE=y
  CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y
include/configs/socfpga_stratix10_socdk.h +1 -1
index 91315a0031..e190b3d988 100644
@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 
  /* SPL SDMMC boot support */
  #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
  #endif	/* __CONFIG_H */
#7 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 8 lines · Simon Goldschmidt

On 10.09.2018 19:28, Dalon Westergreen wrote:
The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now

Tiny typo: replace comma by dot.

Thanks

Quoted 1 line

Although this side effect seems a little unwanted...?

I would love to think of a use case where this would matter?

Quoted 36 lines

also includes the dtb.

---
  configs/socfpga_stratix10_defconfig       | 1 +
  include/configs/socfpga_stratix10_socdk.h | 2 +-
  2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +1 -0
index c27985ad43..b6d804f38e 100644
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
  CONFIG_USB_DWC2=y
  CONFIG_USB_STORAGE=y
  CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y
include/configs/socfpga_stratix10_socdk.h +1 -1
index 91315a0031..e190b3d988 100644
@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 
  /* SPL SDMMC boot support */
  #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
  #endif	/* __CONFIG_H */

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#8 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 8 lines · Dalon L Westergreen
Quoted 6 lines · Simon Goldschmidt

On 10.09.2018 19:28, Dalon Westergreen wrote:
The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it. This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now Tiny typo: replace comma by dot.

Quoted 5 lines

Thanks

Quoted 1 line

Although this side effect seems a little unwanted...?

I would love to think of a use case where this would matter?

Well, on upgrade, the name of the U-Boot image on MMC changes, doesn't it? Or is there no upgrade scenario? (I'm not familiar with the current status of mainline U-Boot on Stratix 10).

Anyway, this is not your fault. I rather guess this is an inconsistency in U-Boot overall that the name of the binary changes with

CONFIG_OF_EMBED...

Simon

Quoted 31 lines
Quoted 31 lines

also includes the dtb.

Signed-off-by Dalon Westergreen <dwesterg at gmail.com <mailto:[email protected]>>
---
   configs/socfpga_stratix10_defconfig       | 1 +
   include/configs/socfpga_stratix10_socdk.h | 2 +-
   2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +1 -0
index c27985ad43..b6d804f38e 100644
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
   CONFIG_USB_DWC2=y
   CONFIG_USB_STORAGE=y
   CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y
include/configs/socfpga_stratix10_socdk.h +1 -1
index 91315a0031..e190b3d988 100644
@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 
   /* SPL SDMMC boot support */
   #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
   #endif	/* __CONFIG_H */

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de <mailto:[email protected]>
https://lists.denx.de/listinfo/u-boot

#9 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

In reply to Dalon Westergreen
Quoted 18 lines · Dalon Westergreen

The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now also includes the dtb.

---
 configs/socfpga_stratix10_defconfig       | 1 +
 include/configs/socfpga_stratix10_socdk.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +0 -0
index c27985ad43..b6d804f38e 100644

configs/socfpga_stratix10_defconfig CONFIG_DM_USB=y · line 59

Quoted 4 lines
configs/socfpga_stratix10_defconfig +1 -0
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y

Did make savedefconfig put this here ?

I am fine with this patch, but if Simon has any objections, let's hear them.

Quoted 13 lines
include/configs/socfpga_stratix10_socdk.h +1 -1
index 91315a0031..e190b3d988 100644
@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 
 /* SPL SDMMC boot support */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
 #endif	/* __CONFIG_H */
Signature · 2 lines
Best regards,
Marek Vasut
#10 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 10 lines · Marek Vasut

On 09/10/2018 07:28 PM, Dalon Westergreen wrote:
The dtb should be embedded in the u-boot-spl image so thatthe CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.
This also affects the main u-boot image, so adjustCONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which nowalso includes the dtb.

configs/socfpga_stratix10_defconfig | 1 +
include/configs/socfpga_stratix10_socdk.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)

Quoted 7 lines
(quoted diff) +0 -0

b/configs/socfpga_stratix10_defconfigindex c27985ad43..b6d804f38e 100644--- a/configs/socfpga_stratix10_defconfig+++ b/configs/socfpga_stratix10_defconfig@@ -56,3 +56,4 @@ CONFIG_DM_USB=y CONFIG_USB_DWC2=y CONFIG_USB_STORAGE=y CONFIG_USE_TINY_PRINTF=y+CONFIG_OF_EMBED=y
Did make savedefconfig put this here ?

No, i put it there myself

Quoted 1 line

I am fine with this patch, but if Simon has any objections, let's hear them.

great!

Quoted 12 lines
(quoted diff) +0 -0

b/include/configs/socfpga_stratix10_socdk.hindex 91315a0031..e190b3d988 100644--- a/include/configs/socfpga_stratix10_socdk.h+++ b/include/configs/socfpga_stratix10_socdk.h@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void); /* SPL SDMMC boot support */ #define
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1-#define
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img"+#define
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" #endif /*
__CONFIG_H */

#11 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 25 lines · Dalon L Westergreen
Quoted 24 lines · Marek Vasut

On 09/10/2018 07:28 PM, Dalon Westergreen wrote:
The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now also includes the dtb.

Signed-off-by Dalon Westergreen <dwesterg at gmail.com <mailto:[email protected]>>
---
 configs/socfpga_stratix10_defconfig       | 1 +
 include/configs/socfpga_stratix10_socdk.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +1 -0
index c27985ad43..b6d804f38e 100644
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y
Quoted 3 lines
Quoted 1 line

Did make savedefconfig put this here ?

No, i put it there myself

You should always run make savedefconfig to update the defconfig instead of ad-hoc hacking the value at random place.

Quoted 21 lines
Quoted 1 line

I am fine with this patch, but if Simon has any objections, let's hear them.

great!

Quoted 17 lines
include/configs/socfpga_stratix10_socdk.h +1 -1
index 91315a0031..e190b3d988 100644
@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 
 /* SPL SDMMC boot support */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
 #endif	/* __CONFIG_H */
Signature · 2 lines
Best regards,
Marek Vasut
#12 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 13 lines · Marek Vasut

On 09/12/2018 01:55 AM, Dalon L Westergreen wrote:
On Tue, 2018-09-11 at 23:55 +0200, Marek Vasut wrote:
On 09/10/2018 07:28 PM, Dalon Westergreen wrote:The dtb should be embedded in the u-boot-spl image so thatthe CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.
This also affects the main u-boot image, so adjustCONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which nowalso includes the dtb.

dwesterg at gmail.com>>--- configs/socfpga_stratix10_defconfig | 1 +
include/configs/socfpga_stratix10_socdk.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)

(quoted diff) +0 -0
Quoted 9 lines

b/configs/socfpga_stratix10_defconfigindex c27985ad43..b6d804f38e 100644--- a/configs/socfpga_stratix10_defconfig+++ b/configs/socfpga_stratix10_defconfig@@ -56,3 +56,4 @@ CONFIG_DM_USB=y CONFIG_USB_DWC2=y CONFIG_USB_STORAGE=y CONFIG_USE_TINY_PRINTF=y+CONFIG_OF_EMBED=y
Did make savedefconfig put this here ?
No, i put it there myself
You should always run make savedefconfig to update the defconfig insteadof ad- hoc hacking the value at random place.

i'll fix it and send a new patch. You already accepted patch 1 & 2 from the series, so i will just sendthe one.

Quoted 18 lines

I am fine with this patch, but if Simon has any objections, let's hear them. great!

(quoted diff) +0 -0

b/include/configs/socfpga_stratix10_socdk.hindex 91315a0031..e190b3d988 100644--- a/include/configs/socfpga_stratix10_socdk.h+++ b/include/configs/socfpga_stratix10_socdk.h@@ -216,6 +216,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void); /* SPL SDMMC boot support */ #define
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1-#define
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img"+#define
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" #endif /*
__CONFIG_H */

#13 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 29 lines · Dalon L Westergreen
Quoted 28 lines · Marek Vasut

On 09/12/2018 01:55 AM, Dalon L Westergreen wrote:
On Tue, 2018-09-11 at 23:55 +0200, Marek Vasut wrote:
On 09/10/2018 07:28 PM, Dalon Westergreen wrote:
The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now also includes the dtb.

Signed-off-by Dalon Westergreen <dwesterg at gmail.com <mailto:[email protected]> <mailto:dwesterg at gmail.com <mailto:[email protected]>>>
---
 configs/socfpga_stratix10_defconfig       | 1 +
 include/configs/socfpga_stratix10_socdk.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
configs/socfpga_stratix10_defconfig +1 -0
index c27985ad43..b6d804f38e 100644
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y

Did make savedefconfig put this here ?

Quoted 8 lines
Quoted 4 lines

No, i put it there myself

You should always run make savedefconfig to update the defconfig instead of ad-hoc hacking the value at random place.

i'll fix it and send a new patch. You already accepted patch 1 & 2 from the series, so i will just send
the one.

Also fix the ; and , bits Simon pointed out. And check with him if he has some further feedback.

Signature · 2 lines
Best regards,
Marek Vasut
#14 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Marek Vasut <[email protected]> schrieb am Mi., 12. Sep. 2018, 02:07:

Quoted 42 lines · Dalon L Westergreen
Quoted 7 lines · Marek Vasut
Quoted 6 lines · Dalon L Westergreen

On Tue, 2018-09-11 at 23:55 +0200, Marek Vasut wrote:
On 09/10/2018 07:28 PM, Dalon Westergreen wrote:
The dtb should be embedded in the u-boot-spl image so that the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.

Quoted 5 lines
Quoted 5 lines

This also affects the main u-boot image, so adjust CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now also includes the dtb.

dwesterg at gmail.com> <mailto:dwesterg at gmail.com <mailto:[email protected]

Quoted 7 lines

Review

Quoted 7 lines
Quoted 1 line
---
 configs/socfpga_stratix10_defconfig       | 1 +
 include/configs/socfpga_stratix10_socdk.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/configs/socfpga_stratix10_defconfig

Quoted 11 lines
Quoted 11 lines

index c27985ad43..b6d804f38e 100644

configs/socfpga_stratix10_defconfig +1 -0
@@ -56,3 +56,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_OF_EMBED=y

Did make savedefconfig put this here ?

Quoted 8 lines
Quoted 4 lines

No, i put it there myself

You should always run make savedefconfig to update the defconfig instead of ad-hoc hacking the value at random place.

i'll fix it and send a new patch. You already accepted patch 1 & 2 from the series, so i will just send
the one.

Quoted 3 lines

Also fix the ; and , bits Simon pointed out. And check with him if he has some further feedback.

No, after discussing this, I'm fine with the change as is. I'll need something similar for gen5, I guess...

So:

Quoted 4 lines

--
Best regards,
Marek Vasut

#15 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 55 lines · Simon Goldschmidt

Marek Vasut <marex at denx.de <mailto:[email protected]>> schrieb am Mi., 12. Sep. 2018, 02:07:

On 09/12/2018 02:05 AM, Dalon L Westergreen wrote:
> On Wed, 2018-09-12 at 02:03 +0200, Marek Vasut wrote:
>> On 09/12/2018 01:55 AM, Dalon L Westergreen wrote:
>> On Tue, 2018-09-11 at 23:55 +0200, Marek Vasut wrote:
>> On 09/10/2018 07:28 PM, Dalon Westergreen wrote:
>> The dtb should be embedded in the u-boot-spl image so that >> the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it. >>
>> This also affects the main u-boot image, so adjust
>> CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now >> also includes the dtb.
>>
>> Signed-off-by: Dalon Westergreen <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>> <mailto:[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>>>
>> ---
>>  configs/socfpga_stratix10_defconfig       | 1 +
>>  include/configs/socfpga_stratix10_socdk.h | 2 +-
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/configs/socfpga_stratix10_defconfig b/configs/socfpga_stratix10_defconfig
>> index c27985ad43..b6d804f38e 100644
>> --- a/configs/socfpga_stratix10_defconfig
>> +++ b/configs/socfpga_stratix10_defconfig
>> @@ -56,3 +56,4 @@ CONFIG_DM_USB=y
>>  CONFIG_USB_DWC2=y
>>  CONFIG_USB_STORAGE=y
>>  CONFIG_USE_TINY_PRINTF=y
>> +CONFIG_OF_EMBED=y
>>
>> Did make savedefconfig put this here ?
>>
>> No, i put it there myself
>>
>> You should always run make savedefconfig to update the defconfig instead
>> of ad-hoc hacking the value at random place.
>
> i'll fix it and send a new patch. You already accepted patch 1 & 2 from
> the series, so i will just send
> the one.

Also fix the ; and , bits Simon pointed out. And check with him if he has some further feedback.

Quoted 5 lines

No, after discussing this, I'm fine with the change as is. I'll need something similar for gen5, I guess...

So:

OK, thanks

Also, can you both fix your mailer so it does generate proper text email reply, with zero tabs/spaces between quote markers ('>') ?

Signature · 2 lines
Best regards,
Marek Vasut
#16 lore raw

PATCH 3/3 arm; socfpga: stratix10: Add CONFIG_OF_EMBED

Quoted 60 lines · Marek Vasut
Quoted 58 lines · Simon Goldschmidt

Marek Vasut <marex at denx.de <mailto:[email protected]>> schrieb am Mi., 12. Sep. 2018, 02:07:

    On 09/12/2018 02:05 AM, Dalon L Westergreen wrote:
    > On Wed, 2018-09-12 at 02:03 +0200, Marek Vasut wrote:
    >> On 09/12/2018 01:55 AM, Dalon L Westergreen wrote:
    >> On Tue, 2018-09-11 at 23:55 +0200, Marek Vasut wrote:
    >> On 09/10/2018 07:28 PM, Dalon Westergreen wrote:
    >> The dtb should be embedded in the u-boot-spl image so that
    >> the CONFIG_SPL_TARGET of spl/u-boot-spl.hex includes it.
    >>
    >> This also affects the main u-boot image, so adjust
    >> CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to u-boot,img which now
    >> also includes the dtb.
    >>
    >> Signed-off-by: Dalon Westergreen <[email protected]
    <mailto:[email protected]> <mailto:[email protected]
    <mailto:[email protected]>> <mailto:[email protected]
    <mailto:[email protected]> <mailto:[email protected]
    <mailto:[email protected]>>>>
    >> ---
    >>  configs/socfpga_stratix10_defconfig       | 1 +
    >>  include/configs/socfpga_stratix10_socdk.h | 2 +-
    >>  2 files changed, 2 insertions(+), 1 deletion(-)
    >>
    >> diff --git a/configs/socfpga_stratix10_defconfig
    b/configs/socfpga_stratix10_defconfig
    >> index c27985ad43..b6d804f38e 100644
    >> --- a/configs/socfpga_stratix10_defconfig
    >> +++ b/configs/socfpga_stratix10_defconfig
    >> @@ -56,3 +56,4 @@ CONFIG_DM_USB=y
    >>  CONFIG_USB_DWC2=y
    >>  CONFIG_USB_STORAGE=y
    >>  CONFIG_USE_TINY_PRINTF=y
    >> +CONFIG_OF_EMBED=y
    >>
    >> Did make savedefconfig put this here ?
    >>
    >> No, i put it there myself
    >>
    >> You should always run make savedefconfig to update the defconfig
    instead
    >> of ad-hoc hacking the value at random place.
    >
    > i'll fix it and send a new patch. You already accepted patch 1 & 2
    from
    > the series, so i will just send
    > the one.

    Also fix the ; and , bits Simon pointed out. And check with him if he
    has some further feedback.

No, after discussing this, I'm fine with the change as is. I'll need something similar for gen5, I guess...

Quoted 7 lines
Quoted 2 lines

So:

OK, thanks

Also, can you both fix your mailer so it does generate proper text email reply, with zero tabs/spaces between quote markers ('>') ?

Hmm, it seems it's always broken when using the gmail app on my mobile :-( I'll have to try and see what I can do about it.

Quoted 4 lines

--
Best regards,
Marek Vasut

#17 lore raw

cover add optional hex output of u-boot-spl

In reply to Dalon Westergreen
Quoted 5 lines · Dalon Westergreen

This patch set adds a possible hex output of the u-boot-spl elf and enables said output for the Intel Stratix10 device. Stratix10 requires a hex output of the elf for creating the secure device manager configuration bitstream.

I don't use Stratix10 but Cyclone5, but as I need a .hex to boot from FPGA, I want to know how to solve this best.

So to understand this, again a question: is this the only way to boot Stratix10? Or one of the possible boot methods?
Because reading "Intel® Stratix® 10 SoC FPGA Boot User Guide", it seems like you would need the hex for "FPGA Configuration First Mode", but not for "HPS Boot First Mode"?

If so, it would make Stratix10 and Cyclone5 more alike and a configuration option (like "Boot from FPGA") could be used to control CONFIG_OF_EMBED and enable creating the hex file for SPL.

I *am* working on fixing the "boot from FPGA" case for Cyclone5, so I'd appreaciate it if we could share as much as possible between those sub-architectures.

Simon

Quoted 11 lines

Dalon Westergreen (3):
common: add spl/u-boot-spl.hex target
arm: socfpga: stratix10: add CONFIG_SPL_TARGET arm; socfpga: stratix10: Add CONFIG_OF_EMBED

  Makefile                                  | 5 +++++
  configs/socfpga_stratix10_defconfig       | 1 +
  include/configs/socfpga_stratix10_socdk.h | 3 ++-
  3 files changed, 8 insertions(+), 1 deletion(-)
#18 lore raw

cover add optional hex output of u-boot-spl

Quoted 7 lines · Simon Goldschmidt

On 10.09.2018 19:28, Dalon Westergreen wrote:
This patch set adds a possible hex output of the u-boot-spl elf and enables said output for the Intel Stratix10 device. Stratix10 requires a hex output of the elf for creating the secure device manager configuration bitstream.

Quoted 8 lines

I don't use Stratix10 but Cyclone5, but as I need a .hex to boot from FPGA, I want to know how to solve this best.

So to understand this, again a question: is this the only way to boot Stratix10? Or one of the possible boot methods?
Because reading "Intel® Stratix® 10 SoC FPGA Boot User Guide", it seems like you would need the hex for "FPGA Configuration First Mode", but not for "HPS Boot First Mode"?

Stratix 10 always requires this for boot. The configuration method in s10 is very different. The
SDM, which is a security processor, copies the u-boot-spl data to the S10 HPS onchip memory.
After this is done, the SDM releases the hps from reset. This is regardless of the HPS boot media,
which could be SDMMC, etc, etc.

Quoted 4 lines

If so, it would make Stratix10 and Cyclone5 more alike and a configuration option (like "Boot from FPGA") could be used to control CONFIG_OF_EMBED and enable creating the hex file for SPL.

I looked into how i could enable CONFIG_OF_EMBED only for the SPL build and found no easy way. It was suggested to add something like CONFIG_SPL_OF_EMBED but it still seemed this would require touching a bunch of code. In the end, i really see no reason in socfpga to have the devicetree separated from u-boot / spl.

Quoted 5 lines

I *am* working on fixing the "boot from FPGA" case for Cyclone5, so I'd appreaciate it if we could share as much as possible between those sub-architectures.

What difficulties are you having?

Quoted 20 lines

Simon

Dalon Westergreen (3):
common: add spl/u-boot-spl.hex target
arm: socfpga: stratix10: add CONFIG_SPL_TARGET
arm; socfpga: stratix10: Add CONFIG_OF_EMBED

  Makefile                                  | 5 +++++
  configs/socfpga_stratix10_defconfig       | 1 +
  include/configs/socfpga_stratix10_socdk.h | 3 ++-
  3 files changed, 8 insertions(+), 1 deletion(-)

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#19 lore raw

cover add optional hex output of u-boot-spl

Quoted 15 lines · Dalon L Westergreen
Quoted 5 lines · Simon Goldschmidt

On 10.09.2018 19:28, Dalon Westergreen wrote:
This patch set adds a possible hex output of the u-boot-spl elf and enables said output for the Intel Stratix10 device. Stratix10 requires a hex output of the elf for creating the secure device manager

Quoted 8 lines

configuration bitstream.
I don't use Stratix10 but Cyclone5, but as I need a .hex to boot from FPGA, I want to know how to solve this best.
So to understand this, again a question: is this the only way to boot Stratix10? Or one of the possible boot methods?
Because reading "Intel® Stratix® 10 SoC FPGA Boot User Guide", it seems like you would need the hex for "FPGA Configuration First Mode", but not for "HPS Boot First Mode"?

Quoted 7 lines

Stratix 10 always requires this for boot. The configuration method in s10 is very different. The
SDM, which is a security processor, copies the u-boot-spl data to the S10 HPS onchip memory.
After this is done, the SDM releases the hps from reset. This is regardless of the HPS boot media,
which could be SDMMC, etc, etc.

OK, reading the PDF I referenced in more detail, I think I can follow you ;-)

Quoted 8 lines
Quoted 3 lines

If so, it would make Stratix10 and Cyclone5 more alike and a configuration option (like "Boot from FPGA") could be used to control CONFIG_OF_EMBED and enable creating the hex file for SPL.

I looked into how i could enable CONFIG_OF_EMBED only for the SPL build and found no easy way. It was suggested to add something like CONFIG_SPL_OF_EMBED but it still seemed this would require touching a bunch of code. In the end, i really see no reason in socfpga to have the devicetree separated from u-boot / spl.

We're planning multi-board support with one binary and multiple devicetrees, but CONFIG_MULTI_DTB_FIT might also work for that... The only thing that looks bad is that the U-Boot image file name changes...

Quoted 4 lines
Quoted 3 lines

I *am* working on fixing the "boot from FPGA" case for Cyclone5, so I'd appreaciate it if we could share as much as possible between those sub-architectures.

What difficulties are you having?

Time, mostly ;-)
But seriously speaking, Cyclone5 executes the SPL from FPGA onchip RAM in this boot mode, and the bridges got disabled. That was the main problem, I think. I've had patches sent, but they weren't clean enough for 2018.09. I'll hope to find the time to work on them in the next couple of weeks...

And I hope to find the time to test your patchsets on gen5, as well.

Simon

Quoted 13 lines
Quoted 13 lines

Simon
Dalon Westergreen (3):
common: add spl/u-boot-spl.hex target
arm: socfpga: stratix10: add CONFIG_SPL_TARGET arm; socfpga: stratix10: Add CONFIG_OF_EMBED

   Makefile                                  | 5 +++++
   configs/socfpga_stratix10_defconfig       | 1 +
   include/configs/socfpga_stratix10_socdk.h | 3 ++-
   3 files changed, 8 insertions(+), 1 deletion(-)

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de <mailto:[email protected]>
https://lists.denx.de/listinfo/u-boot