| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
subdirs-y += armv8/ |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM64),y) |
| 14 |
check-ramstage-overlap-regions += postram_cbfs_cache stack ttb |
| 15 |
endif |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y) |
| 22 |
|
| 23 |
decompressor-y += boot.c |
| 24 |
bootblock-y += boot.c |
| 25 |
decompressor-y += div0.c |
| 26 |
bootblock-y += div0.c |
| 27 |
decompressor-y += eabi_compat.c |
| 28 |
bootblock-y += eabi_compat.c |
| 29 |
|
| 30 |
decompressor-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c |
| 31 |
bootblock-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c |
| 32 |
bootblock-y += transition.c transition_asm.S |
| 33 |
ifneq ($(CONFIG_ARM64_CURRENT_EL),3) |
| 34 |
bootblock-y += smc.c smc_asm.S |
| 35 |
endif |
| 36 |
|
| 37 |
decompressor-y += memset.S |
| 38 |
bootblock-y += memset.S |
| 39 |
decompressor-y += memcpy.S |
| 40 |
bootblock-y += memcpy.S |
| 41 |
decompressor-y += memmove.S |
| 42 |
bootblock-y += memmove.S |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
$(eval $(call link_stage,bootblock)) |
| 47 |
$(eval $(call link_stage,decompressor)) |
| 48 |
|
| 49 |
endif |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
ifeq ($(CONFIG_ARCH_VERSTAGE_ARM64),y) |
| 56 |
|
| 57 |
$(eval $(call link_stage,verstage)) |
| 58 |
|
| 59 |
verstage-y += boot.c |
| 60 |
verstage-y += div0.c |
| 61 |
verstage-y += eabi_compat.c |
| 62 |
verstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c |
| 63 |
verstage-y += memset.S |
| 64 |
verstage-y += memcpy.S |
| 65 |
verstage-y += memmove.S |
| 66 |
|
| 67 |
verstage-y += transition.c transition_asm.S |
| 68 |
ifneq ($(CONFIG_ARM64_CURRENT_EL),3) |
| 69 |
verstage-y += smc.c smc_asm.S |
| 70 |
endif |
| 71 |
|
| 72 |
endif |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y) |
| 79 |
|
| 80 |
romstage-y += boot.c |
| 81 |
romstage-y += div0.c |
| 82 |
romstage-y += eabi_compat.c |
| 83 |
romstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c |
| 84 |
romstage-y += memset.S |
| 85 |
romstage-y += memcpy.S |
| 86 |
romstage-y += memmove.S |
| 87 |
romstage-y += ramdetect.c |
| 88 |
romstage-y += romstage.c |
| 89 |
romstage-y += transition.c transition_asm.S |
| 90 |
ifneq ($(CONFIG_ARM64_CURRENT_EL),3) |
| 91 |
romstage-y += smc.c smc_asm.S |
| 92 |
endif |
| 93 |
|
| 94 |
rmodules_arm64-y += memset.S |
| 95 |
rmodules_arm64-y += memcpy.S |
| 96 |
rmodules_arm64-y += memmove.S |
| 97 |
rmodules_arm64-y += eabi_compat.c |
| 98 |
|
| 99 |
$(eval $(call link_stage,romstage)) |
| 100 |
|
| 101 |
endif |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM64),y) |
| 108 |
|
| 109 |
ramstage-y += div0.c |
| 110 |
ramstage-y += eabi_compat.c |
| 111 |
ramstage-y += boot.c |
| 112 |
ramstage-$(CONFIG_GENERATE_SMBIOS_TABLES) += smbios.c |
| 113 |
ramstage-y += tables.c |
| 114 |
ramstage-y += ramdetect.c |
| 115 |
ramstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c |
| 116 |
ramstage-y += memset.S |
| 117 |
ramstage-y += memcpy.S |
| 118 |
ramstage-y += memmove.S |
| 119 |
ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += bl31.c |
| 120 |
ramstage-y += transition.c transition_asm.S |
| 121 |
ifneq ($(CONFIG_ARM64_CURRENT_EL),3) |
| 122 |
ramstage-y += smc.c smc_asm.S |
| 123 |
endif |
| 124 |
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c |
| 125 |
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c |
| 126 |
ramstage-y += dma.c |
| 127 |
|
| 128 |
rmodules_arm64-y += memset.S |
| 129 |
rmodules_arm64-y += memcpy.S |
| 130 |
rmodules_arm64-y += memmove.S |
| 131 |
rmodules_arm64-y += eabi_compat.c |
| 132 |
rmodules_arm64-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c |
| 133 |
|
| 134 |
ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
$(eval $(call link_stage,ramstage)) |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
ifeq ($(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE),y) |
| 143 |
|
| 144 |
ifeq ($(CONFIG_ARM64_BL31_EXTERNAL_FILE),"") |
| 145 |
|
| 146 |
BL31_SOURCE := $(top)/3rdparty/arm-trusted-firmware |
| 147 |
BL31_BUILD := $(abspath $(obj)/3rdparty/arm-trusted-firmware) |
| 148 |
BL31_TARGET := $(BL31_BUILD)/bl31/bl31.elf |
| 149 |
|
| 150 |
ifeq ($(V),1) |
| 151 |
BL31_MAKEARGS += V=1 |
| 152 |
endif |
| 153 |
|
| 154 |
|
| 155 |
ifeq ($(CONFIG_FATAL_ASSERTS),y) |
| 156 |
BL31_MAKEARGS += DEBUG=1 |
| 157 |
endif |
| 158 |
|
| 159 |
|
| 160 |
BL31_MAKEARGS += LOG_LEVEL=40 |
| 161 |
|
| 162 |
|
| 163 |
BL31_MAKEARGS += CRASH_REPORTING=1 |
| 164 |
|
| 165 |
|
| 166 |
BL31_MAKEARGS += COREBOOT=1 |
| 167 |
|
| 168 |
|
| 169 |
BL31_MAKEARGS += BUILD_PLAT="$(BL31_BUILD)" |
| 170 |
|
| 171 |
|
| 172 |
BL31_MAKEARGS += IS_ANYTHING_TO_BUILD=1 |
| 173 |
|
| 174 |
|
| 175 |
BL31_MAKEARGS += BUILD_MESSAGE_TIMESTAMP='"$(shell sed -n 's/^.define COREBOOT_BUILD\>.*"\(.*\)".*/\1/p' $(obj)/build.h)"' |
| 176 |
|
| 177 |
ifeq ($(CONFIG_ARM64_BL31_OPTEE_WITH_SMC),y) |
| 178 |
BL31_MAKEARGS += SPD=opteed |
| 179 |
BL31_MAKEARGS += OPTEE_ALLOW_SMC_LOAD=1 |
| 180 |
BL31_MAKEARGS += PLAT_XLAT_TABLES_DYNAMIC=1 |
| 181 |
ifeq ($(CONFIG_CHROMEOS),y) |
| 182 |
BL31_MAKEARGS += CROS_WIDEVINE_SMC=1 |
| 183 |
endif |
| 184 |
endif |
| 185 |
|
| 186 |
BL31_CFLAGS := -fno-pic -fno-stack-protector -Wno-deprecated-declarations -Wno-unused-function |
| 187 |
BL31_LDFLAGS := -Wl,--emit-relocs |
| 188 |
|
| 189 |
BL31 := $(obj)/bl31.elf |
| 190 |
|
| 191 |
$(BL31): $(obj)/build.h |
| 192 |
printf " MAKE $(subst $(obj)/,,$(@))\n" |
| 193 |
+unset AS AR CC CPP OC OD LD; \ |
| 194 |
CROSS_COMPILE="$(CROSS_COMPILE_arm64)" \ |
| 195 |
CFLAGS="$(BL31_CFLAGS)" \ |
| 196 |
LDFLAGS="$(BL31_LDFLAGS)" \ |
| 197 |
$(MAKE) -C $(BL31_SOURCE) $(BL31_MAKEARGS) $(BL31_TARGET) |
| 198 |
mv $(BL31_TARGET) $@ |
| 199 |
|
| 200 |
.PHONY: $(BL31) |
| 201 |
|
| 202 |
else |
| 203 |
|
| 204 |
BL31 := $(call strip_quotes,$(CONFIG_ARM64_BL31_EXTERNAL_FILE)) |
| 205 |
|
| 206 |
endif |
| 207 |
|
| 208 |
|
| 209 |
BL31_CBFS := $(CONFIG_CBFS_PREFIX)/bl31 |
| 210 |
$(BL31_CBFS)-file := $(BL31) |
| 211 |
$(BL31_CBFS)-type := payload |
| 212 |
$(BL31_CBFS)-compression := $(CBFS_COMPRESS_FLAG) |
| 213 |
cbfs-files-y += $(BL31_CBFS) |
| 214 |
|
| 215 |
check-ramstage-overlap-files += $(BL31_CBFS) |
| 216 |
|
| 217 |
ifeq ($(CONFIG_ARM64_USE_SECURE_OS),y) |
| 218 |
|
| 219 |
SECURE_OS_FILE := $(CONFIG_ARM64_SECURE_OS_FILE) |
| 220 |
SECURE_OS_FILE_CBFS := $(CONFIG_CBFS_PREFIX)/secure_os |
| 221 |
$(SECURE_OS_FILE_CBFS)-file := $(SECURE_OS_FILE) |
| 222 |
$(SECURE_OS_FILE_CBFS)-type := stage |
| 223 |
cbfs-files-y += $(SECURE_OS_FILE_CBFS) |
| 224 |
|
| 225 |
check-ramstage-overlap-files += $(SECURE_OS_FILE_CBFS) |
| 226 |
|
| 227 |
endif |
| 228 |
|
| 229 |
endif |
| 230 |
|
| 231 |
endif |