2012-11-30 21:19:59 +01:00
|
|
|
#
|
|
|
|
# This file is part of the coreboot project.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2009 coresystems GmbH
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2013-02-23 18:37:27 +01:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2012-11-30 21:19:59 +01:00
|
|
|
#
|
2011-04-15 00:28:00 +02:00
|
|
|
|
2013-01-31 18:09:24 +01:00
|
|
|
bootblock-y += cbfs.c
|
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
|
|
|
|
bootblock-y += memset.c
|
|
|
|
endif
|
|
|
|
bootblock-y += memchr.c
|
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
|
|
|
|
bootblock-y += memcpy.c
|
|
|
|
endif
|
|
|
|
bootblock-y += memcmp.c
|
2013-07-07 23:04:26 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
|
|
|
|
bootblock-y += memmove.c
|
|
|
|
endif
|
2013-01-31 18:09:24 +01:00
|
|
|
|
2011-10-27 00:11:52 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
|
2011-04-15 00:28:00 +02:00
|
|
|
romstage-y += memset.c
|
2013-03-01 23:56:34 +01:00
|
|
|
rmodules-y += memset.c
|
2011-10-27 00:11:52 +02:00
|
|
|
endif
|
2011-09-16 11:18:56 +02:00
|
|
|
romstage-y += memchr.c
|
2011-10-26 01:43:34 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
|
2011-04-15 00:28:00 +02:00
|
|
|
romstage-y += memcpy.c
|
2013-03-01 23:56:34 +01:00
|
|
|
rmodules-y += memcpy.c
|
2011-10-26 01:43:34 +02:00
|
|
|
endif
|
2011-04-15 00:28:00 +02:00
|
|
|
romstage-y += memcmp.c
|
2013-03-01 23:56:34 +01:00
|
|
|
rmodules-y += memcmp.c
|
2011-04-15 00:28:00 +02:00
|
|
|
romstage-y += cbfs.c
|
2013-08-19 05:43:36 +02:00
|
|
|
romstage-$(CONFIG_COMPRESS_RAMSTAGE) += lzma.c
|
2011-04-15 00:28:00 +02:00
|
|
|
#romstage-y += lzmadecode.c
|
|
|
|
romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
|
|
|
|
romstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
|
2011-04-27 01:47:04 +02:00
|
|
|
romstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
|
2011-09-30 21:02:18 +02:00
|
|
|
romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
|
2011-04-15 00:28:00 +02:00
|
|
|
romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
|
|
|
|
romstage-$(CONFIG_USBDEBUG) += usbdebug.c
|
2013-03-30 02:02:13 +01:00
|
|
|
romstage-$(CONFIG_SPKMODEM) += spkmodem.c
|
|
|
|
|
2013-03-23 06:00:54 +01:00
|
|
|
romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
|
2013-06-20 16:24:14 +02:00
|
|
|
|
|
|
|
ifneq ($(CONFIG_DYNAMIC_CBMEM),y)
|
2013-03-23 06:00:54 +01:00
|
|
|
romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c
|
2013-06-20 16:24:14 +02:00
|
|
|
endif
|
|
|
|
|
2012-03-31 01:28:20 +02:00
|
|
|
romstage-y += compute_ip_checksum.c
|
2013-07-07 23:04:26 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
|
2012-03-31 01:28:20 +02:00
|
|
|
romstage-y += memmove.c
|
2013-07-07 23:04:26 +02:00
|
|
|
endif
|
2013-03-07 05:43:55 +01:00
|
|
|
romstage-$(CONFIG_ARCH_X86) += gcc.c
|
2011-04-15 00:28:00 +02:00
|
|
|
|
2012-11-30 21:23:45 +01:00
|
|
|
ramstage-y += hardwaremain.c
|
|
|
|
ramstage-y += selfboot.c
|
2013-03-20 22:08:04 +01:00
|
|
|
ramstage-y += coreboot_table.c
|
2011-10-27 00:11:52 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-y += memset.c
|
2011-10-27 00:11:52 +02:00
|
|
|
endif
|
2011-09-16 11:18:56 +02:00
|
|
|
ramstage-y += memchr.c
|
2011-10-26 01:43:34 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-y += memcpy.c
|
2011-10-26 01:43:34 +02:00
|
|
|
endif
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-y += memcmp.c
|
2013-07-07 23:04:26 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-y += memmove.c
|
2013-07-07 23:04:26 +02:00
|
|
|
endif
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-y += malloc.c
|
2012-06-23 22:33:32 +02:00
|
|
|
smm-$(CONFIG_SMM_TSEG) += malloc.c
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-y += delay.c
|
|
|
|
ramstage-y += fallback_boot.c
|
|
|
|
ramstage-y += compute_ip_checksum.c
|
|
|
|
ramstage-y += version.c
|
|
|
|
ramstage-y += cbfs.c
|
|
|
|
ramstage-y += lzma.c
|
|
|
|
#ramstage-y += lzmadecode.c
|
2012-06-13 01:29:32 +02:00
|
|
|
ramstage-y += stack.c
|
2012-12-08 02:28:02 +01:00
|
|
|
ramstage-$(CONFIG_ARCH_X86) += gcc.c
|
2011-04-15 00:28:00 +02:00
|
|
|
ramstage-y += clog2.c
|
|
|
|
ramstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
|
2011-04-27 01:47:04 +02:00
|
|
|
ramstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
|
2011-09-30 21:02:18 +02:00
|
|
|
ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-$(CONFIG_USBDEBUG) += usbdebug.c
|
2013-03-30 02:02:13 +01:00
|
|
|
ramstage-$(CONFIG_SPKMODEM) += spkmodem.c
|
2010-09-30 18:55:02 +02:00
|
|
|
ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c
|
2011-09-02 23:23:41 +02:00
|
|
|
ramstage-$(CONFIG_TRACE) += trace.c
|
2011-09-22 01:12:39 +02:00
|
|
|
ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
|
Implement GCC code coverage analysis
In order to provide some insight on what code is executed during
coreboot's run time and how well our test scenarios work, this
adds code coverage support to coreboot's ram stage. This should
be easily adaptable for payloads, and maybe even romstage.
See http://gcc.gnu.org/onlinedocs/gcc/Gcov.html for
more information.
To instrument coreboot, select CONFIG_COVERAGE ("Code coverage
support") in Kconfig, and recompile coreboot. coreboot will then
store its code coverage information into CBMEM, if possible.
Then, run "cbmem -CV" as root on the target system running the
instrumented coreboot binary. This will create a whole bunch of
.gcda files that contain coverage information. Tar them up, copy
them to your build system machine, and untar them. Then you can
use your favorite coverage utility (gcov, lcov, ...) to visualize
code coverage.
For a sneak peak of what will expect you, please take a look
at http://www.coreboot.org/~stepan/coreboot-coverage/
Change-Id: Ib287d8309878a1f5c4be770c38b1bc0bb3aa6ec7
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/2052
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Martin Roth <martin@se-eng.com>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-12-19 01:23:28 +01:00
|
|
|
ramstage-$(CONFIG_COVERAGE) += libgcov.c
|
2013-03-13 22:35:01 +01:00
|
|
|
ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += edid.c
|
2013-03-23 02:44:46 +01:00
|
|
|
ramstage-y += memrange.c
|
2013-05-06 19:20:52 +02:00
|
|
|
ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c
|
2013-04-30 16:58:12 +02:00
|
|
|
ramstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c
|
2010-02-22 05:33:13 +01:00
|
|
|
|
2013-03-13 18:41:44 +01:00
|
|
|
# The CBMEM implementations are chosen based on CONFIG_DYNAMIC_CBMEM.
|
|
|
|
ifeq ($(CONFIG_DYNAMIC_CBMEM),y)
|
|
|
|
ramstage-y += dynamic_cbmem.c
|
|
|
|
romstage-y += dynamic_cbmem.c
|
|
|
|
else
|
|
|
|
ramstage-y += cbmem.c
|
|
|
|
romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c
|
|
|
|
endif # CONFIG_DYNAMIC_CBMEM
|
|
|
|
ramstage-y += cbmem_info.c
|
|
|
|
|
2012-11-16 14:50:32 +01:00
|
|
|
ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
|
2011-04-15 00:28:00 +02:00
|
|
|
|
2012-03-31 01:28:20 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
|
|
|
|
smm-y += memset.c
|
|
|
|
endif
|
2011-10-26 01:43:34 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
|
|
|
|
smm-y += memcpy.c
|
|
|
|
endif
|
2013-07-01 13:28:23 +02:00
|
|
|
ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y)
|
|
|
|
smm-y += memmove.c
|
|
|
|
endif
|
2012-03-31 01:28:20 +02:00
|
|
|
smm-y += cbfs.c memcmp.c
|
2011-04-15 00:28:00 +02:00
|
|
|
smm-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c
|
2011-04-27 01:47:04 +02:00
|
|
|
smm-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c
|
2013-03-07 05:43:55 +01:00
|
|
|
smm-y += gcc.c
|
2010-03-29 15:04:13 +02:00
|
|
|
|
2010-09-30 18:55:02 +02:00
|
|
|
$(obj)/lib/version.ramstage.o : $(obj)/build.h
|
2011-07-30 00:34:14 +02:00
|
|
|
|
|
|
|
OPTION_TABLE_H:=
|
|
|
|
ifeq ($(CONFIG_HAVE_OPTION_TABLE),y)
|
|
|
|
OPTION_TABLE_H:=$(obj)/option_table.h
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(obj)/lib/uart8250mem.smm.o : $(OPTION_TABLE_H)
|
2011-08-11 23:51:31 +02:00
|
|
|
$(obj)/lib/uart8250.smm.o : $(OPTION_TABLE_H)
|
2011-07-30 00:34:14 +02:00
|
|
|
|
2012-12-24 21:28:37 +01:00
|
|
|
ifeq ($(CONFIG_RELOCATABLE_MODULES),y)
|
|
|
|
ramstage-y += rmodule.c
|
2013-02-09 00:28:04 +01:00
|
|
|
romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c
|
2012-12-24 21:28:37 +01:00
|
|
|
|
|
|
|
RMODULE_LDSCRIPT := $(src)/lib/rmodule.ld
|
|
|
|
RMODULE_LDFLAGS := -nostartfiles -shared -z defs -nostdlib -Bsymbolic -T $(RMODULE_LDSCRIPT)
|
|
|
|
|
|
|
|
# rmodule_link_rules is a function that should be called with:
|
|
|
|
# (1) the object name to link
|
|
|
|
# (2) the dependencies
|
|
|
|
# (3) heap size of the relocatable module
|
|
|
|
# It will create the necessary Make rules.
|
|
|
|
define rmodule_link
|
|
|
|
$(strip $(1)): $(strip $(2)) $$(RMODULE_LDSCRIPT) $$(obj)/ldoptions
|
|
|
|
$$(LD) $$(RMODULE_LDFLAGS) --defsym=__heap_size=$(strip $(3)) -o $$@ $(strip $(2))
|
|
|
|
$$(NM) -n $$@ > $$(basename $$@).map
|
|
|
|
endef
|
|
|
|
|
|
|
|
endif
|
2013-03-01 23:56:34 +01:00
|
|
|
|