reboot: Allow specifying warm/cold reset for CF9 boot type
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / reboot.c
index 563ed91e6faa3a2adac62ddeb8caff7e5ad50f24..ca42f6350b23b68df5f5123598f75b42da45fa86 100644 (file)
@@ -511,10 +511,13 @@ static void native_machine_emergency_restart(void)
 
                case BOOT_CF9_COND:
                        if (port_cf9_safe) {
-                               u8 cf9 = inb(0xcf9) & ~6;
+                               u8 reboot_code = reboot_mode == REBOOT_WARM ?
+                                       0x06 : 0x0E;
+                               u8 cf9 = inb(0xcf9) & ~reboot_code;
                                outb(cf9|2, 0xcf9); /* Request hard reset */
                                udelay(50);
-                               outb(cf9|6, 0xcf9); /* Actually do the reset */
+                               /* Actually do the reset */
+                               outb(cf9|reboot_code, 0xcf9);
                                udelay(50);
                        }
                        reboot_type = BOOT_KBD;