blob: 3b7663ea0409223850dfa70946c2f9f1e47b3f71 [file] [log] [blame]
Aaron Durbin76c37002012-10-30 09:03:43 -05001##
2## This file is part of the coreboot project.
3##
4## Copyright (C) 2010 Google Inc.
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
17## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18##
19
20# Run an intermediate step when producing coreboot.rom
21# that adds additional components to the final firmware
22# image outside of CBFS
Duncan Laurie9238c112013-04-19 11:03:40 -070023INTERMEDIATE:=lynxpoint_add_me
Aaron Durbin76c37002012-10-30 09:03:43 -050024
25ramstage-y += pch.c
26ramstage-y += azalia.c
27ramstage-y += lpc.c
28ramstage-y += pci.c
29ramstage-y += pcie.c
30ramstage-y += sata.c
31ramstage-y += usb_ehci.c
Duncan Laurie2d9d39a2013-05-29 15:27:55 -070032ramstage-y += usb_xhci.c
Aaron Durbin76c37002012-10-30 09:03:43 -050033ramstage-y += me_9.x.c
34ramstage-y += smbus.c
Duncan Laurie0a7c49e2013-06-20 12:40:55 -070035ramstage-y += hda_verb.c
Duncan Laurieb39ba2e2013-03-22 11:21:14 -070036ramstage-$(CONFIG_INTEL_LYNXPOINT_LP) += serialio.c
Aaron Durbin76c37002012-10-30 09:03:43 -050037
Vladimir Serbinenko75c83872014-09-05 01:01:31 +020038ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c
39
Duncan Laurie8584b222013-02-15 13:52:28 -080040ramstage-y += rcba.c
Aaron Durbin76c37002012-10-30 09:03:43 -050041ramstage-y += me_status.c
42ramstage-y += reset.c
43ramstage-y += watchdog.c
44ramstage-y += acpi.c
45
46ramstage-$(CONFIG_ELOG) += elog.c
Vladimir Serbinenko42c4a9d2014-02-16 17:13:19 +010047ramstage-y += ../common/spi.c
48smm-$(CONFIG_SPI_FLASH_SMM) += ../common/spi.c
Aaron Durbin76c37002012-10-30 09:03:43 -050049
Duncan Laurie55cdf552013-03-08 16:01:44 -080050ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c pmutil.c
Duncan Laurieaf980622013-07-18 23:02:18 -070051smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c me_9.x.c finalize.c pch.c
Duncan Laurie1f529082013-07-30 15:53:45 -070052smm-$(CONFIG_HAVE_SMI_HANDLER) += pmutil.c usb_ehci.c usb_xhci.c
Aaron Durbin76c37002012-10-30 09:03:43 -050053
Aaron Durbin239c2e82012-12-19 11:31:17 -060054romstage-y += early_usb.c early_smbus.c early_me.c me_status.c early_pch.c
Duncan Laurie8584b222013-02-15 13:52:28 -080055romstage-y += reset.c early_spi.c rcba.c
Aaron Durbin76c37002012-10-30 09:03:43 -050056
Duncan Laurie045f1532012-12-17 11:29:10 -080057ifeq ($(CONFIG_INTEL_LYNXPOINT_LP),y)
58romstage-y += lp_gpio.c
59ramstage-y += lp_gpio.c
Shawn Nematbakhshccb12fb2013-07-03 17:55:38 -070060smm-$(CONFIG_HAVE_SMI_HANDLER) += lp_gpio.c
Duncan Laurie045f1532012-12-17 11:29:10 -080061else
62romstage-y += gpio.c
63ramstage-y += gpio.c
Shawn Nematbakhshccb12fb2013-07-03 17:55:38 -070064smm-$(CONFIG_HAVE_SMI_HANDLER) += gpio.c
Duncan Laurie045f1532012-12-17 11:29:10 -080065endif
66
Paul Menzel5218e612014-06-16 09:28:36 +020067ifeq ($(CONFIG_BUILD_WITH_FAKE_IFD),y)
68IFD_BIN_PATH := $(objgenerated)/ifdfake.bin
69IFD_SECTIONS := $(addprefix -b ,$(CONFIG_IFD_BIOS_SECTION:"%"=%)) \
70 $(addprefix -m ,$(CONFIG_IFD_ME_SECTION:"%"=%)) \
71 $(addprefix -g ,$(CONFIG_IFD_GBE_SECTION:"%"=%)) \
72 $(addprefix -p ,$(CONFIG_IFD_PLATFORM_SECTION:"%"=%))
73else
74IFD_BIN_PATH := $(CONFIG_IFD_BIN_PATH)
75endif
76
77lynxpoint_add_me: $(obj)/coreboot.pre $(IFDTOOL) $(IFDFAKE)
78ifeq ($(CONFIG_BUILD_WITH_FAKE_IFD),y)
79 printf "\n** WARNING **\n"
80 printf "Coreboot will be built with a fake Intel Firmware Descriptor (IFD).\n"
81 printf "Never write a complete coreboot.rom with a fake IFD to your board's\n"
82 printf "flash ROM! Make sure that you only write valid flash regions.\n\n"
83 printf " IFDFAKE Building a fake Intel Firmware Descriptor\n"
84 $(IFDFAKE) $(IFD_SECTIONS) $(IFD_BIN_PATH)
85endif
Aaron Durbin76c37002012-10-30 09:03:43 -050086 printf " DD Adding Intel Firmware Descriptor\n"
Paul Menzel5218e612014-06-16 09:28:36 +020087 dd if=$(IFD_BIN_PATH) \
Aaron Durbin76c37002012-10-30 09:03:43 -050088 of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1
Paul Menzel0089c242014-06-16 14:59:44 +020089ifeq ($(CONFIG_HAVE_ME_BIN),y)
Aaron Durbin76c37002012-10-30 09:03:43 -050090 printf " IFDTOOL me.bin -> coreboot.pre\n"
91 $(objutil)/ifdtool/ifdtool \
Patrick Georgi3cc151e2013-06-13 15:07:02 +020092 -i ME:$(CONFIG_ME_BIN_PATH) \
Aaron Durbin76c37002012-10-30 09:03:43 -050093 $(obj)/coreboot.pre
94 mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre
Paul Menzel0089c242014-06-16 14:59:44 +020095endif
Aaron Durbin76c37002012-10-30 09:03:43 -050096ifeq ($(CONFIG_LOCK_MANAGEMENT_ENGINE),y)
97 printf " IFDTOOL Locking Management Engine\n"
98 $(objutil)/ifdtool/ifdtool -l $(obj)/coreboot.pre
99 mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre
Paul Menzel5218e612014-06-16 09:28:36 +0200100else ifneq ($(CONFIG_BUILD_WITH_FAKE_IFD),y)
Aaron Durbin76c37002012-10-30 09:03:43 -0500101 printf " IFDTOOL Unlocking Management Engine\n"
102 $(objutil)/ifdtool/ifdtool -u $(obj)/coreboot.pre
103 mv $(obj)/coreboot.pre.new $(obj)/coreboot.pre
104endif
105
106PHONY += lynxpoint_add_me