blob: 90efe6c79bd5a7deded1d89bbfb5acfda8af1122 [file] [log] [blame]
Stefan Reinauer179206a2012-11-30 12:19:59 -08001#
2# This file is part of the coreboot project.
3#
4# Copyright (C) 2009 coresystems GmbH
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; version 2 of the License.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010017# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Stefan Reinauer179206a2012-11-30 12:19:59 -080018#
Stefan Reinauer24ef1342011-04-14 22:28:00 +000019
Hung-Te Linfe187922013-02-01 01:09:24 +080020bootblock-y += cbfs.c
21ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
22bootblock-y += memset.c
23endif
24bootblock-y += memchr.c
25ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
26bootblock-y += memcpy.c
27endif
28bootblock-y += memcmp.c
Gabe Black545c0ca2013-07-07 14:04:26 -070029ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
30bootblock-y += memmove.c
31endif
Hung-Te Linfe187922013-02-01 01:09:24 +080032
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000033ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
Stefan Reinauer24ef1342011-04-14 22:28:00 +000034romstage-y += memset.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060035rmodules-y += memset.c
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000036endif
Gabe Black1025f3a2011-09-16 02:18:56 -070037romstage-y += memchr.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000038ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
Stefan Reinauer24ef1342011-04-14 22:28:00 +000039romstage-y += memcpy.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060040rmodules-y += memcpy.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000041endif
Stefan Reinauer24ef1342011-04-14 22:28:00 +000042romstage-y += memcmp.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060043rmodules-y += memcmp.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000044romstage-y += cbfs.c
Andrew Wueabfd3a2013-08-19 11:43:36 +080045romstage-$(CONFIG_COMPRESS_RAMSTAGE) += lzma.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000046#romstage-y += lzmadecode.c
47romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000048romstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
Stefan Reinauer4885daa2011-04-26 23:47:04 +000049romstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
Vadim Bendebury3e316002011-09-30 12:02:18 -070050romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000051romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000052romstage-$(CONFIG_USBDEBUG) += usbdebug.c
Vladimir Serbinenko45988da2013-03-30 02:02:13 +010053romstage-$(CONFIG_SPKMODEM) += spkmodem.c
54
Aaron Durbinc15551a2013-03-23 00:00:54 -050055romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Denis 'GNUtoo' Carikli8a0a8482013-06-20 16:24:14 +020056
57ifneq ($(CONFIG_DYNAMIC_CBMEM),y)
Aaron Durbinc15551a2013-03-23 00:00:54 -050058romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c
Denis 'GNUtoo' Carikli8a0a8482013-06-20 16:24:14 +020059endif
60
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070061romstage-y += compute_ip_checksum.c
Gabe Black545c0ca2013-07-07 14:04:26 -070062ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070063romstage-y += memmove.c
Gabe Black545c0ca2013-07-07 14:04:26 -070064endif
David Hendricksae0e8d32013-03-06 20:43:55 -080065romstage-$(CONFIG_ARCH_X86) += gcc.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000066
Stefan Reinauer1e753292012-11-30 12:23:45 -080067ramstage-y += hardwaremain.c
68ramstage-y += selfboot.c
Stefan Reinauer3e4e3032013-03-20 14:08:04 -070069ramstage-y += coreboot_table.c
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000070ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
Patrick Georgi8463dd92010-09-30 16:55:02 +000071ramstage-y += memset.c
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000072endif
Gabe Black1025f3a2011-09-16 02:18:56 -070073ramstage-y += memchr.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000074ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
Patrick Georgi8463dd92010-09-30 16:55:02 +000075ramstage-y += memcpy.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000076endif
Patrick Georgi8463dd92010-09-30 16:55:02 +000077ramstage-y += memcmp.c
Gabe Black545c0ca2013-07-07 14:04:26 -070078ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
Patrick Georgi8463dd92010-09-30 16:55:02 +000079ramstage-y += memmove.c
Gabe Black545c0ca2013-07-07 14:04:26 -070080endif
Patrick Georgi8463dd92010-09-30 16:55:02 +000081ramstage-y += malloc.c
Duncan Laurief5e9ac42012-06-23 13:33:32 -070082smm-$(CONFIG_SMM_TSEG) += malloc.c
Patrick Georgi8463dd92010-09-30 16:55:02 +000083ramstage-y += delay.c
84ramstage-y += fallback_boot.c
85ramstage-y += compute_ip_checksum.c
86ramstage-y += version.c
87ramstage-y += cbfs.c
88ramstage-y += lzma.c
89#ramstage-y += lzmadecode.c
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070090ramstage-y += stack.c
Stefan Reinauer4c4dd932012-12-07 17:28:02 -080091ramstage-$(CONFIG_ARCH_X86) += gcc.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000092ramstage-y += clog2.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000093ramstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
Stefan Reinauer4885daa2011-04-26 23:47:04 +000094ramstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
Vadim Bendebury3e316002011-09-30 12:02:18 -070095ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000096ramstage-$(CONFIG_USBDEBUG) += usbdebug.c
Vladimir Serbinenko45988da2013-03-30 02:02:13 +010097ramstage-$(CONFIG_SPKMODEM) += spkmodem.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000098ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c
Rudolf Marek7f0e9302011-09-02 23:23:41 +020099ramstage-$(CONFIG_TRACE) += trace.c
Vadim Bendebury6f72d692011-09-21 16:12:39 -0700100ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Stefan Reinauerd37ab452012-12-18 16:23:28 -0800101ramstage-$(CONFIG_COVERAGE) += libgcov.c
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -0700102ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += edid.c
Aaron Durbina05a8522013-03-22 20:44:46 -0500103ramstage-y += memrange.c
Aaron Durbin4409a5e2013-05-06 12:20:52 -0500104ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c
Aaron Durbin340ca912013-04-30 09:58:12 -0500105ramstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c
Stefan Reinauer16ce01b2011-01-28 08:05:54 +0000106
Aaron Durbindf3a1092013-03-13 12:41:44 -0500107# The CBMEM implementations are chosen based on CONFIG_DYNAMIC_CBMEM.
108ifeq ($(CONFIG_DYNAMIC_CBMEM),y)
109ramstage-y += dynamic_cbmem.c
110romstage-y += dynamic_cbmem.c
111else
112ramstage-y += cbmem.c
113romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c
114endif # CONFIG_DYNAMIC_CBMEM
115ramstage-y += cbmem_info.c
116
Patrick Georgi23f38cd2012-11-16 14:50:32 +0100117ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
Patrick Georgi0588d192009-08-12 15:00:51 +0000118
Stefan Reinauerfb89dd02012-03-30 16:28:20 -0700119ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
120smm-y += memset.c
121endif
Stefan Reinauer0054afa2011-10-25 23:43:34 +0000122ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
123smm-y += memcpy.c
124endif
Gabe Blackc6b44162013-07-01 04:28:23 -0700125ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
126smm-y += memmove.c
127endif
Stefan Reinauerfb89dd02012-03-30 16:28:20 -0700128smm-y += cbfs.c memcmp.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +0000129smm-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
Stefan Reinauer4885daa2011-04-26 23:47:04 +0000130smm-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
Sven Schnelle20fc6312011-10-30 09:57:35 +0100131smm-$(CONFIG_USBDEBUG) += usbdebug.c
David Hendricksae0e8d32013-03-06 20:43:55 -0800132smm-y += gcc.c
Stefan Reinauere9f32582010-03-29 13:04:13 +0000133
Patrick Georgi8463dd92010-09-30 16:55:02 +0000134$(obj)/lib/version.ramstage.o : $(obj)/build.h
Stefan Reinauerba9dae22011-07-29 15:34:14 -0700135
136OPTION_TABLE_H:=
137ifeq ($(CONFIG_HAVE_OPTION_TABLE),y)
138OPTION_TABLE_H:=$(obj)/option_table.h
139endif
140
141$(obj)/lib/uart8250mem.smm.o : $(OPTION_TABLE_H)
Stefan Reinauer52608712011-08-11 14:51:31 -0700142$(obj)/lib/uart8250.smm.o : $(OPTION_TABLE_H)
Stefan Reinauerba9dae22011-07-29 15:34:14 -0700143
Aaron Durbinad935522012-12-24 14:28:37 -0600144ifeq ($(CONFIG_RELOCATABLE_MODULES),y)
145ramstage-y += rmodule.c
Aaron Durbin8e4a3552013-02-08 17:28:04 -0600146romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c
Aaron Durbinad935522012-12-24 14:28:37 -0600147
148RMODULE_LDSCRIPT := $(src)/lib/rmodule.ld
149RMODULE_LDFLAGS := -nostartfiles -shared -z defs -nostdlib -Bsymbolic -T $(RMODULE_LDSCRIPT)
150
151# rmodule_link_rules is a function that should be called with:
152# (1) the object name to link
153# (2) the dependencies
154# (3) heap size of the relocatable module
155# It will create the necessary Make rules.
156define rmodule_link
157$(strip $(1)): $(strip $(2)) $$(RMODULE_LDSCRIPT) $$(obj)/ldoptions
158 $$(LD) $$(RMODULE_LDFLAGS) --defsym=__heap_size=$(strip $(3)) -o $$@ $(strip $(2))
159 $$(NM) -n $$@ > $$(basename $$@).map
160endef
161
162endif
Aaron Durbin2b7c88f2013-03-01 16:56:34 -0600163