blob: 6aa10f8f7be76d1064462d5677dd431be5879a89 [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
Vadim Bendeburyef77f872014-12-10 20:42:58 -080036romstage-y += blobs_init.c
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070037romstage-y += gpio.c
Vadim Bendebury0e2d9b62014-05-01 19:37:18 -070038romstage-$(CONFIG_SPI_FLASH) += spi.c
Marc Jones017287a2014-12-29 16:52:59 -070039romstage-y += timer.c
Vadim Bendebury11c4c922014-04-23 14:26:01 -070040romstage-$(CONFIG_DRIVERS_UART) += uart.c
Vadim Bendebury15c98b02014-05-01 14:45:56 -070041romstage-y += cbmem.c
Furquan Shaikh76570572014-03-19 14:29:48 -070042
Vikas Das08f249e2014-09-22 17:49:56 -070043ramstage-y += blobs_init.c
Vadim Bendebury15c98b02014-05-01 14:45:56 -070044ramstage-y += cbmem.c
Vadim Bendeburydb3e2f02014-04-09 19:23:54 -070045ramstage-y += clock.c
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070046ramstage-y += gpio.c
Vadim Bendebury3cfb6a02015-02-11 15:13:04 -080047ramstage-y += lcc.c
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070048ramstage-y += soc.c
Vadim Bendebury0e2d9b62014-05-01 19:37:18 -070049ramstage-$(CONFIG_SPI_FLASH) += spi.c
Vadim Bendeburyf4b209f2014-04-09 19:23:04 -070050ramstage-y += timer.c
Vadim Bendebury7c256402015-01-13 13:07:48 -080051ramstage-y += uart.c # Want the UART always ready for the kernels' earlyprintk
Julius Werner028cba92014-05-30 18:01:44 -070052ramstage-y += usb.c
Vikas Das08f249e2014-09-22 17:49:56 -070053ramstage-y += tz_wrapper.S
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070054
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070055ifeq ($(CONFIG_USE_BLOBS),y)
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070056
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070057# Generate the actual coreboot bootblock code
58$(objcbfs)/bootblock.raw: $(objcbfs)/bootblock.elf
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070059 @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070060 $(OBJCOPY_bootblock) -O binary $< $@.tmp
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070061 @mv $@.tmp $@
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070062
63# Add MBN header to allow SBL3 to start coreboot bootblock
64$(objcbfs)/bootblock.mbn: $(objcbfs)/bootblock.raw
65 @printf " ADD MBN $(subst $(obj)/,,$(@))\n"
Julius Wernerec5e5e02014-08-20 15:29:56 -070066 ./util/ipqheader/ipqheader.py $(call loadaddr,bootblock) $< $@.tmp
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070067 @mv $@.tmp $@
68
69# Create a complete bootblock which will start up the system
Vadim Bendeburye83c80c2014-04-15 14:42:30 -070070$(objcbfs)/bootblock.bin: $(call strip_quotes,$(CONFIG_SBL_BLOB)) \
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070071 $(objcbfs)/bootblock.mbn
Vadim Bendeburye39ac752014-11-30 16:10:46 -080072 @printf " MBNCAT $(subst $(obj)/,,$(@))\n"
73 @util/ipqheader/mbncat.py -o $@.tmp $^
Vadim Bendebury9cb70ae2014-04-07 18:59:53 -070074 @mv $@.tmp $@
75
Vadim Bendeburyb1709bd2014-04-07 15:26:39 -070076endif
Furquan Shaikh75b4beb2014-04-10 20:53:32 -070077
Furquan Shaikh9d91aba2014-04-10 20:35:05 -070078CPPFLAGS_common += -Isrc/soc/qualcomm/ipq806x/include
Vadim Bendeburyf85640d2014-12-06 18:24:56 -080079
80# List of binary blobs coreboot needs in CBFS to be able to boot up this SOC
81mbn-files := cdt.mbn ddr.mbn rpm.mbn tz.mbn
82
83# Location of the binary blobs
84mbn-root := 3rdparty/cpu/qualcomm/ipq806x
85
86# Create make variables to aid cbfs-files-handler in processing the blobs (add
87# them all as raw binaries at the root level).
88$(foreach f,$(mbn-files),$(eval cbfs-files-y += $(f))\
89 $(eval $(f)-file := $(mbn-root)/$(f))\
90 $(eval $(f)-type := raw))