diff --git a/core/arch/arm/cpu/cortex-a15.mk b/core/arch/arm/cpu/cortex-a15.mk new file mode 100644 index 00000000000..37ad2a44aa9 --- /dev/null +++ b/core/arch/arm/cpu/cortex-a15.mk @@ -0,0 +1,7 @@ +$(call force,CFG_ARM32_core,y) +$(call force,CFG_ARM64_core,n) +$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) +$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) +arm32-platform-cpuarch := cortex-a15 +arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) +arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) diff --git a/core/arch/arm/cpu/cortex-a7.mk b/core/arch/arm/cpu/cortex-a7.mk new file mode 100644 index 00000000000..7d6dcaf7ed5 --- /dev/null +++ b/core/arch/arm/cpu/cortex-a7.mk @@ -0,0 +1,7 @@ +$(call force,CFG_ARM32_core,y) +$(call force,CFG_ARM64_core,n) +$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) +$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) +arm32-platform-cpuarch := cortex-a7 +arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) +arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) diff --git a/core/arch/arm/cpu/cortex-a9.mk b/core/arch/arm/cpu/cortex-a9.mk new file mode 100644 index 00000000000..b1ec77aa06b --- /dev/null +++ b/core/arch/arm/cpu/cortex-a9.mk @@ -0,0 +1,9 @@ +$(call force,CFG_ARM32_core,y) +$(call force,CFG_ARM64_core,n) +$(call force,CFG_WITH_LPAE,n) +$(call force,CFG_HWSUPP_MEM_PERM_WXN,n) +$(call force,CFG_HWSUPP_MEM_PERM_PXN,n) +$(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,n) +arm32-platform-cpuarch := cortex-a9 +arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) +arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) diff --git a/core/arch/arm/cpu/cortex-armv8-0.mk b/core/arch/arm/cpu/cortex-armv8-0.mk new file mode 100644 index 00000000000..42ebd375780 --- /dev/null +++ b/core/arch/arm/cpu/cortex-armv8-0.mk @@ -0,0 +1,7 @@ +$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) +$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) +# cortex-a53 and cortex-a57 complies on arm32 architectures +arm32-platform-cpuarch := cortex-a53 +arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) +arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) +platform-flavor-armv8 := 1 diff --git a/core/arch/arm/plat-d02/conf.mk b/core/arch/arm/plat-d02/conf.mk index e4ef0321987..33dd584f851 100644 --- a/core/arch/arm/plat-d02/conf.mk +++ b/core/arch/arm/plat-d02/conf.mk @@ -1,3 +1,5 @@ +include core/arch/arm/cpu/cortex-armv8-0.mk + CFG_NUM_THREADS ?= 16 CFG_CRYPTO_WITH_CE ?= y CFG_WITH_STACK_CANARIES ?= y @@ -8,8 +10,6 @@ CFG_CORE_TZSRAM_EMUL_SIZE ?= 393216 CFG_CORE_HEAP_SIZE ?= 98304 $(call force,CFG_GENERIC_BOOT,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_HI16XX_UART,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) @@ -19,9 +19,6 @@ $(call force,CFG_HI16XX_RNG,y) endif # 32-bit flags -arm32-platform-cpuarch := cortex-a57 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon ta-targets = ta_arm32 diff --git a/core/arch/arm/plat-hikey/conf.mk b/core/arch/arm/plat-hikey/conf.mk index 200cb54061f..80f2ce5ea64 100644 --- a/core/arch/arm/plat-hikey/conf.mk +++ b/core/arch/arm/plat-hikey/conf.mk @@ -1,12 +1,9 @@ +include core/arch/arm/cpu/cortex-armv8-0.mk + # 32-bit flags -arm32-platform-cpuarch := cortex-a53 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon $(call force,CFG_GENERIC_BOOT,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_PL011,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) diff --git a/core/arch/arm/plat-imx/conf.mk b/core/arch/arm/plat-imx/conf.mk index 85023d5b349..cc1d339f516 100644 --- a/core/arch/arm/plat-imx/conf.mk +++ b/core/arch/arm/plat-imx/conf.mk @@ -23,11 +23,8 @@ endif # Common i.MX6 config -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon -$(call force,CFG_ARM32_core,y) $(call force,CFG_GENERIC_BOOT,y) $(call force,CFG_GIC,y) $(call force,CFG_IMX_UART,y) @@ -40,21 +37,19 @@ CFG_WITH_STACK_CANARIES ?= y # i.MX6UL specific config ifeq ($(CFG_MX6UL),y) -arm32-platform-cpuarch := cortex-a7 +include core/arch/arm/cpu/cortex-a7.mk $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) endif # i.MX6 Solo/DualLite/Dual/Quad specific config ifeq ($(filter y, $(CFG_MX6Q) $(CFG_MX6D) $(CFG_MX6DL) $(CFG_MX6S)), y) -arm32-platform-cpuarch := cortex-a9 +include core/arch/arm/cpu/cortex-a9.mk $(call force,CFG_PL310,y) $(call force,CFG_PL310_LOCKED,y) $(call force,CFG_SECURE_TIME_SOURCE_REE,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,n) CFG_BOOT_SYNC_CPU ?= y CFG_BOOT_SECONDARY_REQUEST ?= y diff --git a/core/arch/arm/plat-ls/conf.mk b/core/arch/arm/plat-ls/conf.mk index 39b269eb176..a7fd4662425 100644 --- a/core/arch/arm/plat-ls/conf.mk +++ b/core/arch/arm/plat-ls/conf.mk @@ -1,8 +1,7 @@ PLATFORM_FLAVOR ?= ls1021atwr -arm32-platform-cpuarch := cortex-a7 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) +include core/arch/arm/cpu/cortex-a7.mk + core_arm32-platform-aflags += -mfpu=neon $(call force,CFG_GENERIC_BOOT,y) @@ -11,7 +10,6 @@ $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) $(call force,CFG_GIC,y) $(call force,CFG_16550_UART,y) $(call force,CFG_PM_STUBS,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) ta-targets = ta_arm32 diff --git a/core/arch/arm/plat-mediatek/conf.mk b/core/arch/arm/plat-mediatek/conf.mk index 6989264b447..1a6271807ff 100644 --- a/core/arch/arm/plat-mediatek/conf.mk +++ b/core/arch/arm/plat-mediatek/conf.mk @@ -1,15 +1,12 @@ PLATFORM_FLAVOR ?= mt8173 +include core/arch/arm/cpu/cortex-armv8-0.mk + # 32-bit flags -arm32-platform-cpuarch := cortex-a15 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) arm32-platform-aflags += -mfpu=neon $(call force,CFG_8250_UART,y) $(call force,CFG_GENERIC_BOOT,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) $(call force,CFG_WITH_ARM_TRUSTED_FW,y) diff --git a/core/arch/arm/plat-rcar/conf.mk b/core/arch/arm/plat-rcar/conf.mk index 8d3badd0fa1..68eae0f560a 100644 --- a/core/arch/arm/plat-rcar/conf.mk +++ b/core/arch/arm/plat-rcar/conf.mk @@ -1,14 +1,11 @@ PLATFORM_FLAVOR ?= h3 +include core/arch/arm/cpu/cortex-armv8-0.mk + # 32-bit flags -arm32-platform-cpuarch := cortex-a57 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) arm32-platform-aflags += -mfpu=neon $(call force,CFG_GENERIC_BOOT,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) $(call force,CFG_WITH_ARM_TRUSTED_FW,y) diff --git a/core/arch/arm/plat-rpi3/conf.mk b/core/arch/arm/plat-rpi3/conf.mk index ee965ba8647..534308a38fc 100644 --- a/core/arch/arm/plat-rpi3/conf.mk +++ b/core/arch/arm/plat-rpi3/conf.mk @@ -1,13 +1,10 @@ +include core/arch/arm/cpu/cortex-armv8-0.mk + # 32-bit flags -arm32-platform-cpuarch := cortex-a53 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon $(call force,CFG_8250_UART,y) $(call force,CFG_GENERIC_BOOT,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) $(call force,CFG_WITH_ARM_TRUSTED_FW,y) diff --git a/core/arch/arm/plat-sprd/conf.mk b/core/arch/arm/plat-sprd/conf.mk index a2df2da42b5..e1c4b988d22 100644 --- a/core/arch/arm/plat-sprd/conf.mk +++ b/core/arch/arm/plat-sprd/conf.mk @@ -1,9 +1,8 @@ PLATFORM_FLAVOR ?= sc9860 +include core/arch/arm/cpu/cortex-armv8-0.mk + # 32-bit flags -arm32-platform-cpuarch := cortex-a15 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) arm32-platform-aflags += -mfpu=neon $(call force,CFG_WITH_ARM_TRUSTED_FW,y) @@ -22,7 +21,6 @@ $(call force,CFG_GIC,y) $(call force,CFG_SPRD_UART,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) CFG_WITH_STACK_CANARIES ?= y # Overrides default in mk/config.mk with 128 kB diff --git a/core/arch/arm/plat-stm/conf.mk b/core/arch/arm/plat-stm/conf.mk index e34491fb0c3..c4a8e462280 100644 --- a/core/arch/arm/plat-stm/conf.mk +++ b/core/arch/arm/plat-stm/conf.mk @@ -1,8 +1,7 @@ PLATFORM_FLAVOR ?= b2260 -arm32-platform-cpuarch := cortex-a9 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) +include core/arch/arm/cpu/cortex-a9.mk + core_arm32-platform-aflags += -mfpu=neon $(call force,CFG_ARM32_core,y) diff --git a/core/arch/arm/plat-sunxi/conf.mk b/core/arch/arm/plat-sunxi/conf.mk index b2a9dc11f98..61654b6d619 100644 --- a/core/arch/arm/plat-sunxi/conf.mk +++ b/core/arch/arm/plat-sunxi/conf.mk @@ -1,6 +1,5 @@ -arm32-platform-cpuarch := cortex-a15 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) +include core/arch/arm/cpu/cortex-a15.mk + core_arm32-platform-aflags += -mfpu=neon $(call force,CFG_ARM32_core,y) diff --git a/core/arch/arm/plat-ti/conf.mk b/core/arch/arm/plat-ti/conf.mk index c168ff7192c..df2f8a994c8 100644 --- a/core/arch/arm/plat-ti/conf.mk +++ b/core/arch/arm/plat-ti/conf.mk @@ -13,13 +13,11 @@ $(call force,CFG_NO_SMP,y) $(call force,CFG_PL310,y) $(call force,CFG_PL310_LOCKED,y) $(call force,CFG_SECURE_TIME_SOURCE_REE,y) -arm32-platform-cpuarch := cortex-a9 +include core/arch/arm/cpu/cortex-a9.mk else CFG_OTP_SUPPORT ?= y -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) -arm32-platform-cpuarch := cortex-a15 +include core/arch/arm/cpu/cortex-a15.mk endif $(call force,CFG_SM_PLATFORM_HANDLER,y) $(call force,CFG_GIC,y) @@ -28,8 +26,6 @@ $(call force,CFG_DRA7_RNG,y) endif # 32-bit flags -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon ta-targets = ta_arm32 diff --git a/core/arch/arm/plat-vexpress/conf.mk b/core/arch/arm/plat-vexpress/conf.mk index 33b66a4c400..226b247da35 100644 --- a/core/arch/arm/plat-vexpress/conf.mk +++ b/core/arch/arm/plat-vexpress/conf.mk @@ -1,21 +1,21 @@ PLATFORM_FLAVOR ?= qemu_virt # 32-bit flags -arm32-platform-cpuarch := cortex-a15 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon +ifeq ($(PLATFORM_FLAVOR),qemu_virt) +include core/arch/arm/cpu/cortex-a15.mk +endif ifeq ($(PLATFORM_FLAVOR),fvp) -platform-flavor-armv8 := 1 +include core/arch/arm/cpu/cortex-armv8-0.mk platform-debugger-arm := 1 endif ifeq ($(PLATFORM_FLAVOR),juno) -platform-flavor-armv8 := 1 +include core/arch/arm/cpu/cortex-armv8-0.mk platform-debugger-arm := 1 endif ifeq ($(PLATFORM_FLAVOR),qemu_armv8a) -platform-flavor-armv8 := 1 +include core/arch/arm/cpu/cortex-armv8-0.mk $(call force,CFG_DT,y) endif @@ -32,8 +32,6 @@ endif $(call force,CFG_GENERIC_BOOT,y) $(call force,CFG_GIC,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_PL011,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) diff --git a/core/arch/arm/plat-zynq7k/conf.mk b/core/arch/arm/plat-zynq7k/conf.mk index f457d8de5bc..8923f614fa6 100644 --- a/core/arch/arm/plat-zynq7k/conf.mk +++ b/core/arch/arm/plat-zynq7k/conf.mk @@ -1,9 +1,7 @@ PLATFORM_FLAVOR ?= zc702 -arm32-platform-cpuarch := cortex-a9 +include core/arch/arm/cpu/cortex-a9.mk -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) core_arm32-platform-aflags += -mfpu=neon $(call force,CFG_ARM32_core,y) diff --git a/core/arch/arm/plat-zynqmp/conf.mk b/core/arch/arm/plat-zynqmp/conf.mk index bea1b741616..93f264af18d 100644 --- a/core/arch/arm/plat-zynqmp/conf.mk +++ b/core/arch/arm/plat-zynqmp/conf.mk @@ -1,16 +1,13 @@ PLATFORM_FLAVOR ?= zcu102 +include core/arch/arm/cpu/cortex-armv8-0.mk + # 32-bit flags -arm32-platform-cpuarch := cortex-a53 -arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) -arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) arm32-platform-aflags += -mfpu=neon $(call force,CFG_CDNS_UART,y) $(call force,CFG_GENERIC_BOOT,y) $(call force,CFG_GIC,y) -$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) -$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) $(call force,CFG_PM_STUBS,y) $(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y) $(call force,CFG_WITH_ARM_TRUSTED_FW,y)