summaryrefslogtreecommitdiff
path: root/drivers/sysreset/sysreset_qemu_virt_ctrl.c
diff options
context:
space:
mode:
authorDaniel Palmer <[email protected]>2026-05-16 16:39:53 +0900
committerTom Rini <[email protected]>2026-05-22 16:47:54 -0600
commitccec4ce2ee8ae7c95a00b16da0b5dbd88615a8e2 (patch)
tree03b90632fe4000e0471c39710abb9ab9613bb42e /drivers/sysreset/sysreset_qemu_virt_ctrl.c
parent21a3b9f03b05467ec7422399a92a43f89dd2b526 (diff)
sysreset: qemu virt: Use map_sysmem()
In the platform data there is a phys_addr_t (an integer) for the address of the register and we pass that as-is into writel() which is fine in most places because we don't need to do any mapping and the macro for writel() does a cast to a pointer. If writel() is a static inline function the address argument is a pointer so passing it in as an integer without casting it first causes warnings or build failure. map_sysmem() handles the casting part and if phys_addr_t is 32bits when on a 64bit machine. Signed-off-by: Daniel Palmer <[email protected]> Acked-by: Kuan-Wei Chiu <[email protected]>
Diffstat (limited to 'drivers/sysreset/sysreset_qemu_virt_ctrl.c')
-rw-r--r--drivers/sysreset/sysreset_qemu_virt_ctrl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/sysreset/sysreset_qemu_virt_ctrl.c b/drivers/sysreset/sysreset_qemu_virt_ctrl.c
index e7cacc9b6e9..61b38d507fc 100644
--- a/drivers/sysreset/sysreset_qemu_virt_ctrl.c
+++ b/drivers/sysreset/sysreset_qemu_virt_ctrl.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <qemu_virt_ctrl.h>
#include <sysreset.h>
+#include <mapmem.h>
#include <asm/io.h>
#include <linux/err.h>
@@ -24,6 +25,7 @@
static int qemu_virt_ctrl_request(struct udevice *dev, enum sysreset_t type)
{
struct qemu_virt_ctrl_plat *plat = dev_get_plat(dev);
+ void __iomem *reg = map_sysmem(plat->reg + VIRT_CTRL_REG_CMD, 0x4);
u32 val;
switch (type) {
@@ -38,7 +40,7 @@ static int qemu_virt_ctrl_request(struct udevice *dev, enum sysreset_t type)
return -EPROTONOSUPPORT;
}
- writel(val, plat->reg + VIRT_CTRL_REG_CMD);
+ writel(val, reg);
return -EINPROGRESS;
}