diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-19 13:55:52 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-28 19:30:39 -0600 |
commit | bcd4e6f3bd79faef0e57f5ff8adc8b6b4ecfa005 (patch) | |
tree | af95a8ce4d675262040af274ebfd176d3a177096 /Makefile | |
parent | 38f159c05b3cdbc6f4701acd139b6577260081a9 (diff) | |
download | u-boot-bcd4e6f3bd79faef0e57f5ff8adc8b6b4ecfa005.tar.gz u-boot-bcd4e6f3bd79faef0e57f5ff8adc8b6b4ecfa005.tar.bz2 u-boot-bcd4e6f3bd79faef0e57f5ff8adc8b6b4ecfa005.zip |
x86: Change how selection of ROMs works
Most x86 boards build a u-boot.rom which is programmed into SPI flash. But
this is not unique to x86. For example some rockchip boards can also boot
from SPI flash.
Also, at least on x86, binary blobs are sadly quite common. It is not
possible to build a functional image without them, and U-Boot needs to
know this at build time.
Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is
built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary
blobs are also needed. If they are not needed, it is safe to build the ROM
always. Otherwise we still require the BUILD_ROM environment variable.
For now this affects only x86, but future patches will enable this for
rockchip too.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -921,9 +921,12 @@ ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf ALL-$(CONFIG_EFI_APP) += u-boot-app.efi ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi +ifneq ($(CONFIG_HAS_ROM),) ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom +ALL-y += u-boot.rom endif +endif + ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin endif @@ -1585,7 +1588,7 @@ endif # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in # the middle. This is handled by binman based on an image description in the # board's device tree. -ifneq ($(CONFIG_X86_RESET_VECTOR),) +ifneq ($(CONFIG_HAS_ROM),) rom: u-boot.rom FORCE refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE @@ -1595,11 +1598,12 @@ quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -u-boot.rom: u-boot-x86-start16.bin u-boot-x86-reset16.bin u-boot.bin \ +rom-deps := u-boot.bin +ifdef CONFIG_X86 +rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.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) + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 u-boot-x86-start16.bin: u-boot FORCE @@ -1610,6 +1614,10 @@ u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) endif +u-boot.rom: $(rom-deps) FORCE + $(call if_changed,binman) +endif + ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),) u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE |