blob: 0c4778d996ff8111ceb24ec7d47395b8eb090a9e [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 The ChromiumOS Authors
6##
7## This program is free software; you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation; version 2 of the License.
10##
11## This program is distributed in the hope that it will be useful,
12## but WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14## GNU General Public License for more details.
15##
16## You should have received a copy of the GNU General Public License
17## along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010018## Foundation, Inc.
Furquan Shaikh2af76f42014-04-28 16:39:40 -070019##
20################################################################################
21
Furquan Shaikh26a87472014-06-11 14:48:37 -070022subdirs-y += lib/
23
Julius Wernerf1df50e2015-05-07 16:59:31 -070024subdirs-$(CONFIG_ARM64_USE_SECURE_MONITOR) += secmon/
Furquan Shaikhabde3b52014-08-26 15:39:51 -070025
Furquan Shaikh2af76f42014-04-28 16:39:40 -070026armv8_flags = -march=armv8-a -I$(src)/arch/arm64/include/armv8/ -D__COREBOOT_ARM_ARCH__=8
27
28armv8_asm_flags = $(armv8_flags)
29
30################################################################################
31## bootblock
32################################################################################
Marc Jones17b9c192015-01-16 13:45:23 -070033ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV8_64),y)
Furquan Shaikh2af76f42014-04-28 16:39:40 -070034
Julius Wernerc3e7c4e2014-09-19 13:18:16 -070035ifneq ($(CONFIG_ARM64_BOOTBLOCK_CUSTOM),y)
Furquan Shaikh2af76f42014-04-28 16:39:40 -070036bootblock-y += bootblock.S
Julius Wernerc3e7c4e2014-09-19 13:18:16 -070037bootblock-y += bootblock_simple.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070038endif
Furquan Shaikh2af76f42014-04-28 16:39:40 -070039bootblock-y += cache.c
Joseph Loc4301f72015-04-14 16:03:58 +080040bootblock-y += cache_helpers.S
Furquan Shaikh2af76f42014-04-28 16:39:40 -070041bootblock-y += cpu.S
42bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070043
44bootblock-c-ccopts += $(armv8_flags)
45bootblock-S-ccopts += $(armv8_asm_flags)
46
47endif
48
49################################################################################
Furquan Shaikh6f33f0a2014-10-02 16:43:19 -070050## verstage
51################################################################################
52ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV8_64),y)
53
54verstage-y += cache.c
55verstage-y += cpu.S
Joseph Loc4301f72015-04-14 16:03:58 +080056verstage-y += cache_helpers.S
Furquan Shaikh6f33f0a2014-10-02 16:43:19 -070057verstage-y += exception.c
58
Patrick Georgi27ef6022015-04-30 14:25:14 +020059libverstage-c-ccopts += $(armv8_flags)
60libverstage-S-ccopts += $(armv8_asm_flags)
Furquan Shaikh6f33f0a2014-10-02 16:43:19 -070061verstage-c-ccopts += $(armv8_flags)
62verstage-S-ccopts += $(armv8_asm_flags)
63
64endif
65
66################################################################################
Furquan Shaikh2af76f42014-04-28 16:39:40 -070067## romstage
68################################################################################
Marc Jones17b9c192015-01-16 13:45:23 -070069ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV8_64),y)
Furquan Shaikh2af76f42014-04-28 16:39:40 -070070
71romstage-y += cache.c
Joseph Loc4301f72015-04-14 16:03:58 +080072romstage-y += cache_helpers.S
Furquan Shaikh2af76f42014-04-28 16:39:40 -070073romstage-y += cpu.S
74romstage-y += exception.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070075
76romstage-c-ccopts += $(armv8_flags)
77romstage-S-ccopts += $(armv8_asm_flags)
78
Furquan Shaikha742ef12014-07-23 11:41:59 -070079rmodules_arm64-c-ccopts += $(armv8_flags)
80rmodules_arm64-S-ccopts += $(armv8_asm_flags)
81
Furquan Shaikh2af76f42014-04-28 16:39:40 -070082endif
83
84################################################################################
85## ramstage
86################################################################################
Marc Jones17b9c192015-01-16 13:45:23 -070087ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV8_64),y)
Furquan Shaikh2af76f42014-04-28 16:39:40 -070088
89ramstage-y += cache.c
Joseph Loc4301f72015-04-14 16:03:58 +080090ramstage-y += cache_helpers.S
Furquan Shaikh2af76f42014-04-28 16:39:40 -070091ramstage-y += cpu.S
92ramstage-y += exception.c
Furquan Shaikh24869572014-07-17 11:36:08 -070093ramstage-y += mmu.c
Furquan Shaikh2af76f42014-04-28 16:39:40 -070094
Julius Wernerf1df50e2015-05-07 16:59:31 -070095ramstage-$(CONFIG_ARM64_USE_SECURE_MONITOR) += secmon_loader.c
Furquan Shaikhabde3b52014-08-26 15:39:51 -070096
Furquan Shaikh2af76f42014-04-28 16:39:40 -070097ramstage-c-ccopts += $(armv8_flags)
98ramstage-S-ccopts += $(armv8_asm_flags)
99
Marc Jones17b9c192015-01-16 13:45:23 -0700100rmodules_arm64-c-ccopts += $(armv8_flags)
101rmodules_arm64-S-ccopts += $(armv8_asm_flags)
102
Furquan Shaikh2af76f42014-04-28 16:39:40 -0700103endif