blob: a46ef87e8ef3adebb98ae7a9524a0623befe6279 [file] [log] [blame]
Gabe Black51edd542013-09-30 23:00:33 -07001################################################################################
2##
3## This file is part of the coreboot project.
4##
5## Copyright (C) 2013 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.
Gabe Black51edd542013-09-30 23:00:33 -070019##
20###############################################################################
21
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070022armv7_flags = -mthumb -I$(src)/arch/arm/include/armv7/ -D__COREBOOT_ARM_ARCH__=7
23armv7-a_flags = -march=armv7-a $(armv7_flags)
24armv7-m_flags = -march=armv7-m $(armv7_flags)
25
26armv7_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated
27armv7-a_asm_flags = $(armv7-a_flags) $(armv7_asm_flags)
28armv7-m_asm_flags = $(armv7-m_flags) $(armv7_asm_flags)
Gabe Black51edd542013-09-30 23:00:33 -070029
30###############################################################################
31# bootblock
32###############################################################################
33
34ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7),y)
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070035bootblock-c-ccopts += $(armv7-a_flags)
36bootblock-S-ccopts += $(armv7-a_asm_flags)
Gabe Black51edd542013-09-30 23:00:33 -070037
38ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
39bootblock-y += bootblock.S
40bootblock-$(CONFIG_BOOTBLOCK_SIMPLE) += bootblock_simple.c
41endif
42
43bootblock-y += cache.c
Julius Werner1f8d2462014-01-15 14:13:25 -080044bootblock-y += cpu.S
Julius Werner85620db2013-11-13 18:22:15 -080045bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c
46bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception_asm.S
Gabe Black51edd542013-09-30 23:00:33 -070047bootblock-y += mmu.c
48
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070049else ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7_M),y)
50bootblock-c-ccopts += $(armv7-m_flags)
51bootblock-S-ccopts += $(armv7-m_asm_flags)
52
53ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y)
Daisuke Nojiric5a4c122014-10-23 11:51:18 -070054bootblock-y += bootblock_m.S
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070055bootblock-y += bootblock_simple.c
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070056endif
Daisuke Nojiriaf3b2a12014-10-23 12:39:11 -070057bootblock-y += exception_m.c
58bootblock-y += cache_m.c
Gabe Black51edd542013-09-30 23:00:33 -070059
60endif # CONFIG_ARCH_BOOTBLOCK_ARMV7
61
Patrick Georgiddcd9bd2015-04-27 18:02:11 +020062bootblock-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
63
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070064################################################################################
65## verification stage
66################################################################################
67
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070068ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7),y)
Patrick Georgi27ef6022015-04-30 14:25:14 +020069libverstage-c-ccopts += $(armv7-a_flags)
70libverstage-S-ccopts += $(armv7-a_asm_flags)
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070071verstage-c-ccopts += $(armv7-a_flags)
72verstage-S-ccopts += $(armv7-a_asm_flags)
Furquan Shaikhdfb8eb12014-10-02 16:27:52 -070073
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070074verstage-y += cache.c
75verstage-y += cpu.S
76verstage-y += exception.c
77verstage-y += exception_asm.S
78verstage-y += mmu.c
79
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070080else ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7_M),y)
Patrick Georgi27ef6022015-04-30 14:25:14 +020081libverstage-c-ccopts += $(armv7-m_flags)
82libverstage-S-ccopts += $(armv7-m_asm_flags)
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070083verstage-c-ccopts += $(armv7-m_flags)
84verstage-S-ccopts += $(armv7-m_asm_flags)
Furquan Shaikhdfb8eb12014-10-02 16:27:52 -070085
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070086endif # CONFIG_ARCH_VERSTAGE_ARMV7_M
Gabe Black51edd542013-09-30 23:00:33 -070087
Patrick Georgiddcd9bd2015-04-27 18:02:11 +020088verstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
89
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -070090################################################################################
91## ROM stage
92################################################################################
Gabe Black51edd542013-09-30 23:00:33 -070093ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV7),y)
Gabe Black51edd542013-09-30 23:00:33 -070094romstage-y += cache.c
Julius Werner1f8d2462014-01-15 14:13:25 -080095romstage-y += cpu.S
Hung-Te Lin2fc3b622013-10-21 21:43:03 +080096romstage-y += exception.c
97romstage-y += exception_asm.S
98romstage-y += mmu.c
Stefan Reinauer3a6550d2013-08-01 13:31:44 -070099romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Gabe Black51edd542013-09-30 23:00:33 -0700100
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -0700101romstage-c-ccopts += $(armv7-a_flags)
102romstage-S-ccopts += $(armv7-a_asm_flags)
Gabe Black51edd542013-09-30 23:00:33 -0700103
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -0700104rmodules_arm-c-ccopts += $(armv7-a_flags)
105rmodules_arm-S-ccopts += $(armv7-a_asm_flags)
Furquan Shaikha742ef12014-07-23 11:41:59 -0700106
Gabe Black51edd542013-09-30 23:00:33 -0700107endif # CONFIG_ARCH_ROMSTAGE_ARMV7
108
109###############################################################################
110# ramstage
111###############################################################################
112
113ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV7),y)
114
115ramstage-y += cache.c
Julius Werner1f8d2462014-01-15 14:13:25 -0800116ramstage-y += cpu.S
Gabe Black51edd542013-09-30 23:00:33 -0700117ramstage-y += exception.c
118ramstage-y += exception_asm.S
119ramstage-y += mmu.c
Stefan Reinauer3a6550d2013-08-01 13:31:44 -0700120ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
Gabe Black51edd542013-09-30 23:00:33 -0700121
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -0700122ramstage-c-ccopts += $(armv7-a_flags)
123ramstage-S-ccopts += $(armv7-a_asm_flags)
Gabe Black51edd542013-09-30 23:00:33 -0700124
Aaron Durbin703e5072014-03-20 15:02:17 -0500125# All rmodule code is armv7 if ramstage is armv7.
Daisuke Nojiri93d8e3c2014-10-21 11:18:20 -0700126rmodules_arm-c-ccopts += $(armv7-a_flags)
127rmodules_arm-S-ccopts += $(armv7-a_asm_flags)
Gabe Black51edd542013-09-30 23:00:33 -0700128endif # CONFIG_ARCH_RAMSTAGE_ARMV7