aboutsummaryrefslogtreecommitdiff
path: root/include/drivers
diff options
context:
space:
mode:
authorKonstantin Porotchkin <kostap@marvell.com>2020-01-30 11:19:43 +0200
committerKonstantin Porotchkin <kostap@marvell.com>2021-02-11 09:43:18 +0000
commitc42d5eeaf1be694a759a647994efc5ce0eea6a98 (patch)
treeaaec284e9144bc559e5bb2937340e12152077320 /include/drivers
parent1e179c7946134c839d83aeff8bdf5a94315fac6e (diff)
downloadtrusted-firmware-a-c42d5eeaf1be694a759a647994efc5ce0eea6a98.tar.gz
include/drivers/marvell/mochi: add detection of secure mode
Change-Id: I99afc312617df86ae68eb30302203a03877ca748 Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: https://sj1git1.cavium.com/22541 Reviewed-by: Stefan Chulski <stefanc@marvell.com> Reviewed-by: Grzegorz Jaszczyk <jaszczyk@marvell.com> Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com>
Diffstat (limited to 'include/drivers')
-rw-r--r--include/drivers/marvell/mochi/cp110_setup.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/drivers/marvell/mochi/cp110_setup.h b/include/drivers/marvell/mochi/cp110_setup.h
index 11dc4e0201..4a69257264 100644
--- a/include/drivers/marvell/mochi/cp110_setup.h
+++ b/include/drivers/marvell/mochi/cp110_setup.h
@@ -31,6 +31,9 @@
#define MAX_STREAM_ID_PER_CP (0x10)
#define STREAM_ID_BASE (0x40)
+#define MVEBU_SECUREBOOT_CTRL_REG (MVEBU_RFU_BASE + 0x4730)
+#define MVEBU_SECUREBOOT_EN_MASK BIT(0)
+
static inline uint32_t cp110_device_id_get(uintptr_t base)
{
/* Returns:
@@ -50,6 +53,12 @@ static inline uint32_t cp110_rev_id_get(uintptr_t base)
MVEBU_DEVICE_REV_OFFSET;
}
+static inline uint32_t is_secure(void)
+{
+ return !!(mmio_read_32(MVEBU_SECUREBOOT_CTRL_REG) &
+ MVEBU_SECUREBOOT_EN_MASK);
+}
+
void cp110_init(uintptr_t cp110_base, uint32_t stream_id);
void cp110_ble_init(uintptr_t cp110_base);
void cp110_amb_init(uintptr_t base);