Skip to contentSkip to conversation

rng: iproc_rng200: Enable support for RPi4 armv7

PATCH New matthias.bgg at kernel.org 1 participant 2 messages Feb 26, 2021 Broadcom iproc Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rng: iproc_rng200: Enable support for RPi4 armv7

From: Matthias Brugger <[email protected]>

On the RPi4 armv7 build we have the situationt that we use physical addresses of 64 bit, while the virtual addresses are 32 bit. Remap the base address in this scenario via map_physmem().

---

 drivers/rng/iproc_rng200.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/rng/iproc_rng200.c +4 -4
index 1126bbd797..85ac15bf9c 100644
@@ -34,12 +34,12 @@
 #define RNG_FIFO_COUNT_RNG_FIFO_COUNT_MASK		0x000000FF
 
 struct iproc_rng200_plat {
-	fdt_addr_t base;
+	void __iomem *base;
 };
 
 static void iproc_rng200_enable(struct iproc_rng200_plat *pdata, bool enable)
 {
-	fdt_addr_t rng_base = pdata->base;
+	void __iomem *rng_base = pdata->base;
 	u32 val;
 
 	val = readl(rng_base + RNG_CTRL_OFFSET);
@@ -54,7 +54,7 @@ static void iproc_rng200_enable(struct iproc_rng200_plat *pdata, bool enable)
 
 static void iproc_rng200_restart(struct iproc_rng200_plat *pdata)
 {
-	fdt_addr_t rng_base = pdata->base;
+	void __iomem *rng_base = pdata->base;
 	u32 val;
 
 	iproc_rng200_enable(pdata, false);
@@ -156,7 +156,7 @@ static int iproc_rng200_of_to_plat(struct udevice *dev)
 {
 	struct iproc_rng200_plat *pdata = dev_get_plat(dev);
 
-	pdata->base = dev_read_addr(dev);
+	pdata->base = devfdt_map_physmem(dev, sizeof(void *));
 	if (!pdata->base)
 		return -ENODEV;
 
Signature · 1 line
2.30.0
#1 lore raw

PATCH 2/2 configs: rpi4_32: Enable iProc RNG200

From: Matthias Brugger <[email protected]>

Enable the RNG driver for RPi4 with 32 bit.

---

 configs/rpi_4_32b_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/rpi_4_32b_defconfig +2 -0
index 0a5d3ff8cd..91eeb3cd32 100644
@@ -37,6 +37,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
Signature · 1 line
2.30.0