blob: 132e662d8c0400130f7f3a6f34553f17cf74e416 [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
29
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000030ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
Stefan Reinauer24ef1342011-04-14 22:28:00 +000031romstage-y += memset.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060032rmodules-y += memset.c
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000033endif
Gabe Black1025f3a2011-09-16 02:18:56 -070034romstage-y += memchr.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000035ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
Stefan Reinauer24ef1342011-04-14 22:28:00 +000036romstage-y += memcpy.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060037rmodules-y += memcpy.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000038endif
Stefan Reinauer24ef1342011-04-14 22:28:00 +000039romstage-y += memcmp.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060040rmodules-y += memcmp.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000041romstage-y += cbfs.c
42romstage-y += lzma.c
43#romstage-y += lzmadecode.c
44romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
45romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c
46romstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
Stefan Reinauer4885daa2011-04-26 23:47:04 +000047romstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
Vadim Bendebury3e316002011-09-30 12:02:18 -070048romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000049romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000050romstage-$(CONFIG_USBDEBUG) += usbdebug.c
Kyösti Mälkkid59fc532013-02-28 00:32:25 +020051romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c cbmem.c
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070052romstage-y += compute_ip_checksum.c
53romstage-y += memmove.c
David Hendricksae0e8d32013-03-06 20:43:55 -080054romstage-$(CONFIG_ARCH_X86) += gcc.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000055
Stefan Reinauer1e753292012-11-30 12:23:45 -080056ramstage-y += hardwaremain.c
57ramstage-y += selfboot.c
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000058ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
Patrick Georgi8463dd92010-09-30 16:55:02 +000059ramstage-y += memset.c
Stefan Reinauer1afe51a2011-10-26 22:11:52 +000060endif
Gabe Black1025f3a2011-09-16 02:18:56 -070061ramstage-y += memchr.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000062ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
Patrick Georgi8463dd92010-09-30 16:55:02 +000063ramstage-y += memcpy.c
Stefan Reinauer0054afa2011-10-25 23:43:34 +000064endif
Patrick Georgi8463dd92010-09-30 16:55:02 +000065ramstage-y += memcmp.c
66ramstage-y += memmove.c
67ramstage-y += malloc.c
Duncan Laurief5e9ac42012-06-23 13:33:32 -070068smm-$(CONFIG_SMM_TSEG) += malloc.c
Patrick Georgi8463dd92010-09-30 16:55:02 +000069ramstage-y += delay.c
70ramstage-y += fallback_boot.c
71ramstage-y += compute_ip_checksum.c
72ramstage-y += version.c
73ramstage-y += cbfs.c
74ramstage-y += lzma.c
75#ramstage-y += lzmadecode.c
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070076ramstage-y += stack.c
Stefan Reinauer4c4dd932012-12-07 17:28:02 -080077ramstage-$(CONFIG_ARCH_X86) += gcc.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000078ramstage-y += clog2.c
Patrick Georgi8463dd92010-09-30 16:55:02 +000079ramstage-y += cbmem.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000080ramstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
Stefan Reinauer4885daa2011-04-26 23:47:04 +000081ramstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
Vadim Bendebury3e316002011-09-30 12:02:18 -070082ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000083ramstage-$(CONFIG_USBDEBUG) += usbdebug.c
84ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c
Rudolf Marek7f0e9302011-09-02 23:23:41 +020085ramstage-$(CONFIG_TRACE) += trace.c
Vadim Bendebury6f72d692011-09-21 16:12:39 -070086ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Stefan Reinauerd37ab452012-12-18 16:23:28 -080087ramstage-$(CONFIG_COVERAGE) += libgcov.c
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070088ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += edid.c
Stefan Reinauer16ce01b2011-01-28 08:05:54 +000089
Patrick Georgi23f38cd2012-11-16 14:50:32 +010090ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
Patrick Georgi0588d192009-08-12 15:00:51 +000091
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070092ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
93smm-y += memset.c
94endif
Stefan Reinauer0054afa2011-10-25 23:43:34 +000095ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
96smm-y += memcpy.c
97endif
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070098smm-y += cbfs.c memcmp.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000099smm-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
Stefan Reinauer4885daa2011-04-26 23:47:04 +0000100smm-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
Sven Schnelle20fc6312011-10-30 09:57:35 +0100101smm-$(CONFIG_USBDEBUG) += usbdebug.c
David Hendricksae0e8d32013-03-06 20:43:55 -0800102smm-y += gcc.c
Stefan Reinauere9f32582010-03-29 13:04:13 +0000103
Patrick Georgi8463dd92010-09-30 16:55:02 +0000104$(obj)/lib/version.ramstage.o : $(obj)/build.h
Stefan Reinauerba9dae22011-07-29 15:34:14 -0700105
106OPTION_TABLE_H:=
107ifeq ($(CONFIG_HAVE_OPTION_TABLE),y)
108OPTION_TABLE_H:=$(obj)/option_table.h
109endif
110
111$(obj)/lib/uart8250mem.smm.o : $(OPTION_TABLE_H)
Stefan Reinauer52608712011-08-11 14:51:31 -0700112$(obj)/lib/uart8250.smm.o : $(OPTION_TABLE_H)
Stefan Reinauerba9dae22011-07-29 15:34:14 -0700113
Aaron Durbinad935522012-12-24 14:28:37 -0600114ifeq ($(CONFIG_RELOCATABLE_MODULES),y)
115ramstage-y += rmodule.c
Aaron Durbin8e4a3552013-02-08 17:28:04 -0600116romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c
Aaron Durbinad935522012-12-24 14:28:37 -0600117
118RMODULE_LDSCRIPT := $(src)/lib/rmodule.ld
119RMODULE_LDFLAGS := -nostartfiles -shared -z defs -nostdlib -Bsymbolic -T $(RMODULE_LDSCRIPT)
120
121# rmodule_link_rules is a function that should be called with:
122# (1) the object name to link
123# (2) the dependencies
124# (3) heap size of the relocatable module
125# It will create the necessary Make rules.
126define rmodule_link
127$(strip $(1)): $(strip $(2)) $$(RMODULE_LDSCRIPT) $$(obj)/ldoptions
128 $$(LD) $$(RMODULE_LDFLAGS) --defsym=__heap_size=$(strip $(3)) -o $$@ $(strip $(2))
129 $$(NM) -n $$@ > $$(basename $$@).map
130endef
131
132endif
Aaron Durbin2b7c88f2013-03-01 16:56:34 -0600133