blob: 46c98cd142f51ed3b37f8fcaddb54fa2b4a4910f [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
Alexandru Gagniucc46a3922015-10-02 16:17:41 -070088bootblock-y += walkcbfs.S
Aaron Durbin3953e392015-09-03 00:41:29 -050089$(obj)/arch/x86/bootblock.bootblock.o: $(objgenerated)/bootblock.inc
Patrick Georgi641dd712011-11-01 18:55:59 +010090
Aaron Durbin3953e392015-09-03 00:41:29 -050091bootblock-y += bootblock.ld
92$(obj)/arch/x86/bootblock.bootblock.ld: $(objgenerated)/bootblock.ld
Patrick Georgi641dd712011-11-01 18:55:59 +010093
Patrick Georgi56b83092015-04-02 19:44:19 +020094bootblock_romccflags := -mcpu=i386 -O2 -D__PRE_RAM__ -D__BOOTBLOCK__
Patrick Georgi641dd712011-11-01 18:55:59 +010095ifeq ($(CONFIG_SSE),y)
Patrick Georgi56b83092015-04-02 19:44:19 +020096bootblock_romccflags := -mcpu=k7 -msse -O2 -D__PRE_RAM__ -D__BOOTBLOCK__
Patrick Georgi641dd712011-11-01 18:55:59 +010097endif
98
Aaron Durbin3953e392015-09-03 00:41:29 -050099# This is a hack in case there are no per chipset linker files.
100$(objgenerated)/empty:
101 touch $@
102
103$(objgenerated)/bootblock.ld: $$(filter-out $(obj)/arch/x86/bootblock.bootblock.ld, $$(filter %.ld,$$(bootblock-objs))) $(objgenerated)/empty
Patrick Georgi641dd712011-11-01 18:55:59 +0100104 @printf " GEN $(subst $(obj)/,,$(@))\n"
Marc Jonesac630f72015-06-30 15:46:49 -0600105 cat $^ >> $@.tmp
106 mv $@.tmp $@
Patrick Georgi641dd712011-11-01 18:55:59 +0100107
Patrick Georgief0158e2015-07-27 17:47:55 +0200108$(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 +0100109 @printf " ROMCC $(subst $(obj)/,,$(@))\n"
Patrick Georgi59307742014-05-19 09:23:57 +0200110 $(CC_bootblock) $(CPPFLAGS_bootblock) -MM -MT$(objgenerated)/bootblock.inc \
Kyösti Mälkkif775b8c2012-04-19 12:14:53 +0300111 $< > $(objgenerated)/bootblock.inc.d
Patrick Georgi59307742014-05-19 09:23:57 +0200112 $(ROMCC) -c -S $(bootblock_romccflags) -I. $(CPPFLAGS_bootblock) $< -o $@
Patrick Georgi641dd712011-11-01 18:55:59 +0100113
Alexandru Gagniucdbeedbe2015-10-02 12:17:56 -0700114# $(obj)/arch/x86/bootblock.bootblock.ld is part of $(bootblock-objs)
115$(objcbfs)/bootblock.debug: $$(bootblock-objs)
Patrick Georgi641dd712011-11-01 18:55:59 +0100116 @printf " LINK $(subst $(obj)/,,$(@))\n"
Alexandru Gagniucdbeedbe2015-10-02 12:17:56 -0700117 $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
118 $(filter-out %.ld,$(bootblock-objs)) \
Alexandru Gagniuc0017b002015-10-02 12:24:00 -0700119 -T $(obj)/arch/x86/bootblock.bootblock.ld
Patrick Georgi641dd712011-11-01 18:55:59 +0100120
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700121
Stefan Reinauer181b7732015-03-15 19:23:50 +0100122endif # CONFIG_ARCH_BOOTBLOCK_X86_32 / CONFIG_ARCH_BOOTBLOCK_X86_64
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700123
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700124###############################################################################
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500125# common support for early assembly includes
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700126###############################################################################
127
Aaron Durbine581b062015-09-03 11:29:28 -0500128# Chipset specific assembly stubs in the romstage program flow. Certain
129# boards have more than one assembly stub so collect those and put them
130# into a single generated file.
131crt0s = $(cpu_incs-y)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700132
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500133$(objgenerated)/assembly.inc: $$(crt0s)
Aaron Durbine581b062015-09-03 11:29:28 -0500134 @printf " GEN $(subst $(obj)/,,$(@))\n"
135 printf '$(foreach crt0,$(crt0s),#include "$(crt0)"\n)' > $@
136
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500137define early_x86_stage
138# $1 stage name
139# $2 oformat
140$(1)-y += memlayout.ld
Aaron Durbine581b062015-09-03 11:29:28 -0500141# Add the assembly file that pulls in the rest of the dependencies in
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500142# the right order. Make sure the auto generated assembly.inc is a proper
Aaron Durbine581b062015-09-03 11:29:28 -0500143# dependency.
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500144$(1)-y += assembly_entry.S
145$$(obj)/arch/x86/assembly_entry.$(1).o: $(objgenerated)/assembly.inc
146
147$$(objcbfs)/$(1).debug: $$$$($(1)-libs) $$$$($(1)-objs)
148 @printf " LINK $$(subst $$(obj)/,,$$(@))\n"
149 $$(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)
150 LANG=C LC_ALL= $$(OBJCOPY_$(1)) --only-section .illegal_globals $$(@) $$(objcbfs)/$(1)_null.offenders 2>&1 | \
151 grep -v "Empty loadable segment detected" && \
152 $$(NM_$(1)) $$(objcbfs)/$(1)_null.offenders | grep -q ""; if [ $$$$? -eq 0 ]; then \
153 echo "Forbidden global variables in "$(1)":"; \
154 $$(NM_$(1)) $$(objcbfs)/$(1)_null.offenders; false; \
155 else true; fi
156endef
157
158###############################################################################
159# romstage
160###############################################################################
161
162ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700163
Aaron Durbin85982cd2015-09-03 11:01:17 -0500164ifneq ($(CONFIG_ROMCC),y)
165
166romstage-srcs += $(src)/mainboard/$(MAINBOARDDIR)/romstage.c
167
168else # CONFIG_ROMCC == y
169
170# This order matters. The mainboards requiring ROMCC need their mainboard
171# code to follow the prior crt0s files for program flow control. The
172# romstage.inc from the MAINBOARDDIR is implicitly main() for romstage
173# because of the instruction sequen fall-through.
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700174crt0s += $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc
Stefan Reinauer6cb3a592015-07-13 09:39:15 +0200175crt0s += $(src)/arch/x86/crt0_romcc_epilogue.inc
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700176
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700177ifeq ($(CONFIG_MMX),y)
178 ifeq ($(CONFIG_SSE),y)
179 ROMCCFLAGS := -mcpu=p4 -O2 # MMX, SSE
180 else
181 ROMCCFLAGS := -mcpu=p2 -O2 # MMX, !SSE
182 endif
183else
184 ROMCCFLAGS := -mcpu=i386 -O2 # !MMX, !SSE
185endif
186
Patrick Georgi24cca752014-11-29 11:51:25 +0100187$(objcbfs)/romstage%.bin: $(objcbfs)/romstage%.elf
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700188 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
189 $(OBJCOPY_romstage) -O binary $< $@
190
Patrick Georgi24cca752014-11-29 11:51:25 +0100191$(objcbfs)/romstage%.elf: $(objcbfs)/romstage%.debug
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700192 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
193 cp $< $@.tmp
194 $(OBJCOPY_romstage) --strip-debug $@.tmp
195 $(OBJCOPY_romstage) --add-gnu-debuglink=$< $@.tmp
196 mv $@.tmp $@
197
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700198$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(objutil)/romcc/romcc $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
199 printf " ROMCC romstage.inc\n"
Patrick Georgi815f4bf2015-04-28 22:43:31 +0200200 $(ROMCC) -c -S $(ROMCCFLAGS) -D__ROMSTAGE__ -D__PRE_RAM__ -I. $(CPPFLAGS_romstage) $< -o $@
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700201
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700202endif
203
Alexandru Gagniuceb3c9912014-03-29 13:01:11 -0500204romstage-libs ?=
205
Stefan Reinauer98749332015-06-23 12:57:06 -0700206ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y)
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500207$(eval $(call early_x86_stage,romstage,elf32-i386))
Stefan Reinauer98749332015-06-23 12:57:06 -0700208else
Aaron Durbin1bc6a792015-09-29 14:54:25 -0500209$(eval $(call early_x86_stage,romstage,elf64-x86-64))
Stefan Reinauer98749332015-06-23 12:57:06 -0700210endif
211
Patrick Georgid69839b2015-04-03 10:32:17 +0200212# Compiling crt0 with -g seems to trigger https://sourceware.org/bugzilla/show_bug.cgi?id=6428
213romstage-S-ccopts += -I. -g0
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700214
Stefan Reinauer181b7732015-03-15 19:23:50 +0100215endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
Stefan Reinauerf1939bb2010-12-30 17:39:50 +0000216
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700217###############################################################################
218# ramstage
219###############################################################################
220
Stefan Reinauer181b7732015-03-15 19:23:50 +0100221ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700222
Patrick Georgic32a52c2015-06-22 21:10:34 +0200223ifeq ($(CONFIG_COMPILE_IN_DSDT),y)
224ramstage-srcs += $(obj)/dsdt.aml
225
226ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
227target-objcopy=-O elf32-i386 -B i386
228endif
229ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_64),y)
230target-objcopy=-O elf64-x86_64 -B x86_64
231endif
232
233define ramstage-objs_aml_template
234$(call src-to-obj,ramstage,$(1).aml): $(1).aml
235 @printf " OBJCOPY $$(subst $$(obj)/,,$$(@))\n"
236 cd $$(dir $$@) && $$(OBJCOPY_ramstage) -I binary $$(target-objcopy) $$(notdir $$<) $$(notdir $$@)
237endef
238endif
239
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700240ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
241ifeq ($(CONFIG_GENERATE_MP_TABLE),y)
242ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/mptable.c),)
243ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mptable.c
244endif
245endif
246ifeq ($(CONFIG_GENERATE_PIRQ_TABLE),y)
247ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/irq_tables.c
248endif
249ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/reset.c),)
250ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/reset.c
251endif
Vladimir Serbinenko822bc652014-01-03 15:55:40 +0100252ifeq ($(CONFIG_HAVE_ACPI_TABLES),y)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700253ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/acpi_tables.c
Aaron Durbinab454c62015-07-30 12:44:58 -0500254ifeq ($(CONFIG_COMPILE_IN_DSDT),y)
255$(eval $(call asl_template,dsdt,n))
256else
Vladimir Serbinenko36f8d272015-05-31 12:31:59 +0200257$(eval $(call asl_template,dsdt))
Aaron Durbinab454c62015-07-30 12:44:58 -0500258endif
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700259ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/fadt.c),)
260ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/fadt.c
261endif
Patrick Georgi990e7c92015-04-03 10:47:15 +0200262endif # CONFIG_GENERATE_ACPI_TABLES
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700263ifeq ($(CONFIG_HAVE_SMI_HANDLER),y)
264ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/smihandler.c),)
265smm-srcs += src/mainboard/$(MAINBOARDDIR)/smihandler.c
266endif
267endif
268ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c),)
269ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c
270endif
271
272ramstage-libs ?=
273
274ifeq ($(CONFIG_RELOCATABLE_RAMSTAGE),y)
275
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700276# The rmodule_link defintion creates an elf file with .rmod extension.
277$(objcbfs)/ramstage.elf: $(objcbfs)/ramstage.debug.rmod
278 cp $< $@
279
Aaron Durbin83bc0db2015-09-06 10:45:18 -0500280endif
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700281
Aaron Durbin956c4f22015-09-05 13:31:14 -0500282ramstage-y += memlayout.ld
Patrick Georgi828e0e82015-04-04 15:50:20 +0200283
Aaron Durbin956c4f22015-09-05 13:31:14 -0500284$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(obj)/arch/x86/memlayout.ramstage.ld
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700285 @printf " CC $(subst $(obj)/,,$(@))\n"
Aaron Durbind4dd44c2015-09-06 10:15:17 -0500286 $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(obj)/arch/x86/memlayout.ramstage.ld
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700287
Patrick Georgi3ce96bd2014-11-22 17:42:58 +0100288$(objgenerated)/ramstage.o: $$(ramstage-objs) $(COMPILER_RT_ramstage) $$(ramstage-libs)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700289 @printf " CC $(subst $(obj)/,,$(@))\n"
Stefan Reinauer181b7732015-03-15 19:23:50 +0100290ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y)
Patrick Georgieec8dfb2015-05-07 22:24:41 +0200291 $(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 +0100292else
293 $(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
294endif
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700295
Stefan Reinauer181b7732015-03-15 19:23:50 +0100296endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700297
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700298
Stefan Reinauer6cb3a592015-07-13 09:39:15 +0200299ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
300
301romstage-y += cbmem.c
302romstage-y += boot.c
303
304romstage-y += cbfs_and_run.c
305romstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += cpu_common.c
306romstage-y += memset.c
307romstage-y += memcpy.c
308romstage-y += memmove.c
309romstage-y += mmap_boot.c
310
311romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
312
313endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
314
315ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
316
317ramstage-y += boot.c
318ramstage-y += gdt.c
319ramstage-y += tables.c
320ramstage-y += cbmem.c
321ramstage-$(CONFIG_GENERATE_MP_TABLE) += mpspec.c
322ramstage-$(CONFIG_GENERATE_PIRQ_TABLE) += pirq_routing.c
323ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
324ramstage-$(CONFIG_GENERATE_SMBIOS_TABLES) += smbios.c
325ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen.c
326ramstage-$(CONFIG_HAVE_ACPI_RESUME) += wakeup.S
327
328ramstage-y += c_start.S
329ramstage-y += cpu.c
330ramstage-y += cpu_common.c
331ramstage-y += pci_ops_conf1.c
332ramstage-$(CONFIG_MMCONF_SUPPORT) += pci_ops_mmconf.c
333ramstage-y += exception.c
334ramstage-$(CONFIG_IOAPIC) += ioapic.c
335ramstage-y += memset.c
336ramstage-y += memcpy.c
337ramstage-y += memmove.c
338ramstage-y += ebda.c
339ramstage-y += mmap_boot.c
340ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c
341ramstage-$(CONFIG_COOP_MULTITASKING) += thread_switch.S
342ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
343
344smm-y += memset.c
345smm-y += memcpy.c
346smm-y += memmove.c
347smm-y += mmap_boot.c
348
349ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
350rmodules_x86_32-y += memset.c
351rmodules_x86_32-y += memcpy.c
352rmodules_x86_32-y += memmove.c
353else
354rmodules_x86_64-y += memset.c
355rmodules_x86_64-y += memcpy.c
356rmodules_x86_64-y += memmove.c
357endif
358
359endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64