Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 1 | ################################################################################ |
| 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 Georgi | b890a12 | 2015-03-26 15:17:45 +0100 | [diff] [blame] | 18 | ## Foundation, Inc. |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 19 | ## |
| 20 | ############################################################################### |
| 21 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 22 | armv7_flags = -mthumb -I$(src)/arch/arm/include/armv7/ -D__COREBOOT_ARM_ARCH__=7 |
| 23 | armv7-a_flags = -march=armv7-a $(armv7_flags) |
| 24 | armv7-m_flags = -march=armv7-m $(armv7_flags) |
| 25 | |
| 26 | armv7_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated |
| 27 | armv7-a_asm_flags = $(armv7-a_flags) $(armv7_asm_flags) |
| 28 | armv7-m_asm_flags = $(armv7-m_flags) $(armv7_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 29 | |
| 30 | ############################################################################### |
| 31 | # bootblock |
| 32 | ############################################################################### |
| 33 | |
| 34 | ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7),y) |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 35 | bootblock-c-ccopts += $(armv7-a_flags) |
| 36 | bootblock-S-ccopts += $(armv7-a_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 37 | |
| 38 | ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y) |
| 39 | bootblock-y += bootblock.S |
| 40 | bootblock-$(CONFIG_BOOTBLOCK_SIMPLE) += bootblock_simple.c |
| 41 | endif |
| 42 | |
| 43 | bootblock-y += cache.c |
Julius Werner | 1f8d246 | 2014-01-15 14:13:25 -0800 | [diff] [blame] | 44 | bootblock-y += cpu.S |
Julius Werner | 85620db | 2013-11-13 18:22:15 -0800 | [diff] [blame] | 45 | bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c |
| 46 | bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception_asm.S |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 47 | bootblock-y += mmu.c |
| 48 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 49 | else ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7_M),y) |
| 50 | bootblock-c-ccopts += $(armv7-m_flags) |
| 51 | bootblock-S-ccopts += $(armv7-m_asm_flags) |
| 52 | |
| 53 | ifneq ($(CONFIG_ARM_BOOTBLOCK_CUSTOM),y) |
Daisuke Nojiri | c5a4c12 | 2014-10-23 11:51:18 -0700 | [diff] [blame] | 54 | bootblock-y += bootblock_m.S |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 55 | bootblock-y += bootblock_simple.c |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 56 | endif |
Daisuke Nojiri | af3b2a1 | 2014-10-23 12:39:11 -0700 | [diff] [blame] | 57 | bootblock-y += exception_m.c |
| 58 | bootblock-y += cache_m.c |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 59 | |
| 60 | endif # CONFIG_ARCH_BOOTBLOCK_ARMV7 |
| 61 | |
Patrick Georgi | ddcd9bd | 2015-04-27 18:02:11 +0200 | [diff] [blame] | 62 | bootblock-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
| 63 | |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 64 | ################################################################################ |
| 65 | ## verification stage |
| 66 | ################################################################################ |
| 67 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 68 | ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7),y) |
Patrick Georgi | 27ef602 | 2015-04-30 14:25:14 +0200 | [diff] [blame] | 69 | libverstage-c-ccopts += $(armv7-a_flags) |
| 70 | libverstage-S-ccopts += $(armv7-a_asm_flags) |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 71 | verstage-c-ccopts += $(armv7-a_flags) |
| 72 | verstage-S-ccopts += $(armv7-a_asm_flags) |
Furquan Shaikh | dfb8eb1 | 2014-10-02 16:27:52 -0700 | [diff] [blame] | 73 | |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 74 | verstage-y += cache.c |
| 75 | verstage-y += cpu.S |
| 76 | verstage-y += exception.c |
| 77 | verstage-y += exception_asm.S |
| 78 | verstage-y += mmu.c |
| 79 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 80 | else ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7_M),y) |
Patrick Georgi | 27ef602 | 2015-04-30 14:25:14 +0200 | [diff] [blame] | 81 | libverstage-c-ccopts += $(armv7-m_flags) |
| 82 | libverstage-S-ccopts += $(armv7-m_asm_flags) |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 83 | verstage-c-ccopts += $(armv7-m_flags) |
| 84 | verstage-S-ccopts += $(armv7-m_asm_flags) |
Furquan Shaikh | dfb8eb1 | 2014-10-02 16:27:52 -0700 | [diff] [blame] | 85 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 86 | endif # CONFIG_ARCH_VERSTAGE_ARMV7_M |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 87 | |
Patrick Georgi | ddcd9bd | 2015-04-27 18:02:11 +0200 | [diff] [blame] | 88 | verstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
| 89 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 90 | ################################################################################ |
| 91 | ## ROM stage |
| 92 | ################################################################################ |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 93 | ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV7),y) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 94 | romstage-y += cache.c |
Julius Werner | 1f8d246 | 2014-01-15 14:13:25 -0800 | [diff] [blame] | 95 | romstage-y += cpu.S |
Hung-Te Lin | 2fc3b62 | 2013-10-21 21:43:03 +0800 | [diff] [blame] | 96 | romstage-y += exception.c |
| 97 | romstage-y += exception_asm.S |
| 98 | romstage-y += mmu.c |
Stefan Reinauer | 3a6550d | 2013-08-01 13:31:44 -0700 | [diff] [blame] | 99 | romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 100 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 101 | romstage-c-ccopts += $(armv7-a_flags) |
| 102 | romstage-S-ccopts += $(armv7-a_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 103 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 104 | rmodules_arm-c-ccopts += $(armv7-a_flags) |
| 105 | rmodules_arm-S-ccopts += $(armv7-a_asm_flags) |
Furquan Shaikh | a742ef1 | 2014-07-23 11:41:59 -0700 | [diff] [blame] | 106 | |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 107 | endif # CONFIG_ARCH_ROMSTAGE_ARMV7 |
| 108 | |
| 109 | ############################################################################### |
| 110 | # ramstage |
| 111 | ############################################################################### |
| 112 | |
| 113 | ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV7),y) |
| 114 | |
| 115 | ramstage-y += cache.c |
Julius Werner | 1f8d246 | 2014-01-15 14:13:25 -0800 | [diff] [blame] | 116 | ramstage-y += cpu.S |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 117 | ramstage-y += exception.c |
| 118 | ramstage-y += exception_asm.S |
| 119 | ramstage-y += mmu.c |
Stefan Reinauer | 3a6550d | 2013-08-01 13:31:44 -0700 | [diff] [blame] | 120 | ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 121 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 122 | ramstage-c-ccopts += $(armv7-a_flags) |
| 123 | ramstage-S-ccopts += $(armv7-a_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 124 | |
Aaron Durbin | 703e507 | 2014-03-20 15:02:17 -0500 | [diff] [blame] | 125 | # All rmodule code is armv7 if ramstage is armv7. |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 126 | rmodules_arm-c-ccopts += $(armv7-a_flags) |
| 127 | rmodules_arm-S-ccopts += $(armv7-a_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 128 | endif # CONFIG_ARCH_RAMSTAGE_ARMV7 |