blob: 6b71b4a0030cf6e7f072c90d481115984b99fda7 [file] [log] [blame]
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -05001################################################################################
Stefan Reinauer30584912010-08-14 20:38:17 +00002##
3## This file is part of the coreboot project.
4##
Alexandru Gagniuc00b579a2012-07-20 00:11:21 -05005## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
Stefan Reinauer30584912010-08-14 20:38:17 +00006## Copyright (C) 2009-2010 coresystems GmbH
7## Copyright (C) 2009 Ronald G. Minnich
8##
9## This program is free software; you can redistribute it and/or modify
10## it under the terms of the GNU General Public License as published by
11## the Free Software Foundation; version 2 of the License.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16## GNU General Public License for more details.
17##
18## You should have received a copy of the GNU General Public License
19## along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010020## Foundation, Inc.
Stefan Reinauer30584912010-08-14 20:38:17 +000021##
Patrick Georgi0588d192009-08-12 15:00:51 +000022
Patrick Georgi70a6b4f2015-03-27 14:14:58 +010023################################################################################
24# i386 specific tools
25NVRAMTOOL:=$(objutil)/nvramtool/nvramtool
26
Patrick Georgi8463dd92010-09-30 16:55:02 +000027OPTION_TABLE_H:=
28ifeq ($(CONFIG_HAVE_OPTION_TABLE),y)
Patrick Georgi70a6b4f2015-03-27 14:14:58 +010029
Patrick Georgi5c0bca22011-01-30 16:31:15 +000030cbfs-files-y += cmos_layout.bin
31cmos_layout.bin-file = $(obj)/cmos_layout.bin
32cmos_layout.bin-type = 0x01aa
Patrick Georgi24479372011-01-18 13:56:36 +000033
Patrick Georgi70a6b4f2015-03-27 14:14:58 +010034$(obj)/cmos_layout.bin: $(NVRAMTOOL) $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout
35 @printf " OPTION $(subst $(obj)/,,$(@))\n"
36 $(NVRAMTOOL) -y $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout -L $@
37
Patrick Georgi8463dd92010-09-30 16:55:02 +000038OPTION_TABLE_H:=$(obj)/option_table.h
Patrick Georgi70a6b4f2015-03-27 14:14:58 +010039
40$(OPTION_TABLE_H): $(NVRAMTOOL) $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout
41 @printf " OPTION $(subst $(obj)/,,$(@))\n"
42 $(NVRAMTOOL) -y $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout -H $@
43endif # CONFIG_HAVE_OPTION_TABLE
Patrick Georgi0588d192009-08-12 15:00:51 +000044
Patrick Georgiff9d78c2011-01-30 16:37:39 +000045stripped_vgabios_id = $(call strip_quotes,$(CONFIG_VGA_BIOS_ID))
46cbfs-files-$(CONFIG_VGA_BIOS) += pci$(stripped_vgabios_id).rom
47pci$(stripped_vgabios_id).rom-file := $(call strip_quotes,$(CONFIG_VGA_BIOS_FILE))
48pci$(stripped_vgabios_id).rom-type := optionrom
49
50cbfs-files-$(CONFIG_INTEL_MBI) += mbi.bin
51mbi.bin-file := $(call strip_quotes,$(CONFIG_MBI_FILE))
52mbi.bin-type := mbi
53
Stefan Reinauer181b7732015-03-15 19:23:50 +010054ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
Julius Wernerf780c402014-11-10 13:11:50 -080055CBFSTOOL_PRE1_OPTS = -m x86 -s $(CONFIG_ROM_SIZE) \
56 -o $$(( $(CONFIG_ROM_SIZE) - $(CONFIG_CBFS_SIZE) ))
Aaron Durbin294ce852015-09-15 17:04:13 -050057# Use a '-a 64' option to cbfstool locate to provide a minimum alignment
58# requirement for the overall romstage. While the first object within
59# romstage could have a 4 byte minimum alignment that doesn't mean the linker
60# won't decide the entire section should be aligned to a larger value. In the
61# future cbfstool should add XIP files proper and honor the alignment
62# requirements of the program segment.
63#
Furquan Shaikhb4ce4d42014-10-30 11:47:20 -070064# Make sure that segment for .car.data is ignored while adding romstage.
Aaron Durbin294ce852015-09-15 17:04:13 -050065CBFSTOOL_PRE_OPTS = -a 64 --xip -S ".car.data" -P $(CONFIG_XIP_ROM_SIZE)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070066endif
Patrick Georgiff9d78c2011-01-30 16:37:39 +000067
Martin Roth16bc7e82015-06-28 13:49:16 -060068## Calculate the base address of CBFS for later comparisons
69CBFS_BASE_ADDRESS=$(call int-add, $(call int-subtract, 0xffffffff $(CONFIG_CBFS_SIZE)) 1)
70
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070071###############################################################################
72# bootblock
73###############################################################################
Patrick Georgi641dd712011-11-01 18:55:59 +010074
Stefan Reinauer181b7732015-03-15 19:23:50 +010075ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32)$(CONFIG_ARCH_BOOTBLOCK_X86_64),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070076
Alexandru Gagniuc0017b002015-10-02 12:24:00 -070077# x86-specific linker flags
78ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32),y)
79LDFLAGS_bootblock += -m elf_i386 --oformat elf32-i386
80else
81LDFLAGS_bootblock += -m elf_x86_64 --oformat elf64-x86-64
82endif
83
Aaron Durbin3953e392015-09-03 00:41:29 -050084# Add the assembly file that pulls in the rest of the dependencies in
85# the right order. Make sure the auto generated bootblock.inc is a proper
86# dependency. Make the same true for the linker sript.
87bootblock-y += bootblock.S
88$(obj)/arch/x86/bootblock.bootblock.o: $(objgenerated)/bootblock.inc
Patrick Georgi641dd712011-11-01 18:55:59 +010089
Aaron Durbin3953e392015-09-03 00:41:29 -050090bootblock-y += bootblock.ld
91$(obj)/arch/x86/bootblock.bootblock.ld: $(objgenerated)/bootblock.ld
Patrick Georgi641dd712011-11-01 18:55:59 +010092
Patrick Georgi56b83092015-04-02 19:44:19 +020093bootblock_romccflags := -mcpu=i386 -O2 -D__PRE_RAM__ -D__BOOTBLOCK__
Patrick Georgi641dd712011-11-01 18:55:59 +010094ifeq ($(CONFIG_SSE),y)
Patrick Georgi56b83092015-04-02 19:44:19 +020095bootblock_romccflags := -mcpu=k7 -msse -O2 -D__PRE_RAM__ -D__BOOTBLOCK__
Patrick Georgi641dd712011-11-01 18:55:59 +010096endif
97
Aaron Durbin3953e392015-09-03 00:41:29 -050098# This is a hack in case there are no per chipset linker files.
99$(objgenerated)/empty:
100 touch $@
101
102$(objgenerated)/bootblock.ld: $$(filter-out $(obj)/arch/x86/bootblock.bootblock.ld, $$(filter %.ld,$$(bootblock-objs))) $(objgenerated)/empty
Patrick Georgi641dd712011-11-01 18:55:59 +0100103 @printf " GEN $(subst $(obj)/,,$(@))\n"
Marc Jonesac630f72015-06-30 15:46:49 -0600104 cat $^ >> $@.tmp
105 mv $@.tmp $@
Patrick Georgi641dd712011-11-01 18:55:59 +0100106
Patrick Georgief0158e2015-07-27 17:47:55 +0200107$(objgenerated)/bootblock.inc: $(src)/arch/x86/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(objutil)/romcc/romcc $(OPTION_TABLE_H) $(KCONFIG_AUTOHEADER)
Patrick Georgi641dd712011-11-01 18:55:59 +0100108 @printf " ROMCC $(subst $(obj)/,,$(@))\n"
Patrick Georgi59307742014-05-19 09:23:57 +0200109 $(CC_bootblock) $(CPPFLAGS_bootblock) -MM -MT$(objgenerated)/bootblock.inc \
Kyösti Mälkkif775b8c2012-04-19 12:14:53 +0300110 $< > $(objgenerated)/bootblock.inc.d
Patrick Georgi59307742014-05-19 09:23:57 +0200111 $(ROMCC) -c -S $(bootblock_romccflags) -I. $(CPPFLAGS_bootblock) $< -o $@
Patrick Georgi641dd712011-11-01 18:55:59 +0100112
Aaron Durbin3953e392015-09-03 00:41:29 -0500113$(objcbfs)/bootblock.debug: $(obj)/arch/x86/bootblock.bootblock.o $(obj)/arch/x86/bootblock.bootblock.ld
Patrick Georgi641dd712011-11-01 18:55:59 +0100114 @printf " LINK $(subst $(obj)/,,$(@))\n"
Alexandru Gagniuc0017b002015-10-02 12:24:00 -0700115 $(LD_bootblock) $(LDFLAGS_bootblock) -static -o $@ -L$(obj) $< \
116 -T $(obj)/arch/x86/bootblock.bootblock.ld
Patrick Georgi641dd712011-11-01 18:55:59 +0100117
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700118
Stefan Reinauer181b7732015-03-15 19:23:50 +0100119endif # CONFIG_ARCH_BOOTBLOCK_X86_32 / CONFIG_ARCH_BOOTBLOCK_X86_64
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700120
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700121###############################################################################
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500122# common support for early assembly includes
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700123###############################################################################
124
Aaron Durbine581b062015-09-03 11:29:28 -0500125# Chipset specific assembly stubs in the romstage program flow. Certain
126# boards have more than one assembly stub so collect those and put them
127# into a single generated file.
128crt0s = $(cpu_incs-y)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700129
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500130$(objgenerated)/assembly.inc: $$(crt0s)
Aaron Durbine581b062015-09-03 11:29:28 -0500131 @printf " GEN $(subst $(obj)/,,$(@))\n"
132 printf '$(foreach crt0,$(crt0s),#include "$(crt0)"\n)' > $@
133
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500134define early_x86_stage
135# $1 stage name
136# $2 oformat
137$(1)-y += memlayout.ld
Aaron Durbine581b062015-09-03 11:29:28 -0500138# Add the assembly file that pulls in the rest of the dependencies in
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500139# the right order. Make sure the auto generated assembly.inc is a proper
Aaron Durbine581b062015-09-03 11:29:28 -0500140# dependency.
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500141$(1)-y += assembly_entry.S
142$$(obj)/arch/x86/assembly_entry.$(1).o: $(objgenerated)/assembly.inc
143
144$$(objcbfs)/$(1).debug: $$$$($(1)-libs) $$$$($(1)-objs)
145 @printf " LINK $$(subst $$(obj)/,,$$(@))\n"
146 $$(LD_$(1)) $$(LDFLAGS_$(1)) -o $$@ -L$$(obj) $$(COMPILER_RT_FLAGS_$(1)) --whole-archive --start-group $$(filter-out %.ld,$$($(1)-objs)) $$($(1)-libs) --no-whole-archive $$(COMPILER_RT_$(1)) --end-group -T $$(obj)/arch/x86/memlayout.$(1).ld --oformat $(2)
147 LANG=C LC_ALL= $$(OBJCOPY_$(1)) --only-section .illegal_globals $$(@) $$(objcbfs)/$(1)_null.offenders 2>&1 | \
148 grep -v "Empty loadable segment detected" && \
149 $$(NM_$(1)) $$(objcbfs)/$(1)_null.offenders | grep -q ""; if [ $$$$? -eq 0 ]; then \
150 echo "Forbidden global variables in "$(1)":"; \
151 $$(NM_$(1)) $$(objcbfs)/$(1)_null.offenders; false; \
152 else true; fi
153endef
154
155###############################################################################
156# romstage
157###############################################################################
158
159ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700160
Aaron Durbin85982cd2015-09-03 11:01:17 -0500161ifneq ($(CONFIG_ROMCC),y)
162
163romstage-srcs += $(src)/mainboard/$(MAINBOARDDIR)/romstage.c
164
165else # CONFIG_ROMCC == y
166
167# This order matters. The mainboards requiring ROMCC need their mainboard
168# code to follow the prior crt0s files for program flow control. The
169# romstage.inc from the MAINBOARDDIR is implicitly main() for romstage
170# because of the instruction sequen fall-through.
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700171crt0s += $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc
Stefan Reinauer6cb3a592015-07-13 09:39:15 +0200172crt0s += $(src)/arch/x86/crt0_romcc_epilogue.inc
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700173
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700174ifeq ($(CONFIG_MMX),y)
175 ifeq ($(CONFIG_SSE),y)
176 ROMCCFLAGS := -mcpu=p4 -O2 # MMX, SSE
177 else
178 ROMCCFLAGS := -mcpu=p2 -O2 # MMX, !SSE
179 endif
180else
181 ROMCCFLAGS := -mcpu=i386 -O2 # !MMX, !SSE
182endif
183
Patrick Georgi24cca752014-11-29 11:51:25 +0100184$(objcbfs)/romstage%.bin: $(objcbfs)/romstage%.elf
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700185 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
186 $(OBJCOPY_romstage) -O binary $< $@
187
Patrick Georgi24cca752014-11-29 11:51:25 +0100188$(objcbfs)/romstage%.elf: $(objcbfs)/romstage%.debug
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700189 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
190 cp $< $@.tmp
191 $(OBJCOPY_romstage) --strip-debug $@.tmp
192 $(OBJCOPY_romstage) --add-gnu-debuglink=$< $@.tmp
193 mv $@.tmp $@
194
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700195$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(objutil)/romcc/romcc $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
196 printf " ROMCC romstage.inc\n"
Patrick Georgi815f4bf2015-04-28 22:43:31 +0200197 $(ROMCC) -c -S $(ROMCCFLAGS) -D__ROMSTAGE__ -D__PRE_RAM__ -I. $(CPPFLAGS_romstage) $< -o $@
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700198
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700199endif
200
Alexandru Gagniuceb3c9912014-03-29 13:01:11 -0500201romstage-libs ?=
202
Stefan Reinauer98749332015-06-23 12:57:06 -0700203ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y)
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500204$(eval $(call early_x86_stage,romstage,elf32-i386))
Stefan Reinauer98749332015-06-23 12:57:06 -0700205else
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500206$(eval $(call early_x86_stage,romstage,elf64-x86-64))
Stefan Reinauer98749332015-06-23 12:57:06 -0700207endif
208
Patrick Georgid69839b2015-04-03 10:32:17 +0200209# Compiling crt0 with -g seems to trigger https://sourceware.org/bugzilla/show_bug.cgi?id=6428
210romstage-S-ccopts += -I. -g0
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700211
Stefan Reinauer181b7732015-03-15 19:23:50 +0100212endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
Stefan Reinauerf1939bb2010-12-30 17:39:50 +0000213
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700214###############################################################################
215# ramstage
216###############################################################################
217
Stefan Reinauer181b7732015-03-15 19:23:50 +0100218ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700219
Patrick Georgic32a52c2015-06-22 21:10:34 +0200220ifeq ($(CONFIG_COMPILE_IN_DSDT),y)
221ramstage-srcs += $(obj)/dsdt.aml
222
223ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
224target-objcopy=-O elf32-i386 -B i386
225endif
226ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_64),y)
227target-objcopy=-O elf64-x86_64 -B x86_64
228endif
229
230define ramstage-objs_aml_template
231$(call src-to-obj,ramstage,$(1).aml): $(1).aml
232 @printf " OBJCOPY $$(subst $$(obj)/,,$$(@))\n"
233 cd $$(dir $$@) && $$(OBJCOPY_ramstage) -I binary $$(target-objcopy) $$(notdir $$<) $$(notdir $$@)
234endef
235endif
236
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700237ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
238ifeq ($(CONFIG_GENERATE_MP_TABLE),y)
239ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/mptable.c),)
240ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mptable.c
241endif
242endif
243ifeq ($(CONFIG_GENERATE_PIRQ_TABLE),y)
244ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/irq_tables.c
245endif
246ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/reset.c),)
247ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/reset.c
248endif
Vladimir Serbinenko822bc652014-01-03 15:55:40 +0100249ifeq ($(CONFIG_HAVE_ACPI_TABLES),y)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700250ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/acpi_tables.c
Aaron Durbinab454c62015-07-30 12:44:58 -0500251ifeq ($(CONFIG_COMPILE_IN_DSDT),y)
252$(eval $(call asl_template,dsdt,n))
253else
Vladimir Serbinenko36f8d272015-05-31 12:31:59 +0200254$(eval $(call asl_template,dsdt))
Aaron Durbinab454c62015-07-30 12:44:58 -0500255endif
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700256ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/fadt.c),)
257ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/fadt.c
258endif
Patrick Georgi990e7c92015-04-03 10:47:15 +0200259endif # CONFIG_GENERATE_ACPI_TABLES
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700260ifeq ($(CONFIG_HAVE_SMI_HANDLER),y)
261ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/smihandler.c),)
262smm-srcs += src/mainboard/$(MAINBOARDDIR)/smihandler.c
263endif
264endif
265ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c),)
266ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c
267endif
268
269ramstage-libs ?=
270
271ifeq ($(CONFIG_RELOCATABLE_RAMSTAGE),y)
272
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700273# The rmodule_link defintion creates an elf file with .rmod extension.
274$(objcbfs)/ramstage.elf: $(objcbfs)/ramstage.debug.rmod
275 cp $< $@
276
Aaron Durbin83bc0db2015-09-06 10:45:18 -0500277endif
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700278
Aaron Durbin956c4f22015-09-05 13:31:14 -0500279ramstage-y += memlayout.ld
Patrick Georgi828e0e82015-04-04 15:50:20 +0200280
Aaron Durbin956c4f22015-09-05 13:31:14 -0500281$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(obj)/arch/x86/memlayout.ramstage.ld
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700282 @printf " CC $(subst $(obj)/,,$(@))\n"
Aaron Durbind4dd44c2015-09-06 10:15:17 -0500283 $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(obj)/arch/x86/memlayout.ramstage.ld
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700284
Patrick Georgi3ce96bd2014-11-22 17:42:58 +0100285$(objgenerated)/ramstage.o: $$(ramstage-objs) $(COMPILER_RT_ramstage) $$(ramstage-libs)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700286 @printf " CC $(subst $(obj)/,,$(@))\n"
Stefan Reinauer181b7732015-03-15 19:23:50 +0100287ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y)
Patrick Georgieec8dfb2015-05-07 22:24:41 +0200288 $(LD_ramstage) -m elf_i386 -r -o $@ $(COMPILER_RT_FLAGS_ramstage) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) --no-whole-archive $(COMPILER_RT_ramstage) --end-group
Stefan Reinauer181b7732015-03-15 19:23:50 +0100289else
290 $(LD_ramstage) -m elf_x86_64 -r -o $@ $(COMPILER_RT_FLAGS_ramstage) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) --no-whole-archive $(COMPILER_RT_ramstage) --end-group
291endif
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700292
Stefan Reinauer181b7732015-03-15 19:23:50 +0100293endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700294
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700295
Stefan Reinauer6cb3a592015-07-13 09:39:15 +0200296ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
297
298romstage-y += cbmem.c
299romstage-y += boot.c
300
301romstage-y += cbfs_and_run.c
302romstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += cpu_common.c
303romstage-y += memset.c
304romstage-y += memcpy.c
305romstage-y += memmove.c
306romstage-y += mmap_boot.c
307
308romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
309
310endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
311
312ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
313
314ramstage-y += boot.c
315ramstage-y += gdt.c
316ramstage-y += tables.c
317ramstage-y += cbmem.c
318ramstage-$(CONFIG_GENERATE_MP_TABLE) += mpspec.c
319ramstage-$(CONFIG_GENERATE_PIRQ_TABLE) += pirq_routing.c
320ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
321ramstage-$(CONFIG_GENERATE_SMBIOS_TABLES) += smbios.c
322ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen.c
323ramstage-$(CONFIG_HAVE_ACPI_RESUME) += wakeup.S
324
325ramstage-y += c_start.S
326ramstage-y += cpu.c
327ramstage-y += cpu_common.c
328ramstage-y += pci_ops_conf1.c
329ramstage-$(CONFIG_MMCONF_SUPPORT) += pci_ops_mmconf.c
330ramstage-y += exception.c
331ramstage-$(CONFIG_IOAPIC) += ioapic.c
332ramstage-y += memset.c
333ramstage-y += memcpy.c
334ramstage-y += memmove.c
335ramstage-y += ebda.c
336ramstage-y += mmap_boot.c
337ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c
338ramstage-$(CONFIG_COOP_MULTITASKING) += thread_switch.S
339ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
340
341smm-y += memset.c
342smm-y += memcpy.c
343smm-y += memmove.c
344smm-y += mmap_boot.c
345
346ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
347rmodules_x86_32-y += memset.c
348rmodules_x86_32-y += memcpy.c
349rmodules_x86_32-y += memmove.c
350else
351rmodules_x86_64-y += memset.c
352rmodules_x86_64-y += memcpy.c
353rmodules_x86_64-y += memmove.c
354endif
355
356endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64