]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rng: iproc_rng200: Enable support for RPi4 armv7
authorMatthias Brugger <mbrugger@suse.com>
Fri, 26 Feb 2021 10:48:00 +0000 (11:48 +0100)
committerMatthias Brugger <mbrugger@suse.com>
Tue, 2 Mar 2021 12:53:48 +0000 (13:53 +0100)
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().

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
drivers/rng/iproc_rng200.c

index 1126bbd797edbea361be26eca21ee8bb5d964880..85ac15bf9ca9ff217f37bff397622eefcbd48614 100644 (file)
 #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;