Felix Held | 39789eb | 2021-10-23 00:45:40 +0200 | [diff] [blame] | 1 | subdirs-y += lapic |
Felix Held | 2d4986c | 2021-10-22 22:07:43 +0200 | [diff] [blame] | 2 | subdirs-y += mtrr |
Aaron Durbin | 7f5e734 | 2018-04-17 10:55:14 -0600 | [diff] [blame] | 3 | subdirs-y += pae |
Arthur Heymans | 6419cd3 | 2020-10-14 11:35:51 +0200 | [diff] [blame] | 4 | subdirs-$(CONFIG_HAVE_SMI_HANDLER) += smm |
Angel Pons | 44985ae75 | 2021-09-07 11:39:26 +0200 | [diff] [blame] | 5 | subdirs-$(CONFIG_UDELAY_TSC) += tsc |
Arthur Heymans | 34f5cd9 | 2022-04-21 12:00:21 +0200 | [diff] [blame] | 6 | # Use ARCH_BOOTBLOCK_X86_64 as a proxy for knowing if 64bit is going to be used |
| 7 | subdirs-$(CONFIG_ARCH_BOOTBLOCK_X86_64) += 64bit |
Arthur Heymans | 3134a81 | 2019-11-25 12:20:01 +0100 | [diff] [blame^] | 8 | subdirs-y += cache |
Patrick Rudolph | 7a35949 | 2020-11-30 15:56:59 +0100 | [diff] [blame] | 9 | |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 10 | subdirs-$(CONFIG_PARALLEL_MP) += name |
| 11 | ramstage-$(CONFIG_PARALLEL_MP) += mp_init.c |
Arthur Heymans | 16fa339 | 2021-12-06 12:21:33 +0100 | [diff] [blame] | 12 | |
Aaron Durbin | d87c7bc | 2016-04-30 15:14:18 -0500 | [diff] [blame] | 13 | ramstage-y += backup_default_smm.c |
Arthur Heymans | 16fa339 | 2021-12-06 12:21:33 +0100 | [diff] [blame] | 14 | ramstage-y += smi_trigger.c |
| 15 | smm-y += smi_trigger.c |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 16 | |
Kyösti Mälkki | f5c0d61 | 2019-08-14 13:02:41 +0300 | [diff] [blame] | 17 | subdirs-$(CONFIG_CPU_INTEL_COMMON_SMM) += ../intel/smm |
| 18 | |
Kyösti Mälkki | 47d58e5 | 2020-11-22 00:55:31 +0200 | [diff] [blame] | 19 | bootblock-y += entry32.S |
Kyösti Mälkki | 0308313 | 2020-11-22 00:34:13 +0200 | [diff] [blame] | 20 | bootblock-y += entry16.S |
Kyösti Mälkki | 404c0c4 | 2020-11-22 00:47:04 +0200 | [diff] [blame] | 21 | bootblock-y += reset16.S |
Kyösti Mälkki | 0308313 | 2020-11-22 00:34:13 +0200 | [diff] [blame] | 22 | |
Nico Huber | 98fc426 | 2016-01-23 01:24:33 +0100 | [diff] [blame] | 23 | additional-dirs += $(obj)/cpu/x86 |
| 24 | |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 25 | SIPI_ELF=$(obj)/cpu/x86/sipi_vector.elf |
Aaron Durbin | 3eb8eb7 | 2014-03-10 16:13:58 -0500 | [diff] [blame] | 26 | SIPI_RMOD=$(SIPI_ELF).rmod |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 27 | SIPI_BIN=$(SIPI_ELF:.elf=) |
| 28 | SIPI_DOTO=$(SIPI_ELF:.elf=.o) |
| 29 | |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 30 | ifeq ($(CONFIG_HAVE_RAMSTAGE),y) |
| 31 | TARGET_STAGE=ramstage |
| 32 | else ifeq ($(CONFIG_RAMPAYLOAD),y) |
| 33 | TARGET_STAGE=postcar |
Stefan Reinauer | 181b773 | 2015-03-15 19:23:50 +0100 | [diff] [blame] | 34 | else |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 35 | $(error Halting the build due to unknown TARGET_STAGE select) |
Stefan Reinauer | 181b773 | 2015-03-15 19:23:50 +0100 | [diff] [blame] | 36 | endif |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 37 | |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 38 | ifeq ($(CONFIG_PARALLEL_MP),y) |
| 39 | $(TARGET_STAGE)-srcs += $(SIPI_BIN).manual |
| 40 | endif |
| 41 | rmodules_$(ARCH-$(TARGET_STAGE)-y)-$(CONFIG_PARALLEL_MP) += sipi_vector.S |
| 42 | |
| 43 | $(SIPI_DOTO): $(call src-to-obj,rmodules_$(ARCH-$(TARGET_STAGE)-y),src/cpu/x86/sipi_vector.S) |
Arthur Heymans | b49e210 | 2019-11-25 11:29:33 +0100 | [diff] [blame] | 44 | $(LD_rmodules_$(ARCH-$(TARGET_STAGE)-y)) -nostdlib -r -o $@ $^ |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 45 | |
| 46 | $(eval $(call rmodule_link,$(SIPI_ELF), $(SIPI_DOTO), 0,$(ARCH-$(TARGET_STAGE)-y))) |
| 47 | |
Aaron Durbin | 3eb8eb7 | 2014-03-10 16:13:58 -0500 | [diff] [blame] | 48 | $(SIPI_BIN): $(SIPI_RMOD) |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 49 | $(OBJCOPY_$(TARGET_STAGE)) -O binary $< $@ |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 50 | |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 51 | $(call src-to-obj,$(TARGET_STAGE),$(SIPI_BIN).manual): $(SIPI_BIN) |
Aaron Durbin | e0785c0 | 2013-10-21 12:15:29 -0500 | [diff] [blame] | 52 | @printf " OBJCOPY $(subst $(obj)/,,$(@))\n" |
Subrata Banik | b5962a9 | 2019-06-08 12:29:02 +0530 | [diff] [blame] | 53 | cd $(dir $<); $(OBJCOPY_rmodules_$(ARCH-$(TARGET_STAGE)-y)) -I binary $(notdir $<) $(target-objcopy) $(abspath $@) |