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 | ## |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 16 | ############################################################################### |
| 17 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 18 | armv7_flags = -mthumb -I$(src)/arch/arm/include/armv7/ -D__COREBOOT_ARM_ARCH__=7 |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 19 | armv7-a_flags = -march=armv7-a $(armv7_flags) -D__COREBOOT_ARM_V7_A__ |
| 20 | armv7-m_flags = -march=armv7-m $(armv7_flags) -D__COREBOOT_ARM_V7_M__ |
| 21 | armv7-r_flags = -march=armv7-r $(armv7_flags) -D__COREBOOT_ARM_V7_R__ |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 22 | |
| 23 | armv7_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 24 | armv7-r_asm_flags = $(armv7-r_flags) $(armv7_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 25 | |
| 26 | ############################################################################### |
| 27 | # bootblock |
| 28 | ############################################################################### |
| 29 | |
| 30 | ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7),y) |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 31 | bootblock-generic-ccopts += $(armv7-a_flags) |
| 32 | bootblock-S-ccopts += $(armv7_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 33 | |
Julius Werner | 86fc11d | 2015-10-09 13:37:58 -0700 | [diff] [blame] | 34 | ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 35 | bootblock-y += bootblock.S |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 36 | endif |
| 37 | |
| 38 | bootblock-y += cache.c |
Julius Werner | 1f8d246 | 2014-01-15 14:13:25 -0800 | [diff] [blame] | 39 | bootblock-y += cpu.S |
Julius Werner | 85620db | 2013-11-13 18:22:15 -0800 | [diff] [blame] | 40 | bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c |
| 41 | bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception_asm.S |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 42 | bootblock-y += mmu.c |
| 43 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 44 | else ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7_M),y) |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 45 | bootblock-generic-ccopts += $(armv7-m_flags) |
| 46 | bootblock-S-ccopts += $(armv7_asm_flags) |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 47 | |
Julius Werner | 86fc11d | 2015-10-09 13:37:58 -0700 | [diff] [blame] | 48 | ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y) |
Daisuke Nojiri | c5a4c12 | 2014-10-23 11:51:18 -0700 | [diff] [blame] | 49 | bootblock-y += bootblock_m.S |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 50 | endif |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 51 | bootblock-y += exception_mr.c |
Daisuke Nojiri | af3b2a1 | 2014-10-23 12:39:11 -0700 | [diff] [blame] | 52 | bootblock-y += cache_m.c |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 53 | |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 54 | else ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7_R),y) |
| 55 | bootblock-generic-ccopts += $(armv7-r_flags) |
| 56 | bootblock-S-ccopts += $(armv7-r_asm_flags) |
| 57 | |
| 58 | ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y) |
| 59 | bootblock-y += bootblock.S |
| 60 | endif |
| 61 | |
| 62 | bootblock-y += cache.c |
| 63 | bootblock-y += cpu.S |
| 64 | bootblock-y += exception_mr.c |
| 65 | bootblock-y += mmu.c |
| 66 | |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 67 | endif # CONFIG_ARCH_BOOTBLOCK_ARMV7 |
| 68 | |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 69 | ################################################################################ |
| 70 | ## verification stage |
| 71 | ################################################################################ |
| 72 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 73 | ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7),y) |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 74 | verstage-generic-ccopts += $(armv7-a_flags) |
| 75 | verstage-S-ccopts += $(armv7_asm_flags) |
Furquan Shaikh | dfb8eb1 | 2014-10-02 16:27:52 -0700 | [diff] [blame] | 76 | |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 77 | verstage-y += cache.c |
| 78 | verstage-y += cpu.S |
| 79 | verstage-y += exception.c |
| 80 | verstage-y += exception_asm.S |
| 81 | verstage-y += mmu.c |
| 82 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 83 | else ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7_M),y) |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 84 | verstage-generic-ccopts += $(armv7-m_flags) |
| 85 | verstage-S-ccopts += $(armv7_asm_flags) |
Furquan Shaikh | dfb8eb1 | 2014-10-02 16:27:52 -0700 | [diff] [blame] | 86 | |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 87 | else ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7_R),y) |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 88 | verstage-generic-ccopts += $(armv7-r_flags) |
| 89 | verstage-S-ccopts += $(armv7-r_asm_flags) |
| 90 | |
| 91 | verstage-y += cache.c |
| 92 | verstage-y += cpu.S |
| 93 | verstage-y += exception_mr.c |
| 94 | verstage-y += mmu.c |
| 95 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 96 | endif # CONFIG_ARCH_VERSTAGE_ARMV7_M |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 97 | |
Daisuke Nojiri | 93d8e3c | 2014-10-21 11:18:20 -0700 | [diff] [blame] | 98 | ################################################################################ |
| 99 | ## ROM stage |
| 100 | ################################################################################ |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 101 | ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV7),y) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 102 | romstage-y += cache.c |
Julius Werner | 1f8d246 | 2014-01-15 14:13:25 -0800 | [diff] [blame] | 103 | romstage-y += cpu.S |
Hung-Te Lin | 2fc3b62 | 2013-10-21 21:43:03 +0800 | [diff] [blame] | 104 | romstage-y += exception.c |
| 105 | romstage-y += exception_asm.S |
| 106 | romstage-y += mmu.c |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 107 | |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 108 | romstage-generic-ccopts += $(armv7-a_flags) |
| 109 | romstage-S-ccopts += $(armv7_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 110 | |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 111 | rmodules_arm-generic-ccopts += $(armv7-a_flags) |
| 112 | rmodules_arm-S-ccopts += $(armv7_asm_flags) |
Furquan Shaikh | a742ef1 | 2014-07-23 11:41:59 -0700 | [diff] [blame] | 113 | |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 114 | else ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV7_R),y) |
| 115 | romstage-y += cache.c |
| 116 | romstage-y += cpu.S |
| 117 | romstage-y += exception_mr.c |
| 118 | romstage-y += mmu.c |
| 119 | |
| 120 | romstage-generic-ccopts += $(armv7-r_flags) |
| 121 | romstage-S-ccopts += $(armv7-r_asm_flags) |
| 122 | |
| 123 | rmodules_arm-generic-ccopts += $(armv7-r_flags) |
| 124 | rmodules_arm-S-ccopts += $(armv7-r_asm_flags) |
| 125 | |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 126 | endif # CONFIG_ARCH_ROMSTAGE_ARMV7 |
| 127 | |
| 128 | ############################################################################### |
| 129 | # ramstage |
| 130 | ############################################################################### |
| 131 | |
| 132 | ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV7),y) |
| 133 | |
| 134 | ramstage-y += cache.c |
Julius Werner | 1f8d246 | 2014-01-15 14:13:25 -0800 | [diff] [blame] | 135 | ramstage-y += cpu.S |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 136 | ramstage-y += exception.c |
| 137 | ramstage-y += exception_asm.S |
| 138 | ramstage-y += mmu.c |
| 139 | |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 140 | ramstage-generic-ccopts += $(armv7-a_flags) |
| 141 | ramstage-S-ccopts += $(armv7_asm_flags) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 142 | |
Aaron Durbin | 703e507 | 2014-03-20 15:02:17 -0500 | [diff] [blame] | 143 | # All rmodule code is armv7 if ramstage is armv7. |
Julius Werner | d3634c1 | 2015-11-13 13:28:41 -0800 | [diff] [blame] | 144 | rmodules_arm-generic-ccopts += $(armv7-a_flags) |
| 145 | rmodules_arm-S-ccopts += $(armv7_asm_flags) |
Hakim Giydan | 43e5b57 | 2016-09-08 10:13:59 -0700 | [diff] [blame] | 146 | |
| 147 | else ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV7_R),y) |
| 148 | |
| 149 | ramstage-y += cache.c |
| 150 | ramstage-y += cpu.S |
| 151 | ramstage-y += exception_mr.c |
| 152 | ramstage-y += mmu.c |
| 153 | |
| 154 | ramstage-generic-ccopts += $(armv7-r_flags) |
| 155 | ramstage-S-ccopts += $(armv7-r_asm_flags) |
| 156 | |
| 157 | # All rmodule code is armv7 if ramstage is armv7. |
| 158 | rmodules_arm-generic-ccopts += $(armv7-r_flags) |
| 159 | rmodules_arm-S-ccopts += $(armv7-r_asm_flags) |
| 160 | |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 161 | endif # CONFIG_ARCH_RAMSTAGE_ARMV7 |