From 9353abf16249c8e2e90769cbb5c8553df9d2beaa Mon Sep 17 00:00:00 2001 From: Anisetti Avinash Krishna Date: Fri, 13 Sep 2024 12:23:13 +0530 Subject: [PATCH] arch: x86: core: reboot_rst_cnt: Enable support for warm reboot Enable support for warm reboot for x86 arch as per the Reset Control Register description. Signed-off-by: Anisetti Avinash Krishna --- arch/x86/core/reboot_rst_cnt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/core/reboot_rst_cnt.c b/arch/x86/core/reboot_rst_cnt.c index e20b5b7ae33..3eafcf9709c 100644 --- a/arch/x86/core/reboot_rst_cnt.c +++ b/arch/x86/core/reboot_rst_cnt.c @@ -27,12 +27,22 @@ static inline void cold_reboot(void) sys_out8(reset_value, X86_RST_CNT_REG); } +static inline void warm_reboot(void) +{ + uint8_t reset_value = X86_RST_CNT_CPU_RST | X86_RST_CNT_SYS_RST; + + sys_out8(reset_value, X86_RST_CNT_REG); +} + void __weak sys_arch_reboot(int type) { switch (type) { case SYS_REBOOT_COLD: cold_reboot(); break; + case SYS_REBOOT_WARM: + warm_reboot(); + break; default: /* do nothing */ break;