Skip to content

Commit

Permalink
arch: add ARCH_TRUSTZONE_DISABLED choice
Browse files Browse the repository at this point in the history
We can decide whether use trustzone

After this patch, we can support the following mode:

                             ARCH_HAVE_TRUSTZONE   ARCH_TRUSTZONE_DISABLED  ARCH_TRUSTZONE_SECURE  ARCH_TRUSTZONE_NONSECURE

Without Security Extensions         n                       n                       n                         n
CHIP have NO trustzone

With Security Extensions            y                       y                       n                         n
Only one bin in sec mode

With Security Extensions            y                       n                       y                         n
TEE bin in sec mode

With Security Extensions            y                       n                       n                         y
REE bin in non-sec mode

Signed-off-by: ligd <[email protected]>
  • Loading branch information
GUIDINGLI committed Mar 18, 2024
1 parent 42bcb0c commit e9c7cb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,17 @@ config ARCH_HAVE_TRUSTZONE

choice
prompt "TrustZone Configuration"
default ARCH_TRUSTZONE_NONSECURE
default ARCH_TRUSTZONE_DISABLED
depends on ARCH_HAVE_TRUSTZONE

config ARCH_TRUSTZONE_DISABLED
bool "TrustZone disabled, all CPUs operate in secure state"

config ARCH_TRUSTZONE_SECURE
bool "All CPUs operate secure state"
bool "TrustZone enabled, all CPUs operate secure state"

config ARCH_TRUSTZONE_NONSECURE
bool "All CPUs operate non-secure state"
bool "TrustZone enabled, all CPUs operate non-secure state"

endchoice # TrustZone Configuration

Expand Down
6 changes: 6 additions & 0 deletions arch/arm/src/armv7-a/arm_gicv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
#include "arm_internal.h"
#include "gic.h"

#if defined(CONFIG_ARCH_TRUSTZONE_SECURE) || defined(CONFIG_ARCH_TRUSTZONE_NONSECURE)
# if defined(CONFIG_ARCH_HIPRI_INTERRUPT)
# error "ARCH_HIPRI_INTERRUPT must configure with ARCH_TRUSTZONE_DISABLED or no trustzone"
# endif
#endif

#ifdef CONFIG_ARMV7A_HAVE_GICv2

/****************************************************************************
Expand Down

0 comments on commit e9c7cb4

Please sign in to comment.