blob: b2b627c07f2402b1fc3f5f6be4141eccf97051c6 [file] [log] [blame]
Furquan Shaikh2af76f42014-04-28 16:39:40 -07001################################################################################
2##
3## This file is part of the coreboot project.
4##
5## Copyright (C) 2014 Google Inc.
6## Copyright (C) 2012-2013 The ChromiumOS Authors
7## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
8## Copyright (C) 2009-2010 coresystems GmbH
9## Copyright (C) 2009 Ronald G. Minnich
10##
11## This program is free software; you can redistribute it and/or modify
12## it under the terms of the GNU General Public License as published by
13## the Free Software Foundation; version 2 of the License.
14##
15## This program is distributed in the hope that it will be useful,
16## but WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18## GNU General Public License for more details.
19##
20## You should have received a copy of the GNU General Public License
21## along with this program; if not, write to the Free Software
22## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23##
24################################################################################
25
26################################################################################
27# Take care of subdirectories
28################################################################################
29
30subdirs-y += armv8/
31
32################################################################################
33# ARM specific options
34################################################################################
35
36ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y)
37CBFSTOOL_PRE1_OPTS = -m arm64 -b $(CONFIG_BOOTBLOCK_ROM_OFFSET) -H $(CONFIG_CBFS_HEADER_ROM_OFFSET) -o $(CONFIG_CBFS_ROM_OFFSET)
38endif
39
Marc Jones17b9c192015-01-16 13:45:23 -070040ifeq ($(CONFIG_ARCH_ARM64),y)
41stages_c = $(src)/arch/arm64/stages.c
42stages_o = $(obj)/arch/arm64/stages.o
43
44$(stages_o): $(stages_c) $(obj)/config.h
45 @printf " CC $(subst $(obj)/,,$(@))\n"
46 $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm
47
48endif
49
Furquan Shaikh2af76f42014-04-28 16:39:40 -070050################################################################################
51# bootblock
52################################################################################
53
54ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y)
55
56bootblock-y += div0.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070057bootblock-y += id.S
58$(obj)/arch/arm64/id.bootblock.o: $(obj)/build.h
59
Aaron Durbinb3847e62015-03-20 15:55:08 -050060bootblock-y += boot.c
Aaron Durbin30cda7e2014-07-15 10:25:48 -050061bootblock-y += c_entry.c
62bootblock-y += stage_entry.S
Furquan Shaikh2af76f42014-04-28 16:39:40 -070063bootblock-y += stages.c
64bootblock-y += eabi_compat.c
Furquan Shaikh668316b2014-08-30 21:59:11 -070065bootblock-y += transition.c transition_asm.S
66
Aaron Durbin00263d02014-07-10 17:01:22 -050067bootblock-y += ../../lib/memset.c
68bootblock-y += ../../lib/memcpy.c
69bootblock-y += ../../lib/memmove.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070070
71# Build the bootblock
72
Julius Wernerec5e5e02014-08-20 15:29:56 -070073$(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h
Furquan Shaikh2af76f42014-04-28 16:39:40 -070074 @printf " LINK $(subst $(obj)/,,$(@))\n"
Julius Wernerec5e5e02014-08-20 15:29:56 -070075 $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.bootblock.ld
Furquan Shaikh2af76f42014-04-28 16:39:40 -070076
77endif # CONFIG_ARCH_BOOTBLOCK_ARM64
78
79################################################################################
80# romstage
81################################################################################
82
83ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y)
84
Aaron Durbinb3847e62015-03-20 15:55:08 -050085romstage-y += boot.c
Aaron Durbin30cda7e2014-07-15 10:25:48 -050086romstage-y += c_entry.c
87romstage-y += stage_entry.S
Furquan Shaikh2af76f42014-04-28 16:39:40 -070088romstage-y += stages.c
89romstage-y += div0.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070090romstage-y += eabi_compat.c
Aaron Durbin00263d02014-07-10 17:01:22 -050091romstage-y += ../../lib/memset.c
92romstage-y += ../../lib/memcpy.c
93romstage-y += ../../lib/memmove.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070094romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Furquan Shaikh668316b2014-08-30 21:59:11 -070095romstage-y += transition.c transition_asm.S
Furquan Shaikh2af76f42014-04-28 16:39:40 -070096
Furquan Shaikha742ef12014-07-23 11:41:59 -070097rmodules_arm64-y += ../../lib/memset.c
98rmodules_arm64-y += ../../lib/memcpy.c
99rmodules_arm64-y += ../../lib/memmove.c
100rmodules_arm64-y += eabi_compat.c
101
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700102# Build the romstage
Marc Jones17b9c192015-01-16 13:45:23 -0700103VBOOT_STUB_DEPS += $(obj)/arch/arm/eabi_compat.rmodules_arm64.o
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700104
Julius Wernerec5e5e02014-08-20 15:29:56 -0700105$(objcbfs)/romstage.debug: $$(romstage-objs)
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700106 @printf " LINK $(subst $(obj)/,,$(@))\n"
Julius Wernerec5e5e02014-08-20 15:29:56 -0700107 $(LD_romstage) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(filter-out %.ld,$(romstage-objs)) --end-group -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.romstage.ld
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700108
109endif # CONFIG_ARCH_ROMSTAGE_ARM64
110
111################################################################################
112# ramstage
113################################################################################
114
115ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM64),y)
116
Aaron Durbin30cda7e2014-07-15 10:25:48 -0500117ramstage-y += c_entry.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700118ramstage-y += stages.c
119ramstage-y += div0.c
120ramstage-y += cpu.c
Aaron Durbinb30c9b12014-09-18 11:52:16 -0500121ramstage-y += cpu_ramstage.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700122ramstage-y += eabi_compat.c
123ramstage-y += boot.c
124ramstage-y += tables.c
Aaron Durbin00263d02014-07-10 17:01:22 -0500125ramstage-y += ../../lib/memset.c
126ramstage-y += ../../lib/memcpy.c
127ramstage-y += ../../lib/memmove.c
Aaron Durbin0df877a2014-07-10 12:40:30 -0500128ramstage-y += stage_entry.S
Aaron Durbin5add4352014-09-17 11:43:20 -0500129ramstage-$(CONFIG_ARCH_SPINTABLE) += spintable.c spintable_asm.S
Furquan Shaikh668316b2014-08-30 21:59:11 -0700130ramstage-y += transition.c transition_asm.S
131
Furquan Shaikhfbff9082014-07-22 15:59:16 -0700132rmodules_arm64-y += ../../lib/memset.c
133rmodules_arm64-y += ../../lib/memcpy.c
134rmodules_arm64-y += ../../lib/memmove.c
135rmodules_arm64-y += eabi_compat.c
Furquan Shaikhabde3b52014-08-26 15:39:51 -0700136
137secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += stage_entry.S
138secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memset.c
139secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memcmp.c
140secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memcpy.c
141
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700142ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
143
Marc Jones17b9c192015-01-16 13:45:23 -0700144ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700145
146# Build the ramstage
147
Julius Wernerec5e5e02014-08-20 15:29:56 -0700148$(objcbfs)/ramstage.debug: $$(ramstage-objs)
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700149 @printf " CC $(subst $(obj)/,,$(@))\n"
Julius Wernerec5e5e02014-08-20 15:29:56 -0700150 $(LD_ramstage) -nostdlib --gc-sections -o $@ -L$(obj) --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.ramstage.ld
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700151
152endif # CONFIG_ARCH_RAMSTAGE_ARM64