drivers: entropy: Add support for SCE7 to entropy driver
add support SCE7 to entropy driver for Renesas RA Signed-off-by: Danh Doan <danh.doan.ue@bp.renesas.com>
This commit is contained in:
parent
9d06cd7510
commit
c432f3dcad
5 changed files with 40 additions and 23 deletions
|
@ -25,15 +25,15 @@ if(CONFIG_FAKE_ENTROPY_NATIVE_POSIX)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_USERSPACE entropy_handlers.c)
|
zephyr_library_sources_ifdef(CONFIG_USERSPACE entropy_handlers.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_RV32M1_TRNG entropy_rv32m1_trng.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_RV32M1_TRNG entropy_rv32m1_trng.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_GECKO_TRNG entropy_gecko_trng.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_GECKO_TRNG entropy_gecko_trng.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_NEORV32_TRNG entropy_neorv32_trng.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_NEORV32_TRNG entropy_neorv32_trng.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_BT_HCI entropy_bt_hci.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_BT_HCI entropy_bt_hci.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_GECKO_SE entropy_gecko_se.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_GECKO_SE entropy_gecko_se.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_PSA_CRYPTO_RNG entropy_psa_crypto.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_PSA_CRYPTO_RNG entropy_psa_crypto.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_NPCX_DRBG entropy_npcx_drbg.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_NPCX_DRBG entropy_npcx_drbg.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_MAX32_TRNG entropy_max32.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_MAX32_TRNG entropy_max32.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_ENTROPY_RENESAS_RA_RSIP_E51A_TRNG entropy_renesas_ra.c)
|
zephyr_library_sources_ifdef(CONFIG_ENTROPY_RENESAS_RA entropy_renesas_ra.c)
|
||||||
|
|
||||||
zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api)
|
zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api)
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
|
|
||||||
# Renesas RA entropy generator driver configuration
|
# Renesas RA entropy generator driver configuration
|
||||||
|
|
||||||
config ENTROPY_RENESAS_RA_RSIP_E51A_TRNG
|
config ENTROPY_RENESAS_RA
|
||||||
bool "Renesas RA RSIP-E51A TRNG driver"
|
bool "Renesas RA TRNG driver"
|
||||||
default y
|
default y
|
||||||
depends on DT_HAS_RENESAS_RA_RSIP_E51A_TRNG_ENABLED
|
depends on DT_HAS_RENESAS_RA_RSIP_E51A_TRNG_ENABLED || DT_HAS_RENESAS_RA_SCE7_RNG_ENABLED
|
||||||
select ENTROPY_HAS_DRIVER
|
select ENTROPY_HAS_DRIVER
|
||||||
select USE_RA_FSP_SCE
|
select USE_RA_FSP_SCE
|
||||||
help
|
help
|
||||||
This option enables the Renesas RA RSIP-E51A RNG.
|
This option enables entropy driver for Renesas RA
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DT_DRV_COMPAT renesas_ra_rsip_e51a_trng
|
|
||||||
|
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <zephyr/drivers/entropy.h>
|
#include <zephyr/drivers/entropy.h>
|
||||||
|
|
||||||
#include "hw_sce_trng_private.h"
|
#include "hw_sce_trng_private.h"
|
||||||
#include "hw_sce_private.h"
|
#include "hw_sce_private.h"
|
||||||
|
|
||||||
static int entropy_ra_rsip_trng_get_entropy(const struct device *dev, uint8_t *buf, uint16_t len)
|
static int entropy_renesas_ra_get_entropy(const struct device *dev, uint8_t *buf, uint16_t len)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
|
|
||||||
|
@ -35,15 +33,19 @@ static int entropy_ra_rsip_trng_get_entropy(const struct device *dev, uint8_t *b
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_API(entropy, entropy_ra_rsip_trng_api) = {
|
static DEVICE_API(entropy, entropy_renesas_ra_api) = {
|
||||||
.get_entropy = entropy_ra_rsip_trng_get_entropy,
|
.get_entropy = entropy_renesas_ra_get_entropy,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int entropy_ra_rsip_trng_init(const struct device *dev)
|
static int entropy_renesas_ra_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
HW_SCE_McuSpecificInit();
|
HW_SCE_McuSpecificInit();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_DT_INST_DEFINE(0, entropy_ra_rsip_trng_init, NULL, NULL, NULL, PRE_KERNEL_1,
|
#define RENESAS_RA_ENTROPY_INIT(nodeid) \
|
||||||
CONFIG_ENTROPY_INIT_PRIORITY, &entropy_ra_rsip_trng_api);
|
DEVICE_DT_DEFINE(nodeid, entropy_renesas_ra_init, NULL, NULL, NULL, PRE_KERNEL_1, \
|
||||||
|
CONFIG_ENTROPY_INIT_PRIORITY, &entropy_renesas_ra_api)
|
||||||
|
|
||||||
|
DT_FOREACH_STATUS_OKAY(renesas_ra_rsip_e51a_trng, RENESAS_RA_ENTROPY_INIT)
|
||||||
|
DT_FOREACH_STATUS_OKAY(renesas_ra_sce7_rng, RENESAS_RA_ENTROPY_INIT)
|
||||||
|
|
8
dts/bindings/rng/renesas,ra-sce7-rng.yaml
Normal file
8
dts/bindings/rng/renesas,ra-sce7-rng.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Copyright (c) 2024 Renesas Electronics Corporation
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
description: Renesas RA SCE7 TRNG
|
||||||
|
|
||||||
|
compatible: "renesas,ra-sce7-rng"
|
||||||
|
|
||||||
|
include: base.yaml
|
|
@ -50,10 +50,17 @@ if USE_RA_FSP_SCE
|
||||||
config HAS_RENESAS_RA_RSIP_E51A
|
config HAS_RENESAS_RA_RSIP_E51A
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
depends on ENTROPY_RENESAS_RA_RSIP_E51A_TRNG
|
depends on DT_HAS_RENESAS_RA_RSIP_E51A_TRNG_ENABLED
|
||||||
help
|
help
|
||||||
Includes RSIP-E51A implementation for SCE driver
|
Includes RSIP-E51A implementation for SCE driver
|
||||||
|
|
||||||
|
config HAS_RENESAS_RA_SCE7
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
depends on DT_HAS_RENESAS_RA_SCE7_RNG_ENABLED
|
||||||
|
help
|
||||||
|
Includes SCE7 implementation for SCE driver
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
config USE_RA_FSP_SPI_B
|
config USE_RA_FSP_SPI_B
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue