MFLD Power off support:
authorsathya <sathyanarayanan.kuppuswamy@intel.com>
Wed, 16 Nov 2011 23:30:12 +0000 (15:30 -0800)
committerGross, Mark <mark.gross@intel.com>
Sat, 19 Nov 2011 07:58:31 +0000 (23:58 -0800)
Merged changes from git://jfumg-gcrmirror.jf.intel.com/a/bsp/hardware/intel/linux-2.6.git

commit 9281a8b9e1ce267b74e5b73fa6ac822f5c1a8aa4
Author: Pavan <pavan.kumar.s@intel.com>
Date:   Thu Sep 15 16:23:50 2011 +0100

    mid_pmu: implement mfld_shutdown to send S5 pmu command

    BZ: 5512

    mfld_shutdown function is implemented to issue S5 pmu command
    This will be invoked from mrst.c to enter into S5. S5 sequence is
    necessary to sync vRTC to RTC

    Change-Id: Ie31291a24fdd1437b9ab6711907ce90aff08a65b
Signed-off-by: Pavan <pavan.kumar.s@intel.com>
    Orig-Change-Id: Ifb39bcc457c59aaa9865559e45b7429327edf05e
    Reviewed-on: http://android.intel.com:8080/19746
Reviewed-by: Martin, LoicX <loicx.martin@intel.com>
Reviewed-by: Mansoor, Illyas <illyas.mansoor@intel.com>
Reviewed-by: Mendi, EduardoX <eduardox.mendi@intel.com>
Tested-by: Martin, LoicX <loicx.martin@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Change-Id: I83f74c2c8a172ae19b06bc79b2cd51f661d66008
Reviewed-on: http://android.intel.com:8080/24608
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Gross, Mark <mark.gross@intel.com>
arch/x86/platform/mfld/pmu.c
arch/x86/platform/mfld/pmu.h
arch/x86/platform/mrst/mrst.c
include/linux/intel_mid_pm.h

index bdaf4e3..21a7432 100755 (executable)
@@ -2410,6 +2410,20 @@ static int mid_suspend(suspend_state_t state)
        return ret;
 }
 
+void mfld_shutdown(void)
+{
+       down(&scu_ready_sem);
+       /* wait till SCU is ready */
+       if (_pmu2_wait_not_busy())
+               dev_err(&pmu_dev->dev, "SCU BUSY. Unable to Enter S5\n");
+       else
+               /*send S5 command to SCU*/
+               writel(S5_VALUE, &pmu_reg->pm_cmd);
+
+       /* no more pm command expected. So not doing sem up */
+
+}
+
 static void mid_end(void)
 {
 #ifdef CONFIG_HAS_WAKELOCK
index fb7515e..7b14820 100644 (file)
 /* some random number for initvalue */
 #define        MID_PCI_INDEX_HASH_INITVALUE    0x27041975
 
+#define S5_VALUE       0x309D2601
 #define S0I1_VALUE     0X30992601
 #define LPMP3_VALUE    0X40492601
 #define S0I3_VALUE     0X309B2601
index 1c2ac27..aa10935 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/notifier.h>
+#include <linux/intel_mid_pm.h>
 
 #include <asm/setup.h>
 #include <asm/mpspec_def.h>
@@ -88,6 +89,10 @@ static void mrst_power_off(void)
 {
        if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
                intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1);
+       else {
+               mfld_shutdown();
+       }
+
 }
 
 static void mrst_reboot(void)
index 6774e1f..4532b4b 100644 (file)
@@ -144,6 +144,7 @@ extern void pmu_enable_forward_msi(void);
 extern unsigned long pmu_get_cstate(unsigned long eax);
 extern int pmu_nc_set_power_state
        (int islands, int state_type, int reg_type);
+extern void mfld_shutdown(void);
 
 #else