blob: 0d5d59ca7fc2bb7e264d6d3a87668927b14821b2 [file] [log] [blame]
Vadim Bendebury0b341b32014-04-23 11:09:44 -07001##
2## This file is part of the coreboot project.
3##
4## Copyright 2014 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
Vadim Bendeburydb3e2f02014-04-09 19:23:54 -070020bootblock-y += clock.c
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070021bootblock-y += gpio.c
Vadim Bendebury0e2d9b62014-05-01 19:37:18 -070022bootblock-$(CONFIG_SPI_FLASH) += spi.c
Marc Jones017287a2014-12-29 16:52:59 -070023bootblock-y += timer.c
Vadim Bendebury11c4c922014-04-23 14:26:01 -070024bootblock-$(CONFIG_DRIVERS_UART) += uart.c
Furquan Shaikh76570572014-03-19 14:29:48 -070025
Vadim Bendeburyfa00ae72014-12-10 20:11:30 -080026verstage-y += clock.c
27verstage-y += gpio.c
Vadim Bendebury6fe4e5e2014-12-06 10:44:58 -080028verstage-y += gsbi.c
29verstage-y += i2c.c
30verstage-y += qup.c
Vadim Bendeburyfa00ae72014-12-10 20:11:30 -080031verstage-y += spi.c
32verstage-y += timer.c
33verstage-$(CONFIG_CONSOLE_SERIAL_IPQ806X) += uart.c
34
Vadim Bendeburydb3e2f02014-04-09 19:23:54 -070035romstage-y += clock.c
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070036romstage-y += gpio.c
Vadim Bendebury0e2d9b62014-05-01 19:37:18 -070037romstage-$(CONFIG_SPI_FLASH) += spi.c
Marc Jones017287a2014-12-29 16:52:59 -070038romstage-y += timer.c
Vadim Bendebury11c4c922014-04-23 14:26:01 -070039romstage-$(CONFIG_DRIVERS_UART) += uart.c
Vadim Bendebury15c98b02014-05-01 14:45:56 -070040romstage-y += cbmem.c
Furquan Shaikh76570572014-03-19 14:29:48 -070041
Vadim Bendebury15c98b02014-05-01 14:45:56 -070042ramstage-y += cbmem.c
Vadim Bendeburydb3e2f02014-04-09 19:23:54 -070043ramstage-y += clock.c
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070044ramstage-y += gpio.c
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070045ramstage-y += soc.c
Vadim Bendebury0e2d9b62014-05-01 19:37:18 -070046ramstage-$(CONFIG_SPI_FLASH) += spi.c
Vadim Bendeburyf4b209f2014-04-09 19:23:04 -070047ramstage-y += timer.c
Vadim Bendebury11c4c922014-04-23 14:26:01 -070048ramstage-$(CONFIG_DRIVERS_UART) += uart.c
Julius Werner028cba92014-05-30 18:01:44 -070049ramstage-y += usb.c
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070050
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070051ifeq ($(CONFIG_USE_BLOBS),y)
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070052
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070053# Generate the actual coreboot bootblock code
54$(objcbfs)/bootblock.raw: $(objcbfs)/bootblock.elf
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070055 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070056 $(OBJCOPY_bootblock) -O binary $< $@.tmp
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070057 @mv $@.tmp $@
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070058
59# Add MBN header to allow SBL3 to start coreboot bootblock
60$(objcbfs)/bootblock.mbn: $(objcbfs)/bootblock.raw
61 @printf " ADD MBN $(subst $(obj)/,,$(@))\n"
Julius Wernerec5e5e02014-08-20 15:29:56 -070062 ./util/ipqheader/ipqheader.py $(call loadaddr,bootblock) $< $@.tmp
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070063 @mv $@.tmp $@
64
65# Create a complete bootblock which will start up the system
Vadim Bendeburye83c80c2014-04-15 14:42:30 -070066$(objcbfs)/bootblock.bin: $(call strip_quotes,$(CONFIG_SBL_BLOB)) \
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070067 $(objcbfs)/bootblock.mbn
Vadim Bendeburye39ac752014-11-30 16:10:46 -080068 @printf " MBNCAT $(subst $(obj)/,,$(@))\n"
69 @util/ipqheader/mbncat.py -o $@.tmp $^
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070070 @mv $@.tmp $@
71
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070072endif
Furquan Shaikh75b4beb2014-04-10 20:53:32 -070073
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070074CPPFLAGS_common += -Isrc/soc/qualcomm/ipq806x/include
Vadim Bendeburyf85640d2014-12-06 18:24:56 -080075
76# List of binary blobs coreboot needs in CBFS to be able to boot up this SOC
77mbn-files := cdt.mbn ddr.mbn rpm.mbn tz.mbn
78
79# Location of the binary blobs
80mbn-root := 3rdparty/cpu/qualcomm/ipq806x
81
82# Create make variables to aid cbfs-files-handler in processing the blobs (add
83# them all as raw binaries at the root level).
84$(foreach f,$(mbn-files),$(eval cbfs-files-y += $(f))\
85 $(eval $(f)-file := $(mbn-root)/$(f))\
86 $(eval $(f)-type := raw))