blob: f82a3fa3fd3fa7df0d9af9d56b237ea0795651f8 [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#
Aaron Durbin0f333072014-01-30 17:19:46 -060019subdirs-y += loaders
Stefan Reinauer24ef1342011-04-14 22:28:00 +000020
Hung-Te Linfe187922013-02-01 01:09:24 +080021bootblock-y += cbfs.c
Hung-Te Linfe187922013-02-01 01:09:24 +080022bootblock-y += memchr.c
Hung-Te Linfe187922013-02-01 01:09:24 +080023bootblock-y += memcmp.c
24
Gabe Black1025f3a2011-09-16 02:18:56 -070025romstage-y += memchr.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000026romstage-y += memcmp.c
Aaron Durbin2b7c88f2013-03-01 16:56:34 -060027rmodules-y += memcmp.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000028romstage-y += cbfs.c
Andrew Wueabfd3a2013-08-19 11:43:36 +080029romstage-$(CONFIG_COMPRESS_RAMSTAGE) += lzma.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000030#romstage-y += lzmadecode.c
31romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
Vladimir Serbinenko45988da2013-03-30 02:02:13 +010032
Kyösti Mälkkif8bf5a12013-10-11 22:08:02 +030033ifeq ($(CONFIG_EARLY_CBMEM_INIT),y)
Aaron Durbinc15551a2013-03-23 00:00:54 -050034romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Kyösti Mälkkia2f6af32013-09-10 13:50:32 +030035romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
Kyösti Mälkkia2f6af32013-09-10 13:50:32 +030036endif
Denis 'GNUtoo' Carikli8a0a8482013-06-20 16:24:14 +020037
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070038romstage-y += compute_ip_checksum.c
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070039romstage-$(CONFIG_ARCH_ROMSTAGE_X86_32) += gcc.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000040
Stefan Reinauer1e753292012-11-30 12:23:45 -080041ramstage-y += hardwaremain.c
42ramstage-y += selfboot.c
Stefan Reinauer3e4e3032013-03-20 14:08:04 -070043ramstage-y += coreboot_table.c
Aaron Durbin49048022014-02-18 21:55:02 -060044ramstage-y += bootmem.c
Gabe Black1025f3a2011-09-16 02:18:56 -070045ramstage-y += memchr.c
Patrick Georgi8463dd92010-09-30 16:55:02 +000046ramstage-y += memcmp.c
Patrick Georgi8463dd92010-09-30 16:55:02 +000047ramstage-y += malloc.c
Duncan Laurief5e9ac42012-06-23 13:33:32 -070048smm-$(CONFIG_SMM_TSEG) += malloc.c
Patrick Georgi8463dd92010-09-30 16:55:02 +000049ramstage-y += delay.c
50ramstage-y += fallback_boot.c
51ramstage-y += compute_ip_checksum.c
52ramstage-y += version.c
53ramstage-y += cbfs.c
54ramstage-y += lzma.c
55#ramstage-y += lzmadecode.c
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070056ramstage-y += stack.c
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070057ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += gcc.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000058ramstage-y += clog2.c
Alexandru Gagniucaf4bd592014-01-12 15:42:58 -060059romstage-y += clog2.c
Vadim Bendebury3e316002011-09-30 12:02:18 -070060ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
Stefan Reinauer24ef1342011-04-14 22:28:00 +000061ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c
Rudolf Marek7f0e9302011-09-02 23:23:41 +020062ramstage-$(CONFIG_TRACE) += trace.c
Vadim Bendebury6f72d692011-09-21 16:12:39 -070063ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Stefan Reinauerd37ab452012-12-18 16:23:28 -080064ramstage-$(CONFIG_COVERAGE) += libgcov.c
Ronald G. Minnichb3b72f32013-03-13 14:35:01 -070065ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += edid.c
Aaron Durbina05a8522013-03-22 20:44:46 -050066ramstage-y += memrange.c
Aaron Durbin4409a5e2013-05-06 12:20:52 -050067ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c
Aaron Durbin340ca912013-04-30 09:58:12 -050068ramstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c
Stefan Reinauer16ce01b2011-01-28 08:05:54 +000069
Aaron Durbindf3a1092013-03-13 12:41:44 -050070# The CBMEM implementations are chosen based on CONFIG_DYNAMIC_CBMEM.
71ifeq ($(CONFIG_DYNAMIC_CBMEM),y)
72ramstage-y += dynamic_cbmem.c
73romstage-y += dynamic_cbmem.c
74else
75ramstage-y += cbmem.c
Kyösti Mälkkif8bf5a12013-10-11 22:08:02 +030076romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c
Kyösti Mälkkideb2cb22014-03-28 23:46:45 +020077romstage-$(CONFIG_BROKEN_CAR_MIGRATE) += cbmem.c
Aaron Durbindf3a1092013-03-13 12:41:44 -050078endif # CONFIG_DYNAMIC_CBMEM
79ramstage-y += cbmem_info.c
80
Stefan Reinauer2f38b072013-07-18 16:24:08 -070081ramstage-y += hexdump.c
82romstage-y += hexdump.c
83
Duncan Laurie72748002013-10-31 08:26:23 -070084ramstage-$(CONFIG_REG_SCRIPT) += reg_script.c
85
Aaron Durbin75e29742013-10-10 20:37:04 -050086romstage-$(CONFIG_CACHE_RELOCATED_RAMSTAGE_OUTSIDE_CBMEM) += ramstage_cache.c
87
Stefan Reinauerfb89dd02012-03-30 16:28:20 -070088smm-y += cbfs.c memcmp.c
David Hendricksae0e8d32013-03-06 20:43:55 -080089smm-y += gcc.c
Stefan Reinauere9f32582010-03-29 13:04:13 +000090
Patrick Georgi8463dd92010-09-30 16:55:02 +000091$(obj)/lib/version.ramstage.o : $(obj)/build.h
Stefan Reinauerba9dae22011-07-29 15:34:14 -070092
Kyösti Mälkki5687fc92013-11-28 18:11:49 +020093romstage-y += bootmode.c
94ramstage-y += bootmode.c
95
Aaron Durbinad935522012-12-24 14:28:37 -060096ifeq ($(CONFIG_RELOCATABLE_MODULES),y)
97ramstage-y += rmodule.c
Aaron Durbin8e4a3552013-02-08 17:28:04 -060098romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c
Aaron Durbinad935522012-12-24 14:28:37 -060099
100RMODULE_LDSCRIPT := $(src)/lib/rmodule.ld
Aaron Durbin3eb8eb72014-03-10 16:13:58 -0500101RMODULE_LDFLAGS := -nostartfiles -Wl,--emit-relocs -Wl,-z,defs -Wl,-Bsymbolic -Wl,-T,$(RMODULE_LDSCRIPT)
Aaron Durbinad935522012-12-24 14:28:37 -0600102
103# rmodule_link_rules is a function that should be called with:
104# (1) the object name to link
105# (2) the dependencies
106# (3) heap size of the relocatable module
Aaron Durbin3eb8eb72014-03-10 16:13:58 -0500107# It will create the necessary Make rules to create a rmodule. The resulting
108# rmdoule is named $(1).rmod
Aaron Durbinad935522012-12-24 14:28:37 -0600109define rmodule_link
Aaron Durbin3eb8eb72014-03-10 16:13:58 -0500110$(strip $(1)): $(strip $(2)) $$(RMODULE_LDSCRIPT) $$(obj)/ldoptions $$(RMODTOOL)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700111 $$(CC_rmodules) $$(CFLAGS_rmodules) $$(RMODULE_LDFLAGS) -Wl,--defsym=__heap_size=$(strip $(3)) -o $$@ -Wl,--start-group $(strip $(2)) $$(LIBGCC_FILE_NAME_rmodules) -Wl,--end-group
112 $$(NM_rmodules) -n $$@ > $$(basename $$@).map
Aaron Durbin3eb8eb72014-03-10 16:13:58 -0500113
114$(strip $(1)).rmod: $(strip $(1))
115 $$(RMODTOOL) -i $$^ -o $$@
Aaron Durbinad935522012-12-24 14:28:37 -0600116endef
117
118endif
Aaron Durbin2b7c88f2013-03-01 16:56:34 -0600119