mb/google/brya/var/omnigul: Modify NVMe and UFS Storage support
[coreboot.git] / payloads / external / Makefile.inc
bloba2d2f505e238ae534d95eca95b41a88cb3d84b1f
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))),)
28 ifneq ($(CONFIG_LINUXBOOT_ARM64),y)
29       ADDITIONAL_PAYLOAD_CONFIG+=-I $(CONFIG_LINUX_INITRD)$(CONFIG_LINUXBOOT_INITRAMFS_SUFFIX)
30       prebuilt-files += $(strip $(call strip_quotes,$(CONFIG_LINUX_INITRD)))
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_REPO_OFFICIAL=$(CONFIG_EDK2_REPO_OFFICIAL) \
165                 CONFIG_EDK2_REPO_MRCHROMEBOX=$(CONFIG_EDK2_REPO_MRCHROMEBOX) \
166                 CONFIG_EDK2_REPO_CUSTOM=$(CONFIG_EDK2_REPO_CUSTOM) \
167                 CONFIG_EDK2_CPU_TIMER_LIB=$(CONFIG_EDK2_CPU_TIMER_LIB) \
168                 CONFIG_EDK2_CUSTOM_BUILD_PARAMS=$(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) \
169                 CONFIG_EDK2_DEBUG=$(CONFIG_EDK2_DEBUG) \
170                 CONFIG_EDK2_RELEASE=$(CONFIG_EDK2_RELEASE) \
171                 CONFIG_EDK2_VERBOSE_BUILD=$(CONFIG_EDK2_VERBOSE_BUILD) \
172                 CONFIG_EDK2_ABOVE_4G_MEMORY=$(CONFIG_EDK2_ABOVE_4G_MEMORY) \
173                 CONFIG_EDK2_BOOTSPLASH_FILE=$(CONFIG_EDK2_BOOTSPLASH_FILE) \
174                 CONFIG_EDK2_BOOT_MANAGER_ESCAPE=$(CONFIG_EDK2_BOOT_MANAGER_ESCAPE) \
175                 CONFIG_EDK2_BOOT_TIMEOUT=$(CONFIG_EDK2_BOOT_TIMEOUT) \
176                 CONFIG_EDK2_CBMEM_LOGGING=$(CONFIG_EDK2_CBMEM_LOGGING) \
177                 CONFIG_EDK2_FOLLOW_BGRT_SPEC=$(CONFIG_EDK2_FOLLOW_BGRT_SPEC) \
178                 CONFIG_EDK2_FULL_SCREEN_SETUP=$(CONFIG_EDK2_FULL_SCREEN_SETUP) \
179                 CONFIG_EDK2_HAVE_EFI_SHELL=$(CONFIG_EDK2_HAVE_EFI_SHELL) \
180                 CONFIG_EDK2_PRIORITIZE_INTERNAL=$(CONFIG_EDK2_PRIORITIZE_INTERNAL) \
181                 CONFIG_EDK2_PS2_SUPPORT=$(CONFIG_EDK2_PS2_SUPPORT) \
182                 CONFIG_EDK2_SERIAL_SUPPORT=$(CONFIG_EDK2_SERIAL_SUPPORT) \
183                 CONFIG_EDK2_SD_MMC_TIMEOUT=$(CONFIG_EDK2_SD_MMC_TIMEOUT) \
184                 CONFIG_ECAM_MMCONF_BASE_ADDRESS=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) \
185                 CONFIG_ECAM_MMCONF_LENGTH=$(CONFIG_ECAM_MMCONF_LENGTH) \
186                 CONFIG_CPU_XTAL_HZ=$(CONFIG_CPU_XTAL_HZ) \
187                 CONFIG_SMMSTORE_V2=$(CONFIG_SMMSTORE_v2) \
188                 GCC_CC_x86_32=$(GCC_CC_x86_32) \
189                 GCC_CC_x86_64=$(GCC_CC_x86_64) \
190                 GCC_CC_arm=$(GCC_CC_arm) \
191                 GCC_CC_arm64=$(GCC_CC_arm64) \
192                 OBJCOPY_x86_32=$(OBJCOPY_x86_32) \
193                 OBJCOPY_x86_64=$(OBJCOPY_x86_64) \
194                 OBJCOPY_arm=$(OBJCOPY_arm) \
195                 OBJCOPY_arm64=$(OBJCOPY_arm64) \
196                 MFLAGS= MAKEFLAGS=
198 $(obj)/ShimmedUniversalPayload.elf: $(DOTCONFIG)
199         $(MAKE) -C payloads/external/edk2 UniversalPayload \
200                 HOSTCC="$(HOSTCC)" \
201                 CC="$(HOSTCC)" \
202                 CONFIG_EDK2_REPOSITORY=$(CONFIG_EDK2_REPOSITORY) \
203                 CONFIG_EDK2_TAG_OR_REV=$(CONFIG_EDK2_TAG_OR_REV) \
204                 CONFIG_EDK2_UEFIPAYLOAD=$(CONFIG_EDK2_UEFIPAYLOAD) \
205                 CONFIG_EDK2_REPO_OFFICIAL=$(CONFIG_EDK2_REPO_OFFICIAL) \
206                 CONFIG_EDK2_REPO_MRCHROMEBOX=$(CONFIG_EDK2_REPO_MRCHROMEBOX) \
207                 CONFIG_EDK2_REPO_CUSTOM=$(CONFIG_EDK2_REPO_CUSTOM) \
208                 CONFIG_EDK2_CPU_TIMER_LIB=$(CONFIG_EDK2_CPU_TIMER_LIB) \
209                 CONFIG_EDK2_CUSTOM_BUILD_PARAMS=$(CONFIG_EDK2_CUSTOM_BUILD_PARAMS) \
210                 CONFIG_EDK2_DEBUG=$(CONFIG_EDK2_DEBUG) \
211                 CONFIG_EDK2_RELEASE=$(CONFIG_EDK2_RELEASE) \
212                 CONFIG_EDK2_ABOVE_4G_MEMORY=$(CONFIG_EDK2_ABOVE_4G_MEMORY) \
213                 CONFIG_EDK2_BOOTSPLASH_FILE=$(CONFIG_EDK2_BOOTSPLASH_FILE) \
214                 CONFIG_EDK2_BOOT_MANAGER_ESCAPE=$(CONFIG_EDK2_BOOT_MANAGER_ESCAPE) \
215                 CONFIG_EDK2_BOOT_TIMEOUT=$(CONFIG_EDK2_BOOT_TIMEOUT) \
216                 CONFIG_EDK2_CBMEM_LOGGING=$(CONFIG_EDK2_CBMEM_LOGGING) \
217                 CONFIG_EDK2_FOLLOW_BGRT_SPEC=$(CONFIG_EDK2_FOLLOW_BGRT_SPEC) \
218                 CONFIG_EDK2_FULL_SCREEN_SETUP=$(CONFIG_EDK2_FULL_SCREEN_SETUP) \
219                 CONFIG_EDK2_HAVE_EFI_SHELL=$(CONFIG_EDK2_HAVE_EFI_SHELL) \
220                 CONFIG_EDK2_PRIORITIZE_INTERNAL=$(CONFIG_EDK2_PRIORITIZE_INTERNAL) \
221                 CONFIG_EDK2_PS2_SUPPORT=$(CONFIG_EDK2_PS2_SUPPORT) \
222                 CONFIG_EDK2_SERIAL_SUPPORT=$(CONFIG_EDK2_SERIAL_SUPPORT) \
223                 CONFIG_EDK2_SD_MMC_TIMEOUT=$(CONFIG_EDK2_SD_MMC_TIMEOUT) \
224                 CONFIG_EDK2_UNIVERSAL_PAYLOAD=$(CONFIG_EDK2_UNIVERSAL_PAYLOAD) \
225                 CONFIG_ECAM_MMCONF_BASE_ADDRESS=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) \
226                 CONFIG_ECAM_MMCONF_LENGTH=$(CONFIG_ECAM_MMCONF_LENGTH) \
227                 CONFIG_CPU_XTAL_HZ=$(CONFIG_CPU_XTAL_HZ) \
228                 CONFIG_SMMSTORE_V2=$(CONFIG_SMMSTORE_v2) \
229                 GCC_CC_x86_32=$(GCC_CC_x86_32) \
230                 GCC_CC_x86_64=$(GCC_CC_x86_64) \
231                 GCC_CC_arm=$(GCC_CC_arm) \
232                 GCC_CC_arm64=$(GCC_CC_arm64) \
233                 OBJCOPY_x86_32=$(OBJCOPY_x86_32) \
234                 OBJCOPY_x86_64=$(OBJCOPY_x86_64) \
235                 OBJCOPY_arm=$(OBJCOPY_arm) \
236                 OBJCOPY_arm64=$(OBJCOPY_arm64) \
237                 MFLAGS= MAKEFLAGS=
239 # FILO
241 filo:
242         $(MAKE) -C payloads/external/FILO \
243                         HOSTCC="$(HOSTCC)" \
244                         CC="$(CC_x86_32)" LD="$(LD_x86_32)" OBJDUMP="$(OBJDUMP_x86_32)" \
245                         OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \
246                         CONFIG_FILO_MASTER=$(CONFIG_FILO_MASTER) \
247                         CONFIG_FILO_STABLE=$(CONFIG_FILO_STABLE) \
248                         CONFIG_FILO_USE_AUTOBOOT=$(CONFIG_FILO_USE_AUTOBOOT) \
249                         CONFIG_FILO_AUTOBOOT_FILE=$(CONFIG_FILO_AUTOBOOT_FILE) \
250                         CONFIG_FILO_AUTOBOOT_DELAY=$(CONFIG_FILO_AUTOBOOT_DELAY)
252 payloads/external/FILO/filo/build/filo.elf: filo
253 payloads/external/FILO/filo/.config: filo
254 payloads/external/FILO/filo/build/version.h: filo
256 # Grub
258 GRUB_TARGET_PATH=payloads/external/GRUB2/grub2/build/default_payload.elf
260 cbfs-files-$(CONFIG_GRUB2_SECONDARY_PAYLOAD) += img/grub2
261 img/grub2-file := $(GRUB_TARGET_PATH)
262 img/grub2-type := payload
263 img/grub2-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
265 grub2: $(obj)/config.h
266         $(MAKE) -C payloads/external/GRUB2 \
267                         HOSTCC="$(HOSTCC)" \
268                         CC="$(CC_x86_32)" LD="$(LD_x86_32)" \
269                         OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \
270                         CONFIG_DEP="$(abspath $(obj)/config.h)" \
271                         CONFIG_GRUB2_STABLE=$(CONFIG_GRUB2_STABLE) \
272                         CONFIG_GRUB2_MASTER=$(CONFIG_GRUB2_MASTER) \
273                         CONFIG_GRUB2_REVISION=$(CONFIG_GRUB2_REVISION) \
274                         CONFIG_GRUB2_REVISION_ID=$(CONFIG_GRUB2_REVISION_ID) \
275                         CONFIG_GRUB2_EXTRA_MODULES=$(CONFIG_GRUB2_EXTRA_MODULES)
277 $(GRUB_TARGET_PATH): grub2
279 # U-Boot
281 payloads/external/U-Boot/build/u-boot.bin u-boot: $(DOTCONFIG)
282         $(MAKE) -C payloads/external/U-Boot \
283                         STABLE_COMMIT_ID=$(CONFIG_UBOOT_STABLE_COMMIT_ID) \
284                         CONFIG_UBOOT_MASTER=$(CONFIG_UBOOT_MASTER) \
285                         CONFIG_UBOOT_STABLE=$(CONFIG_UBOOT_STABLE)
287 # TINT
289 payloads/external/tint/tint/tint.elf tint:
290         $(MAKE) -C payloads/external/tint
292 cbfs-files-$(CONFIG_TINT_SECONDARY_PAYLOAD) += img/tint
293 img/tint-file := payloads/external/tint/tint/tint.elf
294 img/tint-type := payload
295 img/tint-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
297 # Memtest86+
299 cbfs-files-$(CONFIG_MEMTEST_SECONDARY_PAYLOAD) += img/memtest
300 img/memtest-file := payloads/external/Memtest86Plus/memtest86plus/memtest
301 img/memtest-type := payload
302 img/memtest-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
304 ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO),yy)
305         MEMTEST_SERIAL_OPTIONS=SERIAL_CONSOLE_DEFAULT=1 \
306                 SERIAL_TTY=$(CONFIG_UART_FOR_CONSOLE) \
307                 SERIAL_BAUD_RATE=$(CONFIG_TTYS0_BAUD)
308 endif
310 payloads/external/Memtest86Plus/memtest86plus/memtest: $(DOTCONFIG)
311         $(MAKE) -C payloads/external/Memtest86Plus all \
312                 CC="$(CC_x86_32)" \
313                 LD="$(LD_x86_32)" \
314                 OBJCOPY="$(OBJCOPY_x86_32)" \
315                 AS="$(AS_x86_32)" \
316                 CONFIG_MEMTEST_REVISION=$(CONFIG_MEMTEST_REVISION) \
317                 CONFIG_MEMTEST_REVISION_ID=$(CONFIG_MEMTEST_REVISION_ID) \
318                 CONFIG_MEMTEST_MASTER=$(CONFIG_MEMTEST_MASTER) \
319                 CONFIG_MEMTEST_STABLE=$(CONFIG_MEMTEST_STABLE) \
320                 $(MEMTEST_SERIAL_OPTIONS) \
321                 MFLAGS= MAKEFLAGS=
323 # iPXE
325 PXE_ROM_PCI_ID:=$(subst $(comma),,$(CONFIG_PXE_ROM_ID))
327 ifeq ($(CONFIG_PXE_ROM),y)
328 PXE_ROM_FILE:=$(CONFIG_PXE_ROM_FILE)
329 endif
330 ifeq ($(CONFIG_BUILD_IPXE),y)
331 PXE_ROM_FILE:=payloads/external/iPXE/ipxe/ipxe.rom
332 endif
333 ifeq ($(CONFIG_PXE_ADD_SCRIPT),y)
334 PXE_CONFIG_SCRIPT:=$(abspath $(patsubst "%",%,$(CONFIG_PXE_SCRIPT)))
335 endif
336 ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO),yy)
337 IPXE_UART=COM$(call int-add,$(CONFIG_UART_FOR_CONSOLE) 1)
338 endif
340 ifeq ($(CONFIG_PXE_SERIAL_CONSOLE),y)
341 IPXE_SERIAL_CONSOLE = $(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO)
342 else
343 IPXE_SERIAL_CONSOLE = n
344 endif
346 cbfs-files-$(CONFIG_PXE_ROM)$(CONFIG_BUILD_IPXE) += pci$(CONFIG_PXE_ROM_ID).rom
347 pci$(CONFIG_PXE_ROM_ID).rom-file := $(PXE_ROM_FILE)
348 pci$(CONFIG_PXE_ROM_ID).rom-type := raw
350 payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) $(PXE_CONFIG_SCRIPT)
351         $(MAKE) -C payloads/external/iPXE all \
352         CROSS_COMPILE="$(CROSS_COMPILE_$(ARCH-ramstage-y))" \
353         PXE_ROM_PCI_ID=$(PXE_ROM_PCI_ID) \
354         CONFIG_IPXE_MASTER=$(CONFIG_IPXE_MASTER) \
355         CONFIG_IPXE_STABLE=$(CONFIG_IPXE_STABLE) \
356         CONSOLE_SERIAL=$(IPXE_SERIAL_CONSOLE) \
357         IPXE_UART=$(IPXE_UART) \
358         CONFIG_TTYS0_BAUD=$(CONFIG_TTYS0_BAUD) \
359         CONFIG_SCRIPT=$(PXE_CONFIG_SCRIPT) \
360         CONFIG_HAS_SCRIPT=$(CONFIG_PXE_ADD_SCRIPT) \
361         CONFIG_PXE_NO_PROMPT=$(CONFIG_PXE_NO_PROMPT) \
362         CONFIG_PXE_HAS_HTTPS=$(CONFIG_PXE_HAS_HTTPS) \
363         MFLAGS= MAKEFLAGS=
365 # LinuxBoot
367 linuxboot:
368         $(MAKE) -C payloads/external/LinuxBoot \
369                 CPUS=$(CPUS) \
370                 CONFIG_LINUXBOOT_X86_64=$(CONFIG_LINUXBOOT_X86_64) \
371                 CONFIG_LINUXBOOT_X86=$(CONFIG_LINUXBOOT_X86) \
372                 CONFIG_LINUXBOOT_ARM64=$(CONFIG_LINUXBOOT_ARM64) \
373                 CONFIG_LINUXBOOT_KERNEL=$(CONFIG_PAYLOAD_FILE) \
374                 CONFIG_LINUXBOOT_INITRAMFS=$(CONFIG_LINUX_INITRD) \
375                 CONFIG_LINUXBOOT_INITRAMFS_SUFFIX=$(CONFIG_LINUXBOOT_INITRAMFS_SUFFIX) \
376                 CONFIG_LINUXBOOT_COMPILE_KERNEL=$(CONFIG_LINUXBOOT_COMPILE_KERNEL) \
377                 CONFIG_LINUXBOOT_BUILD_INITRAMFS=$(CONFIG_LINUXBOOT_BUILD_INITRAMFS) \
378                 CONFIG_LINUXBOOT_KERNEL_MAINLINE=$(CONFIG_LINUXBOOT_KERNEL_MAINLINE) \
379                 CONFIG_LINUXBOOT_KERNEL_STABLE=$(CONFIG_LINUXBOOT_KERNEL_STABLE) \
380                 CONFIG_LINUXBOOT_KERNEL_LONGTERM=$(CONFIG_LINUXBOOT_KERNEL_LONGTERM) \
381                 CONFIG_LINUXBOOT_KERNEL_CUSTOM=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM) \
382                 CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION) \
383                 CONFIG_LINUXBOOT_KERNEL_CUSTOM_CONFIG=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM_CONFIG) \
384                 CONFIG_LINUXBOOT_KERNEL_BZIMAGE=$(CONFIG_LINUXBOOT_KERNEL_BZIMAGE) \
385                 CONFIG_LINUXBOOT_KERNEL_UIMAGE=$(CONFIG_LINUXBOOT_KERNEL_UIMAGE) \
386                 CONFIG_LINUXBOOT_KERNEL_CONFIGFILE=$(CONFIG_LINUXBOOT_KERNEL_CONFIGFILE) \
387                 CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ=$(CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ) \
388                 CONFIG_LINUXBOOT_UROOT=$(CONFIG_LINUXBOOT_UROOT) \
389                 CONFIG_LINUXBOOT_UROOT_VERSION=$(CONFIG_LINUXBOOT_UROOT_VERSION) \
390                 CONFIG_LINUXBOOT_UROOT_FORMAT=$(CONFIG_LINUXBOOT_UROOT_FORMAT) \
391                 CONFIG_LINUXBOOT_UROOT_INITCMD=$(CONFIG_LINUXBOOT_UROOT_INITCMD) \
392                 CONFIG_LINUXBOOT_UROOT_UINITCMD=$(CONFIG_LINUXBOOT_UROOT_UINITCMD)\
393                 CONFIG_LINUXBOOT_UROOT_SHELL=$(CONFIG_LINUXBOOT_UROOT_SHELL) \
394                 CONFIG_LINUXBOOT_UROOT_COMMANDS=$(CONFIG_LINUXBOOT_UROOT_COMMANDS) \
395                 CONFIG_LINUXBOOT_UROOT_FILES=$(CONFIG_LINUXBOOT_UROOT_FILES) \
396                 CONFIG_LINUXBOOT_DTB_FILE=$(CONFIG_LINUXBOOT_DTB_FILE)
398 payloads/external/LinuxBoot/linuxboot/bzImage: linuxboot
399 payloads/external/LinuxBoot/linuxboot/uImage: linuxboot
400 payloads/external/LinuxBoot/linuxboot/initramfs_u-root.cpio: linuxboot
402 # Yabits
404 payloads/external/Yabits/uefi/build/uefi.elf yabits:
405         $(MAKE) -C payloads/external/Yabits all \
406                 XGCCPATH="$(XGCCPATH)" \
407                 CONFIG_YABITS_REVISION=$(CONFIG_YABITS_REVISION) \
408                 CONFIG_YABITS_REVISION_ID=$(CONFIG_YABITS_REVISION_ID) \
409                 CONFIG_YABITS_MASTER=$(CONFIG_YABITS_MASTER) \
410                 CONFIG_YABITS_STABLE=$(CONFIG_YABITS_STABLE) \
411                 MFLAGS= MAKEFLAGS=
413 # BOOTBOOT
415 payloads/external/BOOTBOOT/bootboot/dist/bootbootcb.elf:
416         $(MAKE) -C payloads/external/BOOTBOOT all
418 # skiboot
420 payloads/external/skiboot/build/skiboot.elf:
421         $(MAKE) -C payloads/external/skiboot all \
422                 CONFIG_SKIBOOT_GIT_REPO=$(CONFIG_SKIBOOT_GIT_REPO) \
423                 CONFIG_SKIBOOT_REVISION=$(CONFIG_SKIBOOT_REVISION)
424 # COREDOOM
426 payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf coredoom:
427         $(MAKE) -C payloads/external/coreDOOM
429 cbfs-files-$(CONFIG_COREDOOM_SECONDARY_PAYLOAD) += img/coreDOOM
430 img/coreDOOM-file := payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf
431 img/coreDOOM-type := payload
432 img/coreDOOM-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
433 # WAD file
434 ifneq ($(strip $(CONFIG_COREDOOM_WAD_FILE)),)
435 cbfs-files-y += doom.wad
436 doom.wad-file := $(strip $(CONFIG_COREDOOM_WAD_FILE))
437 doom.wad-type := raw
438 doom.wad-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
439 endif