Message ID | 1475787582-32106-12-git-send-email-sjg@chromium.org |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
Headers | show |
Hi Bin, On 6 October 2016 at 14:59, Simon Glass <sjg@chromium.org> wrote: > Change x86 boards to use binman to produce the ROM. This involves adding the > image definition to the device tree and using it in the Makefile. The > existing ifdtool features are no-longer needed. > > Note that the .dtsi file is common and is used for all x86 boards. > > Signed-off-by: Simon Glass <sjg@chromium.org> > --- > > Changes in v4: > - Remove RFC tag > - Use binman for all x86 boards > > Changes in v3: > - Put the binman definition in u-boot.dtsi > > Changes in v2: > - Add automated test coverage > - Put the binman definition in a common file for x86 > - Various changes and improvements based on using this tool for a while > > Makefile | 45 +++-------------------------------- > arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 65 insertions(+), 42 deletions(-) > create mode 100644 arch/x86/dts/u-boot.dtsi What do you think of this patch? Regards, Simon
Hi Simon, On Thu, Oct 13, 2016 at 8:04 AM, Simon Glass <sjg@chromium.org> wrote: > Hi Bin, > > On 6 October 2016 at 14:59, Simon Glass <sjg@chromium.org> wrote: >> Change x86 boards to use binman to produce the ROM. This involves adding the >> image definition to the device tree and using it in the Makefile. The >> existing ifdtool features are no-longer needed. >> >> Note that the .dtsi file is common and is used for all x86 boards. >> >> Signed-off-by: Simon Glass <sjg@chromium.org> >> --- >> >> Changes in v4: >> - Remove RFC tag >> - Use binman for all x86 boards >> >> Changes in v3: >> - Put the binman definition in u-boot.dtsi >> >> Changes in v2: >> - Add automated test coverage >> - Put the binman definition in a common file for x86 >> - Various changes and improvements based on using this tool for a while >> >> Makefile | 45 +++-------------------------------- >> arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 65 insertions(+), 42 deletions(-) >> create mode 100644 arch/x86/dts/u-boot.dtsi > > What do you think of this patch? > Sorry, I will try to look at this in a day or two. Regards, Bin
Hi Bin, On 12 October 2016 at 17:56, Bin Meng <bmeng.cn@gmail.com> wrote: > Hi Simon, > > On Thu, Oct 13, 2016 at 8:04 AM, Simon Glass <sjg@chromium.org> wrote: >> Hi Bin, >> >> On 6 October 2016 at 14:59, Simon Glass <sjg@chromium.org> wrote: >>> Change x86 boards to use binman to produce the ROM. This involves adding the >>> image definition to the device tree and using it in the Makefile. The >>> existing ifdtool features are no-longer needed. >>> >>> Note that the .dtsi file is common and is used for all x86 boards. >>> >>> Signed-off-by: Simon Glass <sjg@chromium.org> >>> --- >>> >>> Changes in v4: >>> - Remove RFC tag >>> - Use binman for all x86 boards >>> >>> Changes in v3: >>> - Put the binman definition in u-boot.dtsi >>> >>> Changes in v2: >>> - Add automated test coverage >>> - Put the binman definition in a common file for x86 >>> - Various changes and improvements based on using this tool for a while >>> >>> Makefile | 45 +++-------------------------------- >>> arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ >>> 2 files changed, 65 insertions(+), 42 deletions(-) >>> create mode 100644 arch/x86/dts/u-boot.dtsi >> >> What do you think of this patch? >> > > Sorry, I will try to look at this in a day or two. Did you get a chance to take a look at this? Regards, Simon
Hi Simon, On Fri, Oct 28, 2016 at 10:41 AM, Simon Glass <sjg@chromium.org> wrote: > Hi Bin, > > On 12 October 2016 at 17:56, Bin Meng <bmeng.cn@gmail.com> wrote: >> Hi Simon, >> >> On Thu, Oct 13, 2016 at 8:04 AM, Simon Glass <sjg@chromium.org> wrote: >>> Hi Bin, >>> >>> On 6 October 2016 at 14:59, Simon Glass <sjg@chromium.org> wrote: >>>> Change x86 boards to use binman to produce the ROM. This involves adding the >>>> image definition to the device tree and using it in the Makefile. The >>>> existing ifdtool features are no-longer needed. >>>> >>>> Note that the .dtsi file is common and is used for all x86 boards. >>>> >>>> Signed-off-by: Simon Glass <sjg@chromium.org> >>>> --- >>>> >>>> Changes in v4: >>>> - Remove RFC tag >>>> - Use binman for all x86 boards >>>> >>>> Changes in v3: >>>> - Put the binman definition in u-boot.dtsi >>>> >>>> Changes in v2: >>>> - Add automated test coverage >>>> - Put the binman definition in a common file for x86 >>>> - Various changes and improvements based on using this tool for a while >>>> >>>> Makefile | 45 +++-------------------------------- >>>> arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ >>>> 2 files changed, 65 insertions(+), 42 deletions(-) >>>> create mode 100644 arch/x86/dts/u-boot.dtsi >>> >>> What do you think of this patch? >>> >> >> Sorry, I will try to look at this in a day or two. > > Did you get a chance to take a look at this? > Looks the python import error was caused by an incorrect installation of python. I will try to have a look tomorrow. Regards, Bin
Hi Bin, On 1 November 2016 at 04:07, Bin Meng <bmeng.cn@gmail.com> wrote: > Hi Simon, > > On Fri, Oct 28, 2016 at 10:41 AM, Simon Glass <sjg@chromium.org> wrote: >> Hi Bin, >> >> On 12 October 2016 at 17:56, Bin Meng <bmeng.cn@gmail.com> wrote: >>> Hi Simon, >>> >>> On Thu, Oct 13, 2016 at 8:04 AM, Simon Glass <sjg@chromium.org> wrote: >>>> Hi Bin, >>>> >>>> On 6 October 2016 at 14:59, Simon Glass <sjg@chromium.org> wrote: >>>>> Change x86 boards to use binman to produce the ROM. This involves adding the >>>>> image definition to the device tree and using it in the Makefile. The >>>>> existing ifdtool features are no-longer needed. >>>>> >>>>> Note that the .dtsi file is common and is used for all x86 boards. >>>>> >>>>> Signed-off-by: Simon Glass <sjg@chromium.org> >>>>> --- >>>>> >>>>> Changes in v4: >>>>> - Remove RFC tag >>>>> - Use binman for all x86 boards >>>>> >>>>> Changes in v3: >>>>> - Put the binman definition in u-boot.dtsi >>>>> >>>>> Changes in v2: >>>>> - Add automated test coverage >>>>> - Put the binman definition in a common file for x86 >>>>> - Various changes and improvements based on using this tool for a while >>>>> >>>>> Makefile | 45 +++-------------------------------- >>>>> arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ >>>>> 2 files changed, 65 insertions(+), 42 deletions(-) >>>>> create mode 100644 arch/x86/dts/u-boot.dtsi >>>> >>>> What do you think of this patch? >>>> >>> >>> Sorry, I will try to look at this in a day or two. >> >> Did you get a chance to take a look at this? >> > > Looks the python import error was caused by an incorrect installation > of python. I will try to have a look tomorrow. OK, that's odd! - Simon
Hi Simon, On Wed, Nov 2, 2016 at 10:07 PM, Simon Glass <sjg@chromium.org> wrote: > Hi Bin, > > On 1 November 2016 at 04:07, Bin Meng <bmeng.cn@gmail.com> wrote: >> Hi Simon, >> >> On Fri, Oct 28, 2016 at 10:41 AM, Simon Glass <sjg@chromium.org> wrote: >>> Hi Bin, >>> >>> On 12 October 2016 at 17:56, Bin Meng <bmeng.cn@gmail.com> wrote: >>>> Hi Simon, >>>> >>>> On Thu, Oct 13, 2016 at 8:04 AM, Simon Glass <sjg@chromium.org> wrote: >>>>> Hi Bin, >>>>> >>>>> On 6 October 2016 at 14:59, Simon Glass <sjg@chromium.org> wrote: >>>>>> Change x86 boards to use binman to produce the ROM. This involves adding the >>>>>> image definition to the device tree and using it in the Makefile. The >>>>>> existing ifdtool features are no-longer needed. >>>>>> >>>>>> Note that the .dtsi file is common and is used for all x86 boards. >>>>>> >>>>>> Signed-off-by: Simon Glass <sjg@chromium.org> >>>>>> --- >>>>>> >>>>>> Changes in v4: >>>>>> - Remove RFC tag >>>>>> - Use binman for all x86 boards >>>>>> >>>>>> Changes in v3: >>>>>> - Put the binman definition in u-boot.dtsi >>>>>> >>>>>> Changes in v2: >>>>>> - Add automated test coverage >>>>>> - Put the binman definition in a common file for x86 >>>>>> - Various changes and improvements based on using this tool for a while >>>>>> >>>>>> Makefile | 45 +++-------------------------------- >>>>>> arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ >>>>>> 2 files changed, 65 insertions(+), 42 deletions(-) >>>>>> create mode 100644 arch/x86/dts/u-boot.dtsi >>>>> >>>>> What do you think of this patch? >>>>> >>>> >>>> Sorry, I will try to look at this in a day or two. >>> >>> Did you get a chance to take a look at this? >>> >> >> Looks the python import error was caused by an incorrect installation >> of python. I will try to have a look tomorrow. > > OK, that's odd! I am getting another error with fdtput fdtput: invalid option -- 'd' Usage: write a property value to a device tree fdtput <options> <dt file> <node> <property> [<value>...] fdtput -c <options> <dt file> [<node>...] The command line arguments are joined together into a single value. <type> s=string, i=int, u=unsigned, x=hex Optional modifier prefix: hh or b=byte, h=2 byte, l=4 byte (default) My fdtput version is 1.4.0. I suspect I will need to update to latest version 1.4.2? This tool version requirement should be documented. Regards, Bin
Hi Simon, On Fri, Oct 7, 2016 at 4:59 AM, Simon Glass <sjg@chromium.org> wrote: > Change x86 boards to use binman to produce the ROM. This involves adding the > image definition to the device tree and using it in the Makefile. The > existing ifdtool features are no-longer needed. > > Note that the .dtsi file is common and is used for all x86 boards. > > Signed-off-by: Simon Glass <sjg@chromium.org> > --- > > Changes in v4: > - Remove RFC tag > - Use binman for all x86 boards > > Changes in v3: > - Put the binman definition in u-boot.dtsi > > Changes in v2: > - Add automated test coverage > - Put the binman definition in a common file for x86 > - Various changes and improvements based on using this tool for a while > > Makefile | 45 +++-------------------------------- > arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 65 insertions(+), 42 deletions(-) > create mode 100644 arch/x86/dts/u-boot.dtsi > > diff --git a/Makefile b/Makefile > index a5bbb24..31c3146 100644 > --- a/Makefile > +++ b/Makefile > @@ -1060,50 +1060,11 @@ endif > > # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including > # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in > -# the middle. > +# the middle. This is handled by binman based on an image description in the > +# board's device tree. > ifneq ($(CONFIG_X86_RESET_VECTOR),) > rom: u-boot.rom FORCE > > -IFDTOOL=$(objtree)/tools/ifdtool > -IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb > -IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1) > -IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin > -IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin > -IFDTOOL_FLAGS += -C > - > -ifneq ($(CONFIG_HAVE_INTEL_ME),) > -IFDTOOL_ME_FLAGS = -D $(srctree)/board/$(BOARDDIR)/descriptor.bin > -IFDTOOL_ME_FLAGS += -i ME:$(srctree)/board/$(BOARDDIR)/me.bin > -endif > - > -ifneq ($(CONFIG_HAVE_MRC),) > -IFDTOOL_FLAGS += -w $(CONFIG_X86_MRC_ADDR):$(srctree)/board/$(BOARDDIR)/mrc.bin > -endif > - > -ifneq ($(CONFIG_HAVE_FSP),) > -IFDTOOL_FLAGS += -w $(CONFIG_FSP_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_FSP_FILE) > -endif > - > -ifneq ($(CONFIG_HAVE_CMC),) > -IFDTOOL_FLAGS += -w $(CONFIG_CMC_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_CMC_FILE) > -endif > - > -ifneq ($(CONFIG_HAVE_VGA_BIOS),) > -IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE) > -endif > - > -ifneq ($(CONFIG_HAVE_REFCODE),) > -IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin > -endif > - > -quiet_cmd_ifdtool = IFDTOOL $@ > -cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp; > -ifneq ($(CONFIG_HAVE_INTEL_ME),) > -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_ME_FLAGS) u-boot.tmp; > -endif > -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; > -cmd_ifdtool += mv u-boot.tmp $@ > - > refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE > $(call if_changed,copy) > > @@ -1113,7 +1074,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ > > u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \ > $(if $(CONFIG_HAVE_REFCODE),refcode.bin) > - $(call if_changed,ifdtool) > + $(call if_changed,binman) > > OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec > u-boot-x86-16bit.bin: u-boot FORCE > diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi > new file mode 100644 > index 0000000..724913f > --- /dev/null > +++ b/arch/x86/dts/u-boot.dtsi > @@ -0,0 +1,62 @@ > +/* > + * Copyright (C) 2016 Google, Inc > + * Written by Simon Glass <sjg@chromium.org> > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#include <config.h> > + > +#ifdef CONFIG_ROM_SIZE > +/ { > + binman { > + filename = "u-boot.rom"; > + end-at-4gb; > + sort-by-pos; > + pad-byte = <0xff>; > + size = <CONFIG_ROM_SIZE>; > +#ifdef CONFIG_HAVE_INTEL_ME > + intel-descriptor { > + }; > + intel-me { > + }; > +#endif > + u-boot-with-ucode-ptr { > + pos = <CONFIG_SYS_TEXT_BASE>; > + }; > + u-boot-dtb-with-ucode { > + }; This causes build error for QEMU. BINMAN u-boot.rom Node '/binman/u-boot-dtb-with-ucode': No /microcode node found in './u-boot-dtb-with-ucode.dtb' make: *** [u-boot.rom] Error 1 > + u-boot-ucode { > + align = <16>; > + }; > +#ifdef CONFIG_HAVE_MRC > + intel-mrc { > + pos = <CONFIG_X86_MRC_ADDR>; > + }; > +#endif > +#ifdef CONFIG_HAVE_FSP > + intel-fsp { > + pos = <CONFIG_FSP_ADDR>; > + }; > +#endif > +#ifdef CONFIG_HAVE_CMC > + intel-cmc { > + pos = <CONFIG_CMC_ADDR>; > + }; > +#endif > +#ifdef CONFIG_HAVE_VGA_BIOS > + intel-vga { > + pos = <CONFIG_VGA_BIOS_ADDR>; > + }; > +#endif > +#ifdef CONFIG_HAVE_REFCODE > + intel-refcode { > + pos = <CONFIG_X86_REFCODE_ADDR>; > + }; > +#endif > + x86-start16 { > + pos = <CONFIG_SYS_X86_START16>; > + }; > + }; > +}; > +#endif Regards, Bin
Hi Bin, On 2 November 2016 at 22:11, Bin Meng <bmeng.cn@gmail.com> wrote: > Hi Simon, > > On Fri, Oct 7, 2016 at 4:59 AM, Simon Glass <sjg@chromium.org> wrote: >> Change x86 boards to use binman to produce the ROM. This involves adding the >> image definition to the device tree and using it in the Makefile. The >> existing ifdtool features are no-longer needed. >> >> Note that the .dtsi file is common and is used for all x86 boards. >> >> Signed-off-by: Simon Glass <sjg@chromium.org> >> --- >> >> Changes in v4: >> - Remove RFC tag >> - Use binman for all x86 boards >> >> Changes in v3: >> - Put the binman definition in u-boot.dtsi >> >> Changes in v2: >> - Add automated test coverage >> - Put the binman definition in a common file for x86 >> - Various changes and improvements based on using this tool for a while >> >> Makefile | 45 +++-------------------------------- >> arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 65 insertions(+), 42 deletions(-) >> create mode 100644 arch/x86/dts/u-boot.dtsi >> >> diff --git a/Makefile b/Makefile >> index a5bbb24..31c3146 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -1060,50 +1060,11 @@ endif >> >> # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including >> # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in >> -# the middle. >> +# the middle. This is handled by binman based on an image description in the >> +# board's device tree. >> ifneq ($(CONFIG_X86_RESET_VECTOR),) >> rom: u-boot.rom FORCE >> >> -IFDTOOL=$(objtree)/tools/ifdtool >> -IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb >> -IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1) >> -IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin >> -IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin >> -IFDTOOL_FLAGS += -C >> - >> -ifneq ($(CONFIG_HAVE_INTEL_ME),) >> -IFDTOOL_ME_FLAGS = -D $(srctree)/board/$(BOARDDIR)/descriptor.bin >> -IFDTOOL_ME_FLAGS += -i ME:$(srctree)/board/$(BOARDDIR)/me.bin >> -endif >> - >> -ifneq ($(CONFIG_HAVE_MRC),) >> -IFDTOOL_FLAGS += -w $(CONFIG_X86_MRC_ADDR):$(srctree)/board/$(BOARDDIR)/mrc.bin >> -endif >> - >> -ifneq ($(CONFIG_HAVE_FSP),) >> -IFDTOOL_FLAGS += -w $(CONFIG_FSP_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_FSP_FILE) >> -endif >> - >> -ifneq ($(CONFIG_HAVE_CMC),) >> -IFDTOOL_FLAGS += -w $(CONFIG_CMC_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_CMC_FILE) >> -endif >> - >> -ifneq ($(CONFIG_HAVE_VGA_BIOS),) >> -IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE) >> -endif >> - >> -ifneq ($(CONFIG_HAVE_REFCODE),) >> -IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin >> -endif >> - >> -quiet_cmd_ifdtool = IFDTOOL $@ >> -cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp; >> -ifneq ($(CONFIG_HAVE_INTEL_ME),) >> -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_ME_FLAGS) u-boot.tmp; >> -endif >> -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; >> -cmd_ifdtool += mv u-boot.tmp $@ >> - >> refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE >> $(call if_changed,copy) >> >> @@ -1113,7 +1074,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ >> >> u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \ >> $(if $(CONFIG_HAVE_REFCODE),refcode.bin) >> - $(call if_changed,ifdtool) >> + $(call if_changed,binman) >> >> OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec >> u-boot-x86-16bit.bin: u-boot FORCE >> diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi >> new file mode 100644 >> index 0000000..724913f >> --- /dev/null >> +++ b/arch/x86/dts/u-boot.dtsi >> @@ -0,0 +1,62 @@ >> +/* >> + * Copyright (C) 2016 Google, Inc >> + * Written by Simon Glass <sjg@chromium.org> >> + * >> + * SPDX-License-Identifier: GPL-2.0+ >> + */ >> + >> +#include <config.h> >> + >> +#ifdef CONFIG_ROM_SIZE >> +/ { >> + binman { >> + filename = "u-boot.rom"; >> + end-at-4gb; >> + sort-by-pos; >> + pad-byte = <0xff>; >> + size = <CONFIG_ROM_SIZE>; >> +#ifdef CONFIG_HAVE_INTEL_ME >> + intel-descriptor { >> + }; >> + intel-me { >> + }; >> +#endif >> + u-boot-with-ucode-ptr { >> + pos = <CONFIG_SYS_TEXT_BASE>; >> + }; >> + u-boot-dtb-with-ucode { >> + }; > > This causes build error for QEMU. > > BINMAN u-boot.rom > Node '/binman/u-boot-dtb-with-ucode': No /microcode node found in > './u-boot-dtb-with-ucode.dtb' > make: *** [u-boot.rom] Error 1 OK, I've fixed that. It's because that board has no microcode, so I've made it optional. Regards, Simon
diff --git a/Makefile b/Makefile index a5bbb24..31c3146 100644 --- a/Makefile +++ b/Makefile @@ -1060,50 +1060,11 @@ endif # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in -# the middle. +# the middle. This is handled by binman based on an image description in the +# board's device tree. ifneq ($(CONFIG_X86_RESET_VECTOR),) rom: u-boot.rom FORCE -IFDTOOL=$(objtree)/tools/ifdtool -IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb -IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1) -IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin -IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin -IFDTOOL_FLAGS += -C - -ifneq ($(CONFIG_HAVE_INTEL_ME),) -IFDTOOL_ME_FLAGS = -D $(srctree)/board/$(BOARDDIR)/descriptor.bin -IFDTOOL_ME_FLAGS += -i ME:$(srctree)/board/$(BOARDDIR)/me.bin -endif - -ifneq ($(CONFIG_HAVE_MRC),) -IFDTOOL_FLAGS += -w $(CONFIG_X86_MRC_ADDR):$(srctree)/board/$(BOARDDIR)/mrc.bin -endif - -ifneq ($(CONFIG_HAVE_FSP),) -IFDTOOL_FLAGS += -w $(CONFIG_FSP_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_FSP_FILE) -endif - -ifneq ($(CONFIG_HAVE_CMC),) -IFDTOOL_FLAGS += -w $(CONFIG_CMC_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_CMC_FILE) -endif - -ifneq ($(CONFIG_HAVE_VGA_BIOS),) -IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE) -endif - -ifneq ($(CONFIG_HAVE_REFCODE),) -IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin -endif - -quiet_cmd_ifdtool = IFDTOOL $@ -cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp; -ifneq ($(CONFIG_HAVE_INTEL_ME),) -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_ME_FLAGS) u-boot.tmp; -endif -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; -cmd_ifdtool += mv u-boot.tmp $@ - refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE $(call if_changed,copy) @@ -1113,7 +1074,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) - $(call if_changed,ifdtool) + $(call if_changed,binman) OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec u-boot-x86-16bit.bin: u-boot FORCE diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi new file mode 100644 index 0000000..724913f --- /dev/null +++ b/arch/x86/dts/u-boot.dtsi @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2016 Google, Inc + * Written by Simon Glass <sjg@chromium.org> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <config.h> + +#ifdef CONFIG_ROM_SIZE +/ { + binman { + filename = "u-boot.rom"; + end-at-4gb; + sort-by-pos; + pad-byte = <0xff>; + size = <CONFIG_ROM_SIZE>; +#ifdef CONFIG_HAVE_INTEL_ME + intel-descriptor { + }; + intel-me { + }; +#endif + u-boot-with-ucode-ptr { + pos = <CONFIG_SYS_TEXT_BASE>; + }; + u-boot-dtb-with-ucode { + }; + u-boot-ucode { + align = <16>; + }; +#ifdef CONFIG_HAVE_MRC + intel-mrc { + pos = <CONFIG_X86_MRC_ADDR>; + }; +#endif +#ifdef CONFIG_HAVE_FSP + intel-fsp { + pos = <CONFIG_FSP_ADDR>; + }; +#endif +#ifdef CONFIG_HAVE_CMC + intel-cmc { + pos = <CONFIG_CMC_ADDR>; + }; +#endif +#ifdef CONFIG_HAVE_VGA_BIOS + intel-vga { + pos = <CONFIG_VGA_BIOS_ADDR>; + }; +#endif +#ifdef CONFIG_HAVE_REFCODE + intel-refcode { + pos = <CONFIG_X86_REFCODE_ADDR>; + }; +#endif + x86-start16 { + pos = <CONFIG_SYS_X86_START16>; + }; + }; +}; +#endif
Change x86 boards to use binman to produce the ROM. This involves adding the image definition to the device tree and using it in the Makefile. The existing ifdtool features are no-longer needed. Note that the .dtsi file is common and is used for all x86 boards. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v4: - Remove RFC tag - Use binman for all x86 boards Changes in v3: - Put the binman definition in u-boot.dtsi Changes in v2: - Add automated test coverage - Put the binman definition in a common file for x86 - Various changes and improvements based on using this tool for a while Makefile | 45 +++-------------------------------- arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 42 deletions(-) create mode 100644 arch/x86/dts/u-boot.dtsi