aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRouven Czerwinski <rouven@czerwinskis.de>2019-03-12 11:06:25 +0100
committerJoakim Bech <joakim.bech@linaro.org>2019-04-15 15:30:30 +0700
commit7eedcd151e9c7b5eb56ab2f6379ee9c3de77e8c4 (patch)
treebdf3fbe1b65bb835a762fd1d4b64ce63e31d9489 /core
parent525c44ee7f3b0f10ca4f3b7f0bb5b899e2bccbc6 (diff)
tzc380: add function to retrieve action register
The TZC380 IP has an action configuration which defines the action taken if a region is accessed with the wrong permissions. Devices do not have to set the action register explicitly, add a function to retrieve the default configuration. Signed-off-by: Rouven Czerwinski <rouven@czerwinskis.de> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'core')
-rw-r--r--core/drivers/tzc380.c12
-rw-r--r--core/include/drivers/tzc380.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/core/drivers/tzc380.c b/core/drivers/tzc380.c
index 3cebddf6..2827cfb5 100644
--- a/core/drivers/tzc380.c
+++ b/core/drivers/tzc380.c
@@ -62,6 +62,11 @@ static void tzc_write_action(vaddr_t base, enum tzc_action action)
io_write32(base + ACTION_OFF, action);
}
+static uint32_t tzc_read_action(vaddr_t base)
+{
+ return io_read32(base + ACTION_OFF);
+}
+
static void tzc_write_region_base_low(vaddr_t base, uint32_t region,
uint32_t val)
{
@@ -204,6 +209,13 @@ void tzc_set_action(enum tzc_action action)
tzc_write_action(tzc.base, action);
}
+uint32_t tzc_get_action(void)
+{
+ assert(tzc.base);
+
+ return tzc_read_action(tzc.base);
+}
+
#if TRACE_LEVEL >= TRACE_DEBUG
static uint32_t tzc_read_region_base_low(vaddr_t base, uint32_t region)
diff --git a/core/include/drivers/tzc380.h b/core/include/drivers/tzc380.h
index 970be536..24708d0c 100644
--- a/core/include/drivers/tzc380.h
+++ b/core/include/drivers/tzc380.h
@@ -201,6 +201,7 @@ void tzc_configure_region(uint8_t region, vaddr_t region_base, uint32_t attr);
void tzc_region_enable(uint8_t region);
void tzc_security_inversion_en(vaddr_t base);
void tzc_set_action(enum tzc_action action);
+uint32_t tzc_get_action(void);
void tzc_fail_dump(void);
void tzc_int_clear(void);