From 1613cf506c68ea4361ac6c8287932ba86e5e04a2 Mon Sep 17 00:00:00 2001
From: Matthias Brugger <mbrugger@suse.com>
Date: Tue, 15 Dec 2020 10:49:24 +0100
Subject: [PATCH] config: Enable iProc RNG200 driver in RPi4 configs

We find the iProc RNG200 in the Raspberry Pi 4. Add it to all it's
config so that it can be used.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
[mb: drop rpi_4_32b_defconfig]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 configs/rpi_4_defconfig     | 2 ++
 configs/rpi_arm64_defconfig | 2 ++
 drivers/rng/iproc_rng200.c  | 1 -
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
index 2590d0a696..46b6cc3046 100644
--- a/configs/rpi_4_defconfig
+++ b/configs/rpi_4_defconfig
@@ -36,6 +36,8 @@ CONFIG_PCI_BRCMSTB=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_DM_RESET=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_IPROC200=y
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 CONFIG_USB=y
 CONFIG_DM_USB=y
diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig
index 2639219a1a..b75144036d 100644
--- a/configs/rpi_arm64_defconfig
+++ b/configs/rpi_arm64_defconfig
@@ -33,6 +33,8 @@ CONFIG_PCI_BRCMSTB=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_DM_RESET=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_IPROC200=y
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 CONFIG_USB=y
 CONFIG_DM_USB=y
diff --git a/drivers/rng/iproc_rng200.c b/drivers/rng/iproc_rng200.c
index de6672e955..f71f285f53 100644
--- a/drivers/rng/iproc_rng200.c
+++ b/drivers/rng/iproc_rng200.c
@@ -50,7 +50,6 @@ static void iproc_rng200_enable(struct iproc_rng200_platdata *pdata, bool enable
 		val &= ~RNG_CTRL_RNG_RBGEN_ENABLE;
 
 	writel(val, rng_base + RNG_CTRL_OFFSET);
-
 }
 
 static void iproc_rng200_restart(struct iproc_rng200_platdata *pdata)
-- 
2.39.5