suspend:resume arm errata818325
authorxxx <xxx@rock-chips.com>
Tue, 1 Jul 2014 07:43:34 +0000 (15:43 +0800)
committerxxx <xxx@rock-chips.com>
Tue, 1 Jul 2014 07:43:34 +0000 (15:43 +0800)
arch/arm/mach-rockchip/pm-rk3288.c
arch/arm/mach-rockchip/pm.h [changed mode: 0644->0755]
arch/arm/mach-rockchip/sleep.S [changed mode: 0644->0755]

index 1e0e2a36e2b75e1fa789f5a63a638076a8053ed8..043f259b4a5e0c69c14c8cfbd605a104544bc7e8 100755 (executable)
@@ -810,8 +810,18 @@ static void gpio_ddr_dump_reg(int ports)
  {
      u32 l2ctlr;
      asm("mrc p15, 1, %0, c9, c0, 2" : "=r" (l2ctlr));
-         return l2ctlr;
+      return l2ctlr;
  }
+
+static inline u32 rkpm_armerrata_818325(void)
+{
+    u32 armerrata;
+    asm("mrc p15, 0, %0, c15, c0, 1" : "=r" (armerrata));
+    return armerrata;
+}
+
+
+
 /**************************************sleep func**************************/
 
 void ddr_reg_save(uint32_t *pArg);
@@ -1060,11 +1070,23 @@ static void sram_code_data_save(u32 pwrmode)
         {   
             sleep_resume_data[RKPM_BOOTDATA_L2LTY_F]=1;
             sleep_resume_data[RKPM_BOOTDATA_L2LTY]=rkpm_l2_config();// in sys resume ,ddr is need resume       
-            sleep_resume_data[RKPM_BOOTDATA_CPUSP]=RKPM_BOOT_CPUSP_PHY;// in sys resume ,ddr is need resume    
-            sleep_resume_data[RKPM_BOOTDATA_CPUCODE]=virt_to_phys(cpu_resume);// in sys resume ,ddr is need resume    
+            
+            sleep_resume_data[RKPM_BOOTDATA_ARM_ERRATA_818325_F]=1;
+            sleep_resume_data[RKPM_BOOTDATA_ARM_ERRATA_818325]=rkpm_armerrata_818325();//
+        
+            sleep_resume_data[RKPM_BOOTDATA_CPUSP]=RKPM_BOOT_CPUSP_PHY;// in sys resume ,ddr is need resume                
+            sleep_resume_data[RKPM_BOOTDATA_CPUCODE]=virt_to_phys(cpu_resume);// in sys resume ,ddr is need resume  
+            #if 0
+            rkpm_ddr_printascii("l2&arm_errata--");   
+            rkpm_ddr_printhex(rkpm_l2_config());             
+            rkpm_ddr_printhex(rkpm_armerrata_818325());
+            rkpm_ddr_printascii("\n");  
+            #endif
         }
         else
         {
+            sleep_resume_data[RKPM_BOOTDATA_L2LTY_F]=0;
+            sleep_resume_data[RKPM_BOOTDATA_ARM_ERRATA_818325_F]=0;       
             sleep_resume_data[RKPM_BOOTDATA_CPUCODE]=0;
             return ;
         }
@@ -1259,13 +1281,19 @@ static void rkpm_save_setting(u32 ctrbits)
 }
 static void rkpm_save_setting_resume(void)
 {
+
+        #if 0
+        rkpm_ddr_printascii("l2&arm_errata--");   
+        rkpm_ddr_printhex(rkpm_l2_config());             
+        rkpm_ddr_printhex(rkpm_armerrata_818325());
+        rkpm_ddr_printascii("\n");            
+        #endif
                    
          if(rk3288_powermode&BIT(pmu_pwr_mode_en))
         {
             sram_code_data_resume(rk3288_powermode); 
             rkpm_peri_resume(rk3288_powermode);
-        }
-         
+        }         
          rkpm_slp_mode_set_resume();       
 
 }
old mode 100644 (file)
new mode 100755 (executable)
index be9b610..b1e748e
 // index data off in SLP_DATA_SAVE_BASE
 // it may be include in *.s ,so con't use enum type define
 
-#define RKPM_BOOTDATA_L2LTY_F             (0)  //save l2 latency val
-#define RKPM_BOOTDATA_L2LTY             (RKPM_BOOTDATA_L2LTY_F+1)
-#define RKPM_BOOTDATA_CPUSP            (RKPM_BOOTDATA_L2LTY+1)  //cpu sp addr
+
+
+#define RKPM_BOOTDATA_CPUSP            (0)  //cpu sp addr
 #define RKPM_BOOTDATA_CPUCODE       (RKPM_BOOTDATA_CPUSP+1)  //cpu resume fun,phy base
 #define RKPM_BOOTDATA_DDR_F            (RKPM_BOOTDATA_CPUCODE+1)  //ddr flag , 1 need to resume ddr ctr
 #define RKPM_BOOTDATA_DPLL_F          (RKPM_BOOTDATA_DDR_F+1) //ddr pll flag, 1  need to resume dpll
 #define RKPM_BOOTDATA_DDRCODE       (RKPM_BOOTDATA_DPLL_F+1) //ddr resume code ,phy base
 #define RKPM_BOOTDATA_DDRDATA       (RKPM_BOOTDATA_DDRCODE+1) //ddr resume data ,phy base
-#define RKPM_BOOTDATA_ARR_SIZE  (RKPM_BOOTDATA_DDRDATA+1)
+// for l2 resume
+#define RKPM_BOOTDATA_L2LTY_F             (RKPM_BOOTDATA_DDRDATA+1)  //save l2 latency val
+#define RKPM_BOOTDATA_L2LTY             (RKPM_BOOTDATA_L2LTY_F+1)
+// for arm errata 81835 resume
+#define RKPM_BOOTDATA_ARM_ERRATA_818325_F            (RKPM_BOOTDATA_L2LTY+1)  //save l2 latency val
+#define RKPM_BOOTDATA_ARM_ERRATA_818325             (RKPM_BOOTDATA_ARM_ERRATA_818325_F+1)
+
+#define RKPM_BOOTDATA_ARR_SIZE  (RKPM_BOOTDATA_ARM_ERRATA_818325+1)
 
 
 
old mode 100644 (file)
new mode 100755 (executable)
index f1cd0ef..1839b5d
@@ -92,11 +92,21 @@ v7_invalidate_l1:
         ldr r5,8f     // resume data  offset ,from ram base
         add r5,r5,r1 // resume data addr
         
-        //l2
+        //l2 resume 
+        ldr r3 ,[r5,#(RKPM_BOOTDATA_L2LTY_F*4)] // l2 resume flags
+        cmp r3,#1
+        bne arm_errata__818325
         ldr r3 ,[r5,#(RKPM_BOOTDATA_L2LTY*4)]
-        mcr p15, 1, r3, c9, c0, 2
-
-        //sp
+        mcr p15, 1, r3, c9, c0, 2   
+        
+arm_errata__818325:
+        ldr r3 ,[r5,#(RKPM_BOOTDATA_ARM_ERRATA_818325_F*4)]
+        cmp r3,#1
+        bne sp_set
+        ldr r3 ,[r5,#(RKPM_BOOTDATA_ARM_ERRATA_818325*4)]
+        mcreq   p15, 0, r3, c15, c0, 1
+
+sp_set:        //sp
         ldr sp,[r5,#(RKPM_BOOTDATA_CPUSP*4)]   //sp      
         
        ldr r3,[r5,#(RKPM_BOOTDATA_DDR_F*4)]   //get SLP_DDR_NEED_RES ,if it is 1 ,ddr need to reusme