summaryrefslogtreecommitdiff
path: root/drivers/sysreset/sysreset_qemu_virt_ctrl.c
AgeCommit message (Collapse)Author
2026-05-22sysreset: qemu virt: Use __raw_writel()Daniel Palmer
The virt ctrl register seems to be native endian, currently this driver uses writel(), which works by luck because its currently broken on m68k. Use __raw_writel() instead to avoid breaking this driver when the endianness of writel() is fixed. Acked-by: Kuan-Wei Chiu <[email protected]> Reviewed-by: Angelo Dureghello <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Daniel Palmer <[email protected]>
2026-05-22sysreset: qemu virt: Use map_sysmem()Daniel Palmer
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]>
2026-02-02sysreset: Add QEMU virtual system controller driverKuan-Wei Chiu
Introduce a new sysreset driver for the QEMU Virtual System Controller. This device is found on QEMU "virt" machines (such as the m68k virt target) and provides a mechanism to trigger system reset and power-off events. The driver maps U-Boot sysreset types to the corresponding controller commands: - SYSRESET_WARM / SYSRESET_COLD -> VIRT_CTRL_CMD_RESET - SYSRESET_POWER_OFF -> VIRT_CTRL_CMD_HALT Signed-off-by: Kuan-Wei Chiu <[email protected]> Reviewed-by: Simon Glass <[email protected]>