blob: 5bf72b2a883f1c131f0089e782352fb8c0004c5b [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
40################################################################################
41# bootblock
42################################################################################
43
44ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y)
45
46bootblock-y += div0.c
47bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += early_console.c
48
49bootblock-y += id.S
50$(obj)/arch/arm64/id.bootblock.o: $(obj)/build.h
51
52bootblock-y += stages.c
53bootblock-y += eabi_compat.c
54
55bootblock-y += memset.S
56bootblock-y += memcpy.S
57bootblock-y += memmove.S
58
59# Build the bootblock
60
61$(objcbfs)/bootblock.debug: $(src)/arch/arm64/bootblock.ld $(obj)/ldoptions $$(bootblock-objs) $(obj)/config.h
62 @printf " LINK $(subst $(obj)/,,$(@))\n"
Patrick Georgi4f75af92014-11-29 11:41:35 +010063 $(LD_bootblock) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(src)/arch/arm64/bootblock.ld
Furquan Shaikh2af76f42014-04-28 16:39:40 -070064
65endif # CONFIG_ARCH_BOOTBLOCK_ARM64
66
67################################################################################
68# romstage
69################################################################################
70
71ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y)
72
73romstage-y += stages.c
74romstage-y += div0.c
75romstage-y += early_console.c
76romstage-y += eabi_compat.c
77romstage-y += memset.S
78romstage-y += memcpy.S
79romstage-y += memmove.S
80romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
81
82# Build the romstage
83
84$(objcbfs)/romstage.debug: $$(romstage-objs) $(src)/arch/arm64/romstage.ld $(obj)/ldoptions
85 @printf " LINK $(subst $(obj)/,,$(@))\n"
Patrick Georgi4f75af92014-11-29 11:41:35 +010086 $(LD_romstage) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(romstage-objs) --end-group -T $(src)/arch/arm64/romstage.ld
Furquan Shaikh2af76f42014-04-28 16:39:40 -070087
88endif # CONFIG_ARCH_ROMSTAGE_ARM64
89
90################################################################################
91# ramstage
92################################################################################
93
94ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM64),y)
95
96ramstage-y += stages.c
97ramstage-y += div0.c
98ramstage-y += cpu.c
99ramstage-y += eabi_compat.c
100ramstage-y += boot.c
101ramstage-y += tables.c
102ramstage-y += memset.S
103ramstage-y += memcpy.S
104ramstage-y += memmove.S
105
106rmodules_$(ARCH-ramstage-y) += memset.S
107rmodules_$(ARCH-ramstage-y) += memcpy.S
108rmodules_$(ARCH-ramstage-y) += memmove.S
109rmodules_$(ARCH-ramstage-y) += eabi_compat.c
110
111VBOOT_STUB_DEPS += $(obj)/arch/arm64/eabi_compat.rmodules.o
112
113$(eval $(call create_class_compiler,rmodules,arm64))
114
115ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
116
117ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c
118
119# Build the ramstage
120
121$(objcbfs)/ramstage.debug: $$(ramstage-objs) $(src)/arch/arm64/ramstage.ld $(obj)/ldoptions
122 @printf " CC $(subst $(obj)/,,$(@))\n"
Patrick Georgi4f75af92014-11-29 11:41:35 +0100123 $(LD_ramstage) -nostdlib --gc-sections -o $@ --start-group $(ramstage-objs) --end-group -T $(src)/arch/arm64/ramstage.ld
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700124
125endif # CONFIG_ARCH_RAMSTAGE_ARM64