1## SPDX-License-Identifier: GPL-2.0-only 2 3ifeq ($(CONFIG_ARCH_ARMV8_EXTENSION),0) 4march = armv8-a 5else 6march = armv8.$(CONFIG_ARCH_ARMV8_EXTENSION)-a 7endif 8 9armv8_flags = -march=$(march) -I$(src)/arch/arm64/include/armv8/ -D__COREBOOT_ARM_ARCH__=8 10 11################################################################################ 12## bootblock 13################################################################################ 14ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV8_64),y) 15 16ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y) 17decompressor-y += bootblock.S 18ifneq ($(CONFIG_COMPRESS_BOOTBLOCK),y) 19bootblock-y += bootblock.S 20endif 21endif 22decompressor-y += cpu.S 23bootblock-y += cpu.S 24decompressor-y += cache.c 25bootblock-y += cache.c 26decompressor-y += mmu.c 27bootblock-y += mmu.c 28 29bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c 30 31decompressor-generic-ccopts += $(armv8_flags) 32bootblock-generic-ccopts += $(armv8_flags) 33 34# Required to access unaligned timestamp struct members before MMU is active 35# (TODO: Maybe use explicit unaligned accesses in timestamp code instead, or 36# evaluate redesigning timestamp data structures to avoid misaligned members.) 37decompressor-c-ccopts += -mstrict-align 38bootblock-c-ccopts += -mstrict-align 39 40endif 41 42################################################################################ 43## verstage 44################################################################################ 45ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV8_64),y) 46 47verstage-y += cache.c 48verstage-y += cpu.S 49verstage-y += exception.c 50 51verstage-generic-ccopts += $(armv8_flags) 52 53endif 54 55################################################################################ 56## romstage 57################################################################################ 58ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV8_64),y) 59 60romstage-y += cache.c 61romstage-y += cpu.S 62romstage-y += exception.c 63romstage-y += mmu.c 64 65romstage-generic-ccopts += $(armv8_flags) 66 67rmodules_arm64-generic-ccopts += $(armv8_flags) 68 69endif 70 71################################################################################ 72## ramstage 73################################################################################ 74ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV8_64),y) 75 76ramstage-y += cache.c 77ramstage-y += cpu.S 78ramstage-y += exception.c 79ramstage-y += mmu.c 80 81ramstage-generic-ccopts += $(armv8_flags) 82 83rmodules_arm64-generic-ccopts += $(armv8_flags) 84 85endif 86