nb/intel/sandybridge: Use SA devid to identify PC type
[coreboot2.git] / payloads / external / Makefile.inc
blobc87f140da4f880f63558b20cd3f80c6a18cee2e6
1 ## SPDX-License-Identifier: GPL-2.0-only
3 # set up payload config and version files for later inclusion
4 ifeq ($(CONFIG_PAYLOAD_BUILD_SEABIOS),y)
5 PAYLOAD_CONFIG=payloads/external/SeaBIOS/seabios/.config
6 PAYLOAD_VERSION=payloads/external/SeaBIOS/seabios/out/autoversion.h
7 endif
8 ifeq ($(CONFIG_PAYLOAD_FILO),y)
9 PAYLOAD_CONFIG=payloads/external/FILO/filo/.config
10 PAYLOAD_VERSION=payloads/external/FILO/filo/build/version.h
11 endif
12 ifeq ($(CONFIG_PAYLOAD_DEPTHCHARGE),y)
13 PAYLOAD_CONFIG=payloads/external/depthcharge/depthcharge/.config
14 $(PAYLOAD_CONFIG): payloads/external/depthcharge/depthcharge/build/depthcharge.elf
15 ifeq ($(call strip_quotes,$(CONFIG_MAINBOARD_DEPTHCHARGE)),)
16   BOARD=$(call ws_to_under,$(call strip_quotes,$(call tolower,$(CONFIG_MAINBOARD_PART_NUMBER))))
17 else
18   BOARD=$(CONFIG_MAINBOARD_DEPTHCHARGE)
19 endif
20 #TODO: Figure out version
21 endif
23 ifeq ($(CONFIG_PAYLOAD_LINUX)$(CONFIG_PAYLOAD_LINUXBOOT),y)
24 ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_COMMAND_LINE))),)
25       ADDITIONAL_PAYLOAD_CONFIG+=-C $(CONFIG_LINUX_COMMAND_LINE)
26 endif
27 ifneq ($(strip $(call strip_quotes,$(CONFIG_LINUX_INITRD)$(CONFIG_LINUXBOOT_INITRAMFS_PATH))),)
28 ifneq ($(CONFIG_LINUXBOOT_ARM64),y)
29       ADDITIONAL_PAYLOAD_CONFIG+=-I $(CONFIG_LINUX_INITRD)$(CONFIG_LINUXBOOT_INITRAMFS_PATH)$(CONFIG_LINUXBOOT_INITRAMFS_SUFFIX)
30       prebuilt-files += $(strip $(call strip_quotes,$(CONFIG_LINUX_INITRD)$(CONFIG_LINUXBOOT_INITRAMFS)))
31 endif
32 endif
33 endif
34 ifneq ($(strip $(call strip_quotes,$(CONFIG_PAYLOAD_OPTIONS))),)
35       ADDITIONAL_PAYLOAD_CONFIG+=$(strip $(call strip_quotes,$(CONFIG_PAYLOAD_OPTIONS)))
36 endif
38 cbfs-files-y += $(CONFIG_CBFS_PREFIX)/payload
39 $(CONFIG_CBFS_PREFIX)/payload-file := $(CONFIG_PAYLOAD_FILE)
40 ifeq ($(CONFIG_PAYLOAD_IS_FLAT_BINARY),y)
41 $(CONFIG_CBFS_PREFIX)/payload-type := flat-binary
42 else
43 $(CONFIG_CBFS_PREFIX)/payload-type := payload
44 endif
45 $(CONFIG_CBFS_PREFIX)/payload-compression := $(CBFS_PAYLOAD_COMPRESS_FLAG)
46 $(CONFIG_CBFS_PREFIX)/payload-options := $(ADDITIONAL_PAYLOAD_CONFIG)
48 cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += payload_config
49 payload_config-file := $(PAYLOAD_CONFIG)
50 payload_config-type := raw
52 cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += payload_revision
53 payload_revision-file := $(PAYLOAD_VERSION)
54 payload_revision-type := raw
56 cbfs-files-$(CONFIG_GRUB2_INCLUDE_RUNTIME_CONFIG_FILE) += etc/grub.cfg
57 etc/grub.cfg-file := $(CONFIG_GRUB2_RUNTIME_CONFIG_FILE)
58 etc/grub.cfg-type := raw
59 etc/grub.cfg-required := the GRUB runtime configuration file ($(CONFIG_GRUB2_RUNTIME_CONFIG_FILE))
61 # SeaBIOS
63 SEABIOS_CC_OFFSET=$(if $(filter %ccache,$(HOSTCC)),2,1)
64 SEABIOS_TARGET_PATH=payloads/external/SeaBIOS/seabios/out/bios.bin.elf
65 $(SEABIOS_TARGET_PATH): $(DOTCONFIG)
66         $(MAKE) -C payloads/external/SeaBIOS \
67                         HOSTCC="$(HOSTCC)" \
68                         CC=$(word $(SEABIOS_CC_OFFSET),$(CC_x86_32)) \
69                         CFLAGS="$(patsubst $(word $(SEABIOS_CC_OFFSET),$(CC_x86_32))%,,$(wordlist $(SEABIOS_CC_OFFSET),9999,$(CC_x86_32)))" \
70                         LD=$(word 1,$(LD_x86_32)) LDFLAGS="$(patsubst $(word 1,$(LD_x86_32))%,,$(LD_x86_32))" \
71                         OBJDUMP="$(OBJDUMP_x86_32)" \
72                         OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \
73                         AS="$(AS_x86_32)" IASL="$(IASL)" \
74                         CONFIG_SEABIOS_MASTER=$(CONFIG_SEABIOS_MASTER) \
75                         CONFIG_SEABIOS_STABLE=$(CONFIG_SEABIOS_STABLE) \
76                         CONFIG_SEABIOS_REVISION=$(CONFIG_SEABIOS_REVISION) \
77                         CONFIG_SEABIOS_REVISION_ID=$(CONFIG_SEABIOS_REVISION_ID) \
78                         CONFIG_PAYLOAD_CONFIGFILE=$(CONFIG_PAYLOAD_CONFIGFILE) \
79                         CONFIG_SEABIOS_THREAD_OPTIONROMS=$(CONFIG_SEABIOS_THREAD_OPTIONROMS) \
80                         CONFIG_SEABIOS_VGA_COREBOOT=$(CONFIG_SEABIOS_VGA_COREBOOT) \
81                         CONFIG_DRIVERS_UART_8250IO=$(CONFIG_DRIVERS_UART_8250IO) \
82                         CONFIG_DRIVERS_UART_8250MEM=$(CONFIG_DRIVERS_UART_8250MEM) \
83                         CONFIG_HUDSON_UART=$(CONFIG_HUDSON_UART) \
84                         CONFIG_CONSOLE_SERIAL=$(CONFIG_CONSOLE_SERIAL) \
85                         CONFIG_TTYS0_BASE=$(CONFIG_TTYS0_BASE) \
86                         CONFIG_SEABIOS_DEBUG_LEVEL=$(CONFIG_SEABIOS_DEBUG_LEVEL) \
87                         CONFIG_DRIVERS_UART_8250MEM_32=$(CONFIG_DRIVERS_UART_8250MEM_32) \
88                         CONFIG_ENABLE_HSUART=$(CONFIG_ENABLE_HSUART) \
89                         CONFIG_CONSOLE_UART_BASE_ADDRESS=$(CONFIG_CONSOLE_UART_BASE_ADDRESS) \
90                         CONFIG_SEABIOS_HARDWARE_IRQ=$(CONFIG_SEABIOS_HARDWARE_IRQ)
92 payloads/external/SeaBIOS/seabios/out/vgabios.bin: $(SEABIOS_TARGET_PATH)
93 payloads/external/SeaBIOS/seabios/.config: $(SEABIOS_TARGET_PATH)
94 payloads/external/SeaBIOS/seabios/out/autoversion.h: $(SEABIOS_TARGET_PATH)
96 cbfs-files-$(CONFIG_SEABIOS_SECONDARY_PAYLOAD) += img/seabios
97 img/seabios-file := $(SEABIOS_TARGET_PATH)
98 img/seabios-type := payload
99 img/seabios-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
101 # add a SeaBIOS bootorder file
102 ifneq ($(strip $(CONFIG_SEABIOS_BOOTORDER_FILE)),)
103 cbfs-files-y += bootorder
104 bootorder-file := $(strip $(CONFIG_SEABIOS_BOOTORDER_FILE))
105 bootorder-type := raw
106 endif
108 ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),)
109 ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),0)
110 $(call add_intermediate, seabios_ps2_timeout, $(CBFSTOOL))
111         @printf "    SeaBIOS    Wait up to $(CONFIG_SEABIOS_PS2_TIMEOUT) ms for PS/2 keyboard controller initialization\n"
112         $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/ps2-keyboard-spinup 2>/dev/null)
113         $(CBFSTOOL) $< add-int -i $(CONFIG_SEABIOS_PS2_TIMEOUT) -n etc/ps2-keyboard-spinup
114 endif
115 endif
117 ifeq ($(CONFIG_SEABIOS_ADD_SERCON_PORT_FILE),y)
118 $(call add_intermediate, seabios_sercon, $(CBFSTOOL))
119         @printf "    SeaBIOS    Add sercon-port file\n"
120         $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/sercon-port 2>/dev/null)
121         $(CBFSTOOL) $< add-int -i $(CONFIG_SEABIOS_SERCON_PORT_ADDR) -n etc/sercon-port
122 endif
124 ifeq ($(CONFIG_SEABIOS_THREAD_OPTIONROMS),y)
125 $(call add_intermediate, seabios_thread_optionroms, $(CBFSTOOL))
126         @printf "    SeaBIOS    Thread optionroms\n"
127         $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/threads 2>/dev/null)
128         $(CBFSTOOL) $< add-int -i 2 -n etc/threads
129 endif
131 ifeq ($(CONFIG_PAYLOAD_SEAGRUB),y)
132 ifneq ($(CONFIG_SEAGRUB_ALLOW_SEABIOS_BOOTMENU),y)
133 $(call add_intermediate, seabios_bootmenu, $(CBFSTOOL))
134         @printf "    SeaBIOS    Disable boot menu\n"
135         $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/show-boot-menu 2>/dev/null)
136         $(CBFSTOOL) $< add-int -i 0 -n etc/show-boot-menu
137 else
138 $(call add_intermediate, seabios_bootmenu, $(CBFSTOOL))
139         $(if $(CONFIG_UPDATE_IMAGE),-$(CBFSTOOL) $< remove -n etc/show-boot-menu 2>/dev/null)
140 endif
141 endif
143 # Depthcharge
145 payloads/external/depthcharge/depthcharge/build/depthcharge.elf depthcharge: $(DOTCONFIG) $(CBFSTOOL)
146         $(MAKE) -C payloads/external/depthcharge \
147                 BOARD=$(BOARD) \
148                 MFLAGS= MAKEFLAGS= \
149                 DEPTHCHARGE_MASTER=$(CONFIG_DEPTHCHARGE_MASTER) \
150                 DEPTHCHARGE_STABLE=$(CONFIG_DEPTHCHARGE_STABLE) \
151                 DEPTHCHARGE_REVISION=$(CONFIG_DEPTHCHARGE_REVISION) \
152                 DEPTHCHARGE_REVISION_ID=$(CONFIG_DEPTHCHARGE_REVISION_ID) \
153                 OVERRIDE_DEFCONFIG=$(CONFIG_LP_DEFCONFIG_OVERRIDE)
155 # edk2
157 $(obj)/UEFIPAYLOAD.fd: $(DOTCONFIG)
158         $(MAKE) -C payloads/external/edk2 UefiPayloadPkg \
159                 HOSTCC="$(HOSTCC)" \
160                 CC="$(HOSTCC)" \
161                 CONFIG_EDK2_REPOSITORY=$(CONFIG_EDK2_REPOSITORY) \
162                 CONFIG_EDK2_TAG_OR_REV=$(CONFIG_EDK2_TAG_OR_REV) \
163                 CONFIG_EDK2_UEFIPAYLOAD=$(CONFIG_EDK2_UEFIPAYLOAD) \
164                 CONFIG_EDK2_UNIVERSAL_PAYLOAD=$(CONFIG_EDK2_UNIVERSAL_PAYLOAD) \
165                 CONFIG_EDK2_REPO_OFFICIAL=$(CONFIG_EDK2_REPO_OFFICIAL) \
166                 CONFIG_EDK2_REPO_MRCHROMEBOX=$(CONFIG_EDK2_REPO_MRCHROMEBOX) \
167                 CONFIG_EDK2_REPO_CUSTOM=$(CONFIG_EDK2_REPO_CUSTOM) \
168                 CONFIG_EDK2_CPU_TIMER_LIB=$(CONFIG_EDK2_CPU_TIMER_LIB) \
169                 CONFIG_EDK2_CUSTOM_BUILD_PARAMS=$(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) \
170                 CONFIG_EDK2_USE_EDK2_PLATFORMS=$(CONFIG_EDK2_USE_EDK2_PLATFORMS) \
171                 CONFIG_EDK2_PLATFORMS_REPOSITORY=$(CONFIG_EDK2_PLATFORMS_REPOSITORY) \
172                 CONFIG_EDK2_PLATFORMS_TAG_OR_REV=$(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) \
173                 CONFIG_EDK2_DEBUG=$(CONFIG_EDK2_DEBUG) \
174                 CONFIG_EDK2_RELEASE=$(CONFIG_EDK2_RELEASE) \
175                 CONFIG_EDK2_BOOTSPLASH_FILE=$(CONFIG_EDK2_BOOTSPLASH_FILE) \
176                 CONFIG_EDK2_BOOT_MANAGER_ESCAPE=$(CONFIG_EDK2_BOOT_MANAGER_ESCAPE) \
177                 CONFIG_EDK2_BOOT_TIMEOUT=$(CONFIG_EDK2_BOOT_TIMEOUT) \
178                 CONFIG_EDK2_CBMEM_LOGGING=$(CONFIG_EDK2_CBMEM_LOGGING) \
179                 CONFIG_EDK2_FOLLOW_BGRT_SPEC=$(CONFIG_EDK2_FOLLOW_BGRT_SPEC) \
180                 CONFIG_EDK2_FULL_SCREEN_SETUP=$(CONFIG_EDK2_FULL_SCREEN_SETUP) \
181                 CONFIG_EDK2_HAVE_EFI_SHELL=$(CONFIG_EDK2_HAVE_EFI_SHELL) \
182                 CONFIG_EDK2_PRIORITIZE_INTERNAL=$(CONFIG_EDK2_PRIORITIZE_INTERNAL) \
183                 CONFIG_EDK2_PS2_SUPPORT=$(CONFIG_EDK2_PS2_SUPPORT) \
184                 CONFIG_EDK2_SERIAL_SUPPORT=$(CONFIG_EDK2_SERIAL_SUPPORT) \
185                 CONFIG_EDK2_SD_MMC_TIMEOUT=$(CONFIG_EDK2_SD_MMC_TIMEOUT) \
186                 CONFIG_ECAM_MMCONF_BASE_ADDRESS=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) \
187                 CONFIG_ECAM_MMCONF_LENGTH=$(CONFIG_ECAM_MMCONF_LENGTH) \
188                 CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS=$(CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS) \
189                 CONFIG_CPU_XTAL_HZ=$(CONFIG_CPU_XTAL_HZ) \
190                 CONFIG_SMMSTORE_V2=$(CONFIG_SMMSTORE_V2) \
191                 CONFIG_EDK2_SECURE_BOOT_SUPPORT=$(CONFIG_EDK2_SECURE_BOOT_SUPPORT) \
192                 CONFIG_EDK2_GOP_DRIVER=$(CONFIG_EDK2_GOP_DRIVER) \
193                 CONFIG_EDK2_GOP_FILE=$(CONFIG_EDK2_GOP_FILE) \
194                 CONFIG_INTEL_GMA_VBT_FILE=$(CONFIG_INTEL_GMA_VBT_FILE) \
195                 CONFIG_EDK2_DISABLE_TPM=$(CONFIG_EDK2_DISABLE_TPM) \
196                 GCC_CC_x86_32=$(GCC_CC_x86_32) \
197                 GCC_CC_x86_64=$(GCC_CC_x86_64) \
198                 GCC_CC_arm=$(GCC_CC_arm) \
199                 GCC_CC_arm64=$(GCC_CC_arm64) \
200                 OBJCOPY_x86_32=$(OBJCOPY_x86_32) \
201                 OBJCOPY_x86_64=$(OBJCOPY_x86_64) \
202                 OBJCOPY_arm=$(OBJCOPY_arm) \
203                 OBJCOPY_arm64=$(OBJCOPY_arm64) \
204                 MFLAGS= MAKEFLAGS=
206 $(obj)/ShimmedUniversalPayload.elf: $(DOTCONFIG)
207         $(MAKE) -C payloads/external/edk2 UniversalPayload \
208                 HOSTCC="$(HOSTCC)" \
209                 CC="$(HOSTCC)" \
210                 CONFIG_EDK2_REPOSITORY=$(CONFIG_EDK2_REPOSITORY) \
211                 CONFIG_EDK2_TAG_OR_REV=$(CONFIG_EDK2_TAG_OR_REV) \
212                 CONFIG_EDK2_UEFIPAYLOAD=$(CONFIG_EDK2_UEFIPAYLOAD) \
213                 CONFIG_EDK2_UNIVERSAL_PAYLOAD=$(CONFIG_EDK2_UNIVERSAL_PAYLOAD) \
214                 CONFIG_EDK2_REPO_OFFICIAL=$(CONFIG_EDK2_REPO_OFFICIAL) \
215                 CONFIG_EDK2_REPO_MRCHROMEBOX=$(CONFIG_EDK2_REPO_MRCHROMEBOX) \
216                 CONFIG_EDK2_REPO_CUSTOM=$(CONFIG_EDK2_REPO_CUSTOM) \
217                 CONFIG_EDK2_CPU_TIMER_LIB=$(CONFIG_EDK2_CPU_TIMER_LIB) \
218                 CONFIG_EDK2_CUSTOM_BUILD_PARAMS=$(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) \
219                 CONFIG_EDK2_DEBUG=$(CONFIG_EDK2_DEBUG) \
220                 CONFIG_EDK2_RELEASE=$(CONFIG_EDK2_RELEASE) \
221                 CONFIG_EDK2_BOOTSPLASH_FILE=$(CONFIG_EDK2_BOOTSPLASH_FILE) \
222                 CONFIG_EDK2_BOOT_MANAGER_ESCAPE=$(CONFIG_EDK2_BOOT_MANAGER_ESCAPE) \
223                 CONFIG_EDK2_BOOT_TIMEOUT=$(CONFIG_EDK2_BOOT_TIMEOUT) \
224                 CONFIG_EDK2_CBMEM_LOGGING=$(CONFIG_EDK2_CBMEM_LOGGING) \
225                 CONFIG_EDK2_FOLLOW_BGRT_SPEC=$(CONFIG_EDK2_FOLLOW_BGRT_SPEC) \
226                 CONFIG_EDK2_FULL_SCREEN_SETUP=$(CONFIG_EDK2_FULL_SCREEN_SETUP) \
227                 CONFIG_EDK2_HAVE_EFI_SHELL=$(CONFIG_EDK2_HAVE_EFI_SHELL) \
228                 CONFIG_EDK2_PRIORITIZE_INTERNAL=$(CONFIG_EDK2_PRIORITIZE_INTERNAL) \
229                 CONFIG_EDK2_PS2_SUPPORT=$(CONFIG_EDK2_PS2_SUPPORT) \
230                 CONFIG_EDK2_SERIAL_SUPPORT=$(CONFIG_EDK2_SERIAL_SUPPORT) \
231                 CONFIG_EDK2_SD_MMC_TIMEOUT=$(CONFIG_EDK2_SD_MMC_TIMEOUT) \
232                 CONFIG_EDK2_UNIVERSAL_PAYLOAD=$(CONFIG_EDK2_UNIVERSAL_PAYLOAD) \
233                 CONFIG_ECAM_MMCONF_BASE_ADDRESS=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) \
234                 CONFIG_ECAM_MMCONF_LENGTH=$(CONFIG_ECAM_MMCONF_LENGTH) \
235                 CONFIG_CPU_XTAL_HZ=$(CONFIG_CPU_XTAL_HZ) \
236                 CONFIG_SMMSTORE_V2=$(CONFIG_SMMSTORE_V2) \
237                 GCC_CC_x86_32=$(GCC_CC_x86_32) \
238                 GCC_CC_x86_64=$(GCC_CC_x86_64) \
239                 GCC_CC_arm=$(GCC_CC_arm) \
240                 GCC_CC_arm64=$(GCC_CC_arm64) \
241                 OBJCOPY_x86_32=$(OBJCOPY_x86_32) \
242                 OBJCOPY_x86_64=$(OBJCOPY_x86_64) \
243                 OBJCOPY_arm=$(OBJCOPY_arm) \
244                 OBJCOPY_arm64=$(OBJCOPY_arm64) \
245                 MFLAGS= MAKEFLAGS=
247 # FILO
249 filo:
250         $(MAKE) -C payloads/external/FILO \
251                         HOSTCC="$(HOSTCC)" \
252                         CC="$(CC_x86_32)" LD="$(LD_x86_32)" OBJDUMP="$(OBJDUMP_x86_32)" \
253                         OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \
254                         CONFIG_FILO_MASTER=$(CONFIG_FILO_MASTER) \
255                         CONFIG_FILO_STABLE=$(CONFIG_FILO_STABLE) \
256                         CONFIG_FILO_USE_AUTOBOOT=$(CONFIG_FILO_USE_AUTOBOOT) \
257                         CONFIG_FILO_AUTOBOOT_FILE=$(CONFIG_FILO_AUTOBOOT_FILE) \
258                         CONFIG_FILO_AUTOBOOT_DELAY=$(CONFIG_FILO_AUTOBOOT_DELAY)
260 payloads/external/FILO/filo/build/filo.elf: filo
261 payloads/external/FILO/filo/.config: filo
262 payloads/external/FILO/filo/build/version.h: filo
264 # Grub
266 GRUB_TARGET_PATH=payloads/external/GRUB2/grub2/build/default_payload.elf
268 cbfs-files-$(CONFIG_GRUB2_SECONDARY_PAYLOAD) += img/grub2
269 img/grub2-file := $(GRUB_TARGET_PATH)
270 img/grub2-type := payload
271 img/grub2-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
273 grub2: $(obj)/config.h
274         $(MAKE) -C payloads/external/GRUB2 \
275                         HOSTCC="$(HOSTCC)" \
276                         CC="$(CC_x86_32)" LD="$(LD_x86_32)" \
277                         OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \
278                         CONFIG_DEP="$(abspath $(obj)/config.h)" \
279                         CONFIG_GRUB2_STABLE=$(CONFIG_GRUB2_STABLE) \
280                         CONFIG_GRUB2_MASTER=$(CONFIG_GRUB2_MASTER) \
281                         CONFIG_GRUB2_REVISION=$(CONFIG_GRUB2_REVISION) \
282                         CONFIG_GRUB2_REVISION_ID=$(CONFIG_GRUB2_REVISION_ID) \
283                         CONFIG_GRUB2_EXTRA_MODULES=$(CONFIG_GRUB2_EXTRA_MODULES)
285 $(GRUB_TARGET_PATH): grub2
287 # U-Boot
289 payloads/external/U-Boot/build/u-boot.bin u-boot: $(DOTCONFIG)
290         $(MAKE) -C payloads/external/U-Boot \
291                         STABLE_COMMIT_ID=$(CONFIG_UBOOT_STABLE_COMMIT_ID) \
292                         CONFIG_UBOOT_MASTER=$(CONFIG_UBOOT_MASTER) \
293                         CONFIG_UBOOT_STABLE=$(CONFIG_UBOOT_STABLE)
295 # TINT
297 payloads/external/tint/tint/tint.elf tint:
298         $(MAKE) -C payloads/external/tint
300 cbfs-files-$(CONFIG_TINT_SECONDARY_PAYLOAD) += img/tint
301 img/tint-file := payloads/external/tint/tint/tint.elf
302 img/tint-type := payload
303 img/tint-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
305 # Memtest86+
307 ifeq ($(CONFIG_MEMTEST86PLUS_V6),y)
308 memtest_dir:=memtest86plus_v6
309 else
310 memtest_dir:=memtest86plus_v5
311 endif
313 cbfs-files-$(CONFIG_MEMTEST_SECONDARY_PAYLOAD) += img/memtest
314 img/memtest-file := payloads/external/Memtest86Plus/$(memtest_dir)/memtest
315 img/memtest-type := payload
316 img/memtest-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
318 ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO),yy)
319         MEMTEST_SERIAL_OPTIONS=SERIAL_CONSOLE_DEFAULT=1 \
320                 SERIAL_TTY=$(CONFIG_UART_FOR_CONSOLE) \
321                 SERIAL_BAUD_RATE=$(CONFIG_TTYS0_BAUD)
322 endif
324 payloads/external/Memtest86Plus/$(memtest_dir)/memtest: $(DOTCONFIG)
325         $(MAKE) -C payloads/external/Memtest86Plus all \
326                 CC="$(CC_x86_32)" \
327                 LD="$(LD_x86_32)" \
328                 OBJCOPY="$(OBJCOPY_x86_32)" \
329                 AS="$(AS_x86_32)" \
330                 CONFIG_MEMTEST_REVISION=$(CONFIG_MEMTEST_REVISION) \
331                 CONFIG_MEMTEST_REVISION_ID=$(CONFIG_MEMTEST_REVISION_ID) \
332                 CONFIG_MEMTEST_MAIN=$(CONFIG_MEMTEST_MAIN) \
333                 CONFIG_MEMTEST_STABLE=$(CONFIG_MEMTEST_STABLE) \
334                 CONFIG_MEMTEST86PLUS_V5=$(CONFIG_MEMTEST86PLUS_V5) \
335                 CONFIG_MEMTEST86PLUS_V6=$(CONFIG_MEMTEST86PLUS_V6) \
336                 $(MEMTEST_SERIAL_OPTIONS) \
337                 MFLAGS= MAKEFLAGS=
339 # iPXE
341 PXE_ROM_PCI_ID:=$(subst $(comma),,$(CONFIG_PXE_ROM_ID))
343 ifeq ($(CONFIG_PXE_ROM),y)
344 PXE_ROM_FILE:=$(CONFIG_PXE_ROM_FILE)
345 endif
346 ifeq ($(CONFIG_BUILD_IPXE),y)
347 PXE_ROM_FILE:=payloads/external/iPXE/ipxe/ipxe.rom
348 endif
349 ifeq ($(CONFIG_IPXE_ADD_SCRIPT),y)
350 IPXE_CONFIG_SCRIPT:=$(abspath $(patsubst "%",%,$(CONFIG_IPXE_SCRIPT)))
351 endif
352 ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO),yy)
353 IPXE_UART=COM$(call int-add,$(CONFIG_UART_FOR_CONSOLE) 1)
354 endif
356 ifeq ($(CONFIG_IPXE_SERIAL_CONSOLE),y)
357 IPXE_SERIAL_CONSOLE = $(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO)
358 else
359 IPXE_SERIAL_CONSOLE = n
360 endif
362 cbfs-files-$(CONFIG_PXE_ROM)$(CONFIG_BUILD_IPXE) += pci$(CONFIG_PXE_ROM_ID).rom
363 pci$(CONFIG_PXE_ROM_ID).rom-file := $(PXE_ROM_FILE)
364 pci$(CONFIG_PXE_ROM_ID).rom-type := raw
366 payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) $(IPXE_CONFIG_SCRIPT)
367         $(MAKE) -C payloads/external/iPXE all \
368         CROSS_COMPILE="$(CROSS_COMPILE_$(ARCH-ramstage-y))" \
369         PXE_ROM_PCI_ID=$(PXE_ROM_PCI_ID) \
370         CONFIG_IPXE_MASTER=$(CONFIG_IPXE_MASTER) \
371         CONFIG_IPXE_STABLE=$(CONFIG_IPXE_STABLE) \
372         CONSOLE_SERIAL=$(IPXE_SERIAL_CONSOLE) \
373         IPXE_UART=$(IPXE_UART) \
374         CONFIG_TTYS0_BAUD=$(CONFIG_TTYS0_BAUD) \
375         CONFIG_SCRIPT=$(IPXE_CONFIG_SCRIPT) \
376         CONFIG_HAS_SCRIPT=$(CONFIG_IPXE_ADD_SCRIPT) \
377         CONFIG_IPXE_NO_PROMPT=$(CONFIG_IPXE_NO_PROMPT) \
378         CONFIG_IPXE_HAS_HTTPS=$(CONFIG_IPXE_HAS_HTTPS) \
379         MFLAGS= MAKEFLAGS=
381 # LinuxBoot
382 LINUXBOOT_CROSS_COMPILE_ARCH-$(CONFIG_LINUXBOOT_X86)        = x86_32
383 LINUXBOOT_CROSS_COMPILE_ARCH-$(CONFIG_LINUXBOOT_X86_64)     = x86_64
384 LINUXBOOT_CROSS_COMPILE_ARCH-$(CONFIG_LINUXBOOT_ARM)        = arm
385 LINUXBOOT_CROSS_COMPILE_ARCH-$(CONFIG_LINUXBOOT_ARM64)      = arm64
386 LINUXBOOT_CROSS_COMPILE_ARCH-$(CONFIG_LINUXBOOT_RISCV_RV32) = riscv
387 LINUXBOOT_CROSS_COMPILE_ARCH-$(CONFIG_LINUXBOOT_RISCV_RV64) = riscv
388 ifeq ($(CONFIG_LINUXBOOT_CROSS_COMPILE),"")
389         CONFIG_LINUXBOOT_CROSS_COMPILE=$(CROSS_COMPILE_$(LINUXBOOT_CROSS_COMPILE_ARCH-y))
390 endif
391 .PHONY: linuxboot
392 payloads/external/LinuxBoot/build/Image linuxboot:
393         $(MAKE) -C payloads/external/LinuxBoot \
394                 CPUS=$(CPUS) \
395                 CONFIG_LINUXBOOT_X86_64=$(CONFIG_LINUXBOOT_X86_64) \
396                 CONFIG_LINUXBOOT_X86=$(CONFIG_LINUXBOOT_X86) \
397                 CONFIG_LINUXBOOT_ARM=$(CONFIG_LINUXBOOT_ARM) \
398                 CONFIG_LINUXBOOT_ARM64=$(CONFIG_LINUXBOOT_ARM64) \
399                 CONFIG_LINUXBOOT_RISCV_RV32=$(CONFIG_LINUXBOOT_RISCV_RV32) \
400                 CONFIG_LINUXBOOT_RISCV_RV64=$(CONFIG_LINUXBOOT_RISCV_RV64) \
401                 CONFIG_LINUXBOOT_CROSS_COMPILE=$(CONFIG_LINUXBOOT_CROSS_COMPILE) \
402                 CONFIG_LINUXBOOT_BUILD_INITRAMFS=$(CONFIG_LINUXBOOT_BUILD_INITRAMFS) \
403                 CONFIG_LINUXBOOT_INITRAMFS_PATH=$(CONFIG_LINUXBOOT_INITRAMFS_PATH) \
404                 CONFIG_LINUXBOOT_INITRAMFS_SUFFIX=$(CONFIG_LINUXBOOT_INITRAMFS_SUFFIX) \
405                 CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ=$(CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ) \
406                 CONFIG_LINUXBOOT_COMPILE_KERNEL=$(CONFIG_LINUXBOOT_COMPILE_KERNEL) \
407                 CONFIG_LINUXBOOT_KERNEL_PATH=$(CONFIG_LINUXBOOT_KERNEL_PATH) \
408                 CONFIG_LINUXBOOT_KERNEL_VERSION=$(CONFIG_LINUXBOOT_KERNEL_VERSION) \
409                 CONFIG_LINUXBOOT_KERNEL_BZIMAGE=$(CONFIG_LINUXBOOT_KERNEL_BZIMAGE) \
410                 CONFIG_LINUXBOOT_KERNEL_UIMAGE=$(CONFIG_LINUXBOOT_KERNEL_UIMAGE) \
411                 CONFIG_LINUXBOOT_KERNEL_CONFIGFILE=$(CONFIG_LINUXBOOT_KERNEL_CONFIGFILE) \
412                 CONFIG_LINUXBOOT_UROOT=$(CONFIG_LINUXBOOT_UROOT) \
413                 CONFIG_LINUXBOOT_UROOT_VERSION=$(CONFIG_LINUXBOOT_UROOT_VERSION) \
414                 CONFIG_LINUXBOOT_UROOT_FORMAT=$(CONFIG_LINUXBOOT_UROOT_FORMAT) \
415                 CONFIG_LINUXBOOT_UROOT_INITCMD=$(CONFIG_LINUXBOOT_UROOT_INITCMD) \
416                 CONFIG_LINUXBOOT_UROOT_UINITCMD=$(CONFIG_LINUXBOOT_UROOT_UINITCMD) \
417                 CONFIG_LINUXBOOT_UROOT_SHELL=$(CONFIG_LINUXBOOT_UROOT_SHELL) \
418                 CONFIG_LINUXBOOT_UROOT_COMMANDS=$(CONFIG_LINUXBOOT_UROOT_COMMANDS) \
419                 CONFIG_LINUXBOOT_UROOT_FILES=$(CONFIG_LINUXBOOT_UROOT_FILES) \
420                 CONFIG_LINUXBOOT_DTS_FILE=$(CONFIG_LINUXBOOT_DTS_FILE)
422 # BOOTBOOT
424 payloads/external/BOOTBOOT/bootboot/dist/bootbootcb.elf:
425         $(MAKE) -C payloads/external/BOOTBOOT all
427 # skiboot
429 payloads/external/skiboot/build/skiboot.elf:
430         $(MAKE) -C payloads/external/skiboot all \
431                 CONFIG_SKIBOOT_GIT_REPO=$(CONFIG_SKIBOOT_GIT_REPO) \
432                 CONFIG_SKIBOOT_REVISION=$(CONFIG_SKIBOOT_REVISION)
433 # COREDOOM
435 payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf coredoom:
436         $(MAKE) -C payloads/external/coreDOOM
438 cbfs-files-$(CONFIG_COREDOOM_SECONDARY_PAYLOAD) += img/coreDOOM
439 img/coreDOOM-file := payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf
440 img/coreDOOM-type := payload
441 img/coreDOOM-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
442 # WAD file
443 ifneq ($(strip $(CONFIG_COREDOOM_WAD_FILE)),)
444 cbfs-files-y += doom.wad
445 doom.wad-file := $(strip $(CONFIG_COREDOOM_WAD_FILE))
446 doom.wad-type := raw
447 doom.wad-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
448 endif