1 ## SPDX-License-Identifier: GPL-2.0-only
6 subdirs-
$(CONFIG_HAVE_SMI_HANDLER
) += smm
7 subdirs-
$(CONFIG_UDELAY_TSC
) += tsc
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
12 subdirs-
$(CONFIG_PARALLEL_MP
) += name
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
17 sed
-i
's/##START32_OFFSET##/0x'$$($(NM_smmstub
) -an
$(obj
)/smmstub
/smmstub.elf | grep smm_trampolin | cut
-d
' ' -f1
)'/' $@.temp
20 $(obj
)/ramstage
/cpu
/x86
/smm_start32_offset.h
: $(dir)/smm_start32_offset.h.template
22 sed
-i
's/##START32_OFFSET##/0x0/' $@.temp
26 $(call src-to-obj
,ramstage
,$(dir)/mp_init.c
): $(obj
)/ramstage
/cpu
/x86
/smm_start32_offset.h
27 ramstage-
$(CONFIG_PARALLEL_MP
) += mp_init.c
29 ramstage-y
+= backup_default_smm.c
30 ramstage-y
+= smi_trigger.c
31 smm-y
+= smi_trigger.c
33 subdirs-
$(CONFIG_CPU_INTEL_COMMON_SMM
) += ..
/intel
/smm
35 bootblock-y
+= entry32.S
36 bootblock-y
+= entry16.S
37 bootblock-y
+= reset16.S
39 additional-dirs
+= $(obj
)/cpu
/x86
41 SIPI_ELF
=$(obj
)/cpu
/x86
/sipi_vector.elf
42 SIPI_RMOD
=$(SIPI_ELF
).rmod
43 SIPI_BIN
=$(SIPI_ELF
:.elf
=)
44 SIPI_DOTO
=$(SIPI_ELF
:.elf
=.o
)
46 ifeq ($(CONFIG_HAVE_RAMSTAGE
),y
)
48 else ifeq ($(CONFIG_RAMPAYLOAD
),y
)
51 $(error Halting the build due to unknown TARGET_STAGE select
)
54 ifeq ($(CONFIG_PARALLEL_MP
),y
)
55 $(TARGET_STAGE
)-srcs
+= $(SIPI_BIN
).manual
57 rmodules_
$(ARCH-
$(TARGET_STAGE
)-y
)-$(CONFIG_PARALLEL_MP
) += sipi_vector.S
59 $(SIPI_DOTO
): $(call src-to-obj
,rmodules_
$(ARCH-
$(TARGET_STAGE
)-y
),src
/cpu
/x86
/sipi_vector.S
)
60 $(LD_rmodules_
$(ARCH-
$(TARGET_STAGE
)-y
)) -nostdlib
-r
-o
$@
$^
62 $(eval
$(call rmodule_link
,$(SIPI_ELF
), $(SIPI_DOTO
),$(ARCH-
$(TARGET_STAGE
)-y
)))
64 $(SIPI_BIN
): $(SIPI_RMOD
)
65 $(OBJCOPY_
$(TARGET_STAGE
)) -O binary
$< $@
67 $(call src-to-obj
,$(TARGET_STAGE
),$(SIPI_BIN
).manual
): $(SIPI_BIN
)
68 @printf
" OBJCOPY $(subst $(obj)/,,$(@))\n"
69 cd
$(dir $<); $(OBJCOPY_rmodules_
$(ARCH-
$(TARGET_STAGE
)-y
)) -I binary
$(notdir $<) $(target-objcopy
) $(abspath
$@
)
71 ramstage-y
+= topology.c