#include <errno.h>
#include <linux/list.h>
-#ifdef CONFIG_DM_RNG
#include <rng.h>
-#endif
#include <splash.h>
#include <asm/io.h>
static void label_boot_kaslrseed(void)
{
-#ifdef CONFIG_DM_RNG
+#if CONFIG_IS_ENABLED(DM_RNG)
ulong fdt_addr;
struct fdt_header *working_fdt;
size_t n = 0x8;
u32 size;
int ret;
- if (!IS_ENABLED(CONFIG_DM_RNG))
+ if (!CONFIG_IS_ENABLED(DM_RNG))
return -ENOTSUPP;
if (ofnode_read_u32(node, "vbe,size", &size)) {
obj-$(CONFIG_MACH_PIC32) += ddr/microchip/
obj-$(CONFIG_FUZZ) += fuzz/
obj-$(CONFIG_DM_HWSPINLOCK) += hwspinlock/
-obj-$(CONFIG_DM_RNG) += rng/
+obj-$(CONFIG_$(SPL_TPL_)DM_RNG) += rng/
endif
obj-y += soc/
}
#if CONFIG_IS_ENABLED(OF_CONTROL)
if (ofnode_valid(scu_node)) {
- if (IS_ENABLED(CONFIG_DM_RNG)) {
+ if (CONFIG_IS_ENABLED(DM_RNG)) {
ret = device_bind_driver(NULL, "caam-rng", "caam-rng", NULL);
if (ret)
printf("Couldn't bind rng driver (%d)\n", ret);
return -1;
}
- if (IS_ENABLED(CONFIG_DM_RNG)) {
+ if (CONFIG_IS_ENABLED(DM_RNG)) {
ret = device_bind_driver(NULL, "caam-rng", "caam-rng",
NULL);
if (ret)
This interface is used to initialise the rng device and to
read the random seed from the device.
+config SPL_DM_RNG
+ bool "Driver support for Random Number Generator devices in SPL"
+ depends on SPL_DM
+ help
+ This option is an SPL-variant of the DM_RNG option.
+ See the help of DM_RNG for details.
+
if DM_RNG
config RNG_MESON
# Copyright (c) 2019, Linaro Limited
#
-obj-$(CONFIG_DM_RNG) += rng-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)DM_RNG) += rng-uclass.o
obj-$(CONFIG_RNG_MESON) += meson-rng.o
obj-$(CONFIG_RNG_SANDBOX) += sandbox_rng.o
obj-$(CONFIG_RNG_MSM) += msm_rng.o
struct udevice *devp;
u32 randv = 0;
- if (IS_ENABLED(CONFIG_DM_RNG)) {
+ if (CONFIG_IS_ENABLED(DM_RNG)) {
ret = uclass_get_device(UCLASS_RNG, 0, &devp);
if (!ret) {
ret = dm_rng_read(devp, &randv, sizeof(randv));
struct udevice *devp;
u32 randv = 0;
- if (IS_ENABLED(CONFIG_DM_RNG)) {
+ if (CONFIG_IS_ENABLED(DM_RNG)) {
ret = uclass_get_device(UCLASS_RNG, 0, &devp);
if (ret) {
ret = dm_rng_read(devp, &randv, sizeof(randv));
obj-$(CONFIG_SYSRESET) += sysreset.o
obj-$(CONFIG_DM_REGULATOR) += regulator.o
obj-$(CONFIG_CMD_RKMTD) += rkmtd.o
-obj-$(CONFIG_DM_RNG) += rng.o
+obj-$(CONFIG_$(SPL_TPL_)DM_RNG) += rng.o
obj-$(CONFIG_DM_RTC) += rtc.o
obj-$(CONFIG_SCMI_FIRMWARE) += scmi.o
obj-$(CONFIG_SCSI) += scsi.o