mrst.c: reimplement the force cold boot properly
authorBenoit Romieu <benoit.romieu@intel.com>
Tue, 7 Feb 2012 16:44:49 +0000 (17:44 +0100)
committerbuildbot <buildbot@intel.com>
Fri, 17 Feb 2012 10:33:43 +0000 (02:33 -0800)
BZ: 22672

Do a cold reset in normal case. Do a cold boot depending of module param force_cold_boot.

Change-Id: I422ac66c070f24c287fc625e1d282e2be71cbe84
Reviewed-on: http://android.intel.com:8080/34345
Reviewed-by: Kuppuswamy, Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
arch/x86/platform/intel-mid/intel-mid.c
arch/x86/platform/intel-mid/intel_mid_weak_decls.h
arch/x86/platform/intel-mid/mfld.c
arch/x86/platform/intel-mid/mrst.c

index 631534f..a0c7b80 100644 (file)
@@ -254,6 +254,24 @@ int intel_mid_i8042_detect(void)
        return 0;
 }
 
+static int force_cold_boot;
+module_param(force_cold_boot, bool, 0644);
+MODULE_PARM_DESC(force_cold_boot,
+                "Set to Y to force a COLD BOOT instead of a COLD RESET "
+                "on the next reboot system call.");
+
+static void intel_mid_reboot(void)
+{
+       if (intel_scu_ipc_medfw_upgrade()) {
+               pr_debug("intel_scu_ipc: IFWI upgrade failed...\n");
+               BUG();
+       }
+       if (force_cold_boot)
+               intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0);
+       else
+               intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
+}
+
 /*
  * Moorestown specific x86_init function overrides and early setup
  * calls.
index 420685f..abff38e 100644 (file)
@@ -13,6 +13,5 @@
 
 /* __attribute__((weak)) makes these declarations overridable */
 extern struct devs_id __initconst device_ids[] __attribute__((weak));
-extern void intel_mid_reboot(void) __attribute__((weak));
 extern void intel_mid_power_off(void) __attribute__((weak));
 extern unsigned long __init intel_mid_calibrate_tsc(void) __attribute__((weak));
index 180735c..b188a0c 100644 (file)
@@ -87,15 +87,6 @@ void intel_mid_power_off(void)
                mfld_power_off();
 }
 
-void intel_mid_reboot(void)
-{
-       if (intel_scu_ipc_medfw_upgrade()) {
-               pr_debug("intel_scu_ipc: IFWI upgrade failed...\n");
-               BUG();
-       }
-       intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0);
-}
-
 unsigned long __init intel_mid_calibrate_tsc(void)
 {
        unsigned long flags, fast_calibrate;
index 70df7c4..22db8fb 100644 (file)
@@ -41,15 +41,6 @@ void intel_mid_power_off(void)
        intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1);
 }
 
-void intel_mid_reboot(void)
-{
-       if (intel_scu_ipc_medfw_upgrade()) {
-               pr_debug("intel_scu_ipc: IFWI upgrade failed...\n");
-               BUG();
-       }
-       intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
-}
-
 unsigned long __init intel_mid_calibrate_tsc(void)
 {
        unsigned long flags, fast_calibrate;