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 <anisetti.avinash.krishna@intel.com>
This commit is contained in:
Anisetti Avinash Krishna 2024-09-13 12:23:13 +05:30 committed by Benjamin Cabé
commit 9353abf162

View file

@ -27,12 +27,22 @@ static inline void cold_reboot(void)
sys_out8(reset_value, X86_RST_CNT_REG); 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) void __weak sys_arch_reboot(int type)
{ {
switch (type) { switch (type) {
case SYS_REBOOT_COLD: case SYS_REBOOT_COLD:
cold_reboot(); cold_reboot();
break; break;
case SYS_REBOOT_WARM:
warm_reboot();
break;
default: default:
/* do nothing */ /* do nothing */
break; break;