Re: [U-Boot] [PATCH 09/34] binman: x86: Separate out 16-bit reset and init code

2019-09-26 Thread sjg
At present these two sections of code are linked together into a single
2KB chunk in a single file. Some Intel SoCs like to have a FIT (Firmware
Interface Table) in the ROM and the pointer for this needs to go at
0xffc0 which is in the middle of these two sections.

Make use of the new 'reset' entry and change the existing 16-bit entry to
include just the 16-bit data.

Signed-off-by: Simon Glass 
---

 Makefile  | 10 --
 arch/x86/dts/u-boot.dtsi  |  9 ++
 scripts/Makefile.spl  | 22 +
 tools/binman/README.entries   | 46 +++
 tools/binman/etype/x86_start16.py | 15 +
 tools/binman/etype/x86_start16_spl.py | 19 +--
 tools/binman/etype/x86_start16_tpl.py | 18 ++-
 tools/binman/ftest.py |  6 ++--
 8 files changed, 88 insertions(+), 57 deletions(-)

Applied to u-boot-dm, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 09/34] binman: x86: Separate out 16-bit reset and init code

2019-08-24 Thread Simon Glass
At present these two sections of code are linked together into a single
2KB chunk in a single file. Some Intel SoCs like to have a FIT (Firmware
Interface Table) in the ROM and the pointer for this needs to go at
0xffc0 which is in the middle of these two sections.

Make use of the new 'reset' entry and change the existing 16-bit entry to
include just the 16-bit data.

Signed-off-by: Simon Glass 
---

 Makefile  | 10 --
 arch/x86/dts/u-boot.dtsi  |  9 ++
 scripts/Makefile.spl  | 22 +
 tools/binman/README.entries   | 46 +++
 tools/binman/etype/x86_start16.py | 15 +
 tools/binman/etype/x86_start16_spl.py | 19 +--
 tools/binman/etype/x86_start16_tpl.py | 18 ++-
 tools/binman/ftest.py |  6 ++--
 8 files changed, 88 insertions(+), 57 deletions(-)

diff --git a/Makefile b/Makefile
index 3b0864ae8e..df4a54e204 100644
--- a/Makefile
+++ b/Makefile
@@ -1402,14 +1402,18 @@ quiet_cmd_ldr = LD  $@
 cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
   $(filter-out FORCE,$^) -o $@
 
-u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \
+u-boot.rom: u-boot-x86-start16.bin u-boot-x86-reset16.bin u-boot.bin \
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
$(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \
$(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE
$(call if_changed,binman)
 
-OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
-u-boot-x86-16bit.bin: u-boot FORCE
+OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16
+u-boot-x86-start16.bin: u-boot FORCE
+   $(call if_changed,objcopy)
+
+OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec
+u-boot-x86-reset16.bin: u-boot FORCE
$(call if_changed,objcopy)
 endif
 
diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi
index daeb168b65..0e87b88e10 100644
--- a/arch/x86/dts/u-boot.dtsi
+++ b/arch/x86/dts/u-boot.dtsi
@@ -120,14 +120,23 @@
x86-start16-tpl {
offset = ;
};
+   x86-reset16-tpl {
+   offset = ;
+   };
 #elif defined(CONFIG_SPL)
x86-start16-spl {
offset = ;
};
+   x86-reset16-spl {
+   offset = ;
+   };
 #else
x86-start16 {
offset = ;
};
+   x86-reset16 {
+   offset = ;
+   };
 #endif
 };
 #endif
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 7af6b120b6..0f3d89b215 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -229,9 +229,11 @@ ALL-y  += $(obj)/boot.bin
 endif
 
 ifdef CONFIG_TPL_BUILD
-ALL-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-tpl.bin
+ALL-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \
+   $(obj)/u-boot-x86-reset16-tpl.bin
 else
-ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-spl.bin
+ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \
+   $(obj)/u-boot-x86-reset16-spl.bin
 endif
 
 ALL-$(CONFIG_ARCH_ZYNQ)+= $(obj)/boot.bin
@@ -337,12 +339,20 @@ OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O 
binary \
 $(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
$(call if_changed,objcopy)
 
-OBJCOPYFLAGS_u-boot-x86-16bit-spl.bin := -O binary -j .start16 -j .resetvec
-$(obj)/u-boot-x86-16bit-spl.bin: $(obj)/u-boot-spl FORCE
+OBJCOPYFLAGS_u-boot-x86-start16-spl.bin := -O binary -j .start16
+$(obj)/u-boot-x86-start16-spl.bin: $(obj)/u-boot-spl FORCE
$(call if_changed,objcopy)
 
-OBJCOPYFLAGS_u-boot-x86-16bit-tpl.bin := -O binary -j .start16 -j .resetvec
-$(obj)/u-boot-x86-16bit-tpl.bin: $(obj)/u-boot-tpl FORCE
+OBJCOPYFLAGS_u-boot-x86-start16-tpl.bin := -O binary -j .start16
+$(obj)/u-boot-x86-start16-tpl.bin: $(obj)/u-boot-tpl FORCE
+   $(call if_changed,objcopy)
+
+OBJCOPYFLAGS_u-boot-x86-reset16-spl.bin := -O binary -j .resetvec
+$(obj)/u-boot-x86-reset16-spl.bin: $(obj)/u-boot-spl FORCE
+   $(call if_changed,objcopy)
+
+OBJCOPYFLAGS_u-boot-x86-reset16-tpl.bin := -O binary -j .resetvec
+$(obj)/u-boot-x86-reset16-tpl.bin: $(obj)/u-boot-tpl FORCE
$(call if_changed,objcopy)
 
 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
diff --git a/tools/binman/README.entries b/tools/binman/README.entries
index 55e3fa0dcc..d17b3cb078 100644
--- a/tools/binman/README.entries
+++ b/tools/binman/README.entries
@@ -989,14 +989,15 @@ Entry: x86-start16: x86 16-bit start-up code for U-Boot
 ---
 
 Properties / Entry arguments:
-- filename: Filename of u-boot-x86-16bit.bin (default
-'u-boot-x86-16bit.bin')
+- filename: Filename of u-boot-x86-start16.bin (default
+'u-boot-x86-start16.bin')
 
 x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
-must be placed at a particular address. This