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