diff options
Diffstat (limited to 'include/drivers')
-rw-r--r-- | include/drivers/marvell/mochi/cp110_setup.h | 9 | ||||
-rw-r--r-- | include/drivers/rambus/trng_ip_76.h | 18 |
2 files changed, 27 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); diff --git a/include/drivers/rambus/trng_ip_76.h b/include/drivers/rambus/trng_ip_76.h new file mode 100644 index 0000000000..6de8fc73e4 --- /dev/null +++ b/include/drivers/rambus/trng_ip_76.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020, Marvell Technology Group Ltd. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +#ifndef __TRNG_IP_76_H__ +#define __TRNG_IP_76_H__ + +#include <stdbool.h> +#include <stdint.h> + +int32_t eip76_rng_read_rand_buf(void *data, bool wait); +int32_t eip76_rng_probe(uintptr_t base_addr); +int32_t eip76_rng_get_random(uint8_t *data, uint32_t len); + +#endif /* __TRNG_IP_76_H__ */ |