Skip to content

Commit

Permalink
core: factorize cpu support
Browse files Browse the repository at this point in the history
Create core/arch/arm/cpu/<cpu-name>.mk to store CPU generic configurations
settings. Update supported platforms to rely on the generic CPU support.

Platform shall still specify whether they support or not the NEON
extension.

Cortex-A53 and Cortex-A57 are all ARMv8.0 compliant. For ARMv8 core,
we will use ARMv8-A architecture minor version configuration files.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
etienne-lms authored and jforissier committed May 29, 2017
1 parent fc68faa commit 4389685
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 68 deletions.
7 changes: 7 additions & 0 deletions core/arch/arm/cpu/cortex-a15.mk
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions core/arch/arm/cpu/cortex-a7.mk
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions core/arch/arm/cpu/cortex-a9.mk
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions core/arch/arm/cpu/cortex-armv8-0.mk
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions core/arch/arm/plat-d02/conf.mk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions core/arch/arm/plat-hikey/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 2 additions & 7 deletions core/arch/arm/plat-imx/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions core/arch/arm/plat-ls/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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

Expand Down
7 changes: 2 additions & 5 deletions core/arch/arm/plat-mediatek/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 2 additions & 5 deletions core/arch/arm/plat-rcar/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 2 additions & 5 deletions core/arch/arm/plat-rpi3/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 2 additions & 4 deletions core/arch/arm/plat-sprd/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions core/arch/arm/plat-stm/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 2 additions & 3 deletions core/arch/arm/plat-sunxi/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 2 additions & 6 deletions core/arch/arm/plat-ti/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
14 changes: 6 additions & 8 deletions core/arch/arm/plat-vexpress/conf.mk
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions core/arch/arm/plat-zynq7k/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 2 additions & 5 deletions core/arch/arm/plat-zynqmp/conf.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 4389685

Please sign in to comment.