fixed : rkpm_ddr_regs_dump
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rockchip / rockchip_pm.c
old mode 100644 (file)
new mode 100755 (executable)
index 48834b0..7d2c14a
@@ -23,23 +23,32 @@ void rkpm_ddr_reg_offset_dump(void __iomem * base_addr,u32 _offset)
 void  rkpm_ddr_regs_dump(void __iomem * base_addr,u32 start_offset,u32 end_offset)
 {
        u32 i;
-        u32 line=0;
+        //u32 line=0;
 
         rkpm_ddr_printascii("start from:");     
         rkpm_ddr_printhex((u32)(base_addr +start_offset));       
         rkpm_ddr_printch('\n');
+                   
         
        for(i=start_offset;i<=end_offset;)
        {
+         
             rkpm_ddr_printhex(reg_readl((base_addr + i)));  
-            line++;
-            if((line%4==0)||i==end_offset)
+            if(i%16==12) 
+            {   
                 rkpm_ddr_printch('\n');
-            else              
-                rkpm_ddr_printch('-');
-            i+=4;
+            }
+            else
+            {
+                    if(i!=end_offset)
+                    rkpm_ddr_printch('-');
+                    else                        
+                    rkpm_ddr_printch('\n');
+            }
+            i=i+4;
        } 
     
+    
 }
 
 static struct rkpm_ops pm_ops={NULL};
@@ -416,21 +425,19 @@ static int rk_lpmode_enter(unsigned long arg)
 
 
 int cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
-
 static int rkpm_enter(suspend_state_t state)
 {
-        printk("%s\n",__FUNCTION__);
-
-        
+       //static u32 test_count=0;
+        // printk(KERN_DEBUG"pm: ");
+        printk("%s:\n",__FUNCTION__);
+        //printk("pm test times=%d\n",++test_count);
+       
         RKPM_DDR_FUN(prepare);   
         
-        printk(KERN_DEBUG "pm: ");
-
         rkpm_ctrbits_prepare();
          
-      //  if(rkpm_chk_jdg_ctrbits(RKPM_CTR_RET_DIRT))
-      //  return 0;
+        //  if(rkpm_chk_jdg_ctrbits(RKPM_CTR_RET_DIRT))
+        //  return 0;
       
         rkpm_ddr_printch('0');
 
@@ -458,8 +465,6 @@ static int rkpm_enter(suspend_state_t state)
 
         rkpm_ddr_printch('5');
 
-        pm_log = false;
-
         if(rkpm_chk_jdg_ctrbits(RKPM_CTRBITS_SOC_DLPMD))
         {   
             if(cpu_suspend(0,rk_lpmode_enter)==0)
@@ -480,8 +485,6 @@ static int rkpm_enter(suspend_state_t state)
             wfi();
         }
 
-        pm_log = true;
-
         rkpm_ddr_printch('5');
 
         RKPM_BITCTR_DDR_FUN(GPIOS,re_gpios);
@@ -501,30 +504,23 @@ static int rkpm_enter(suspend_state_t state)
         local_fiq_enable();
         rkpm_ddr_printch('1');
         
-
-
         RKPM_BITCTR_DDR_FUN(PWR_DMNS,re_pwr_dmns);
 
         rkpm_ddr_printch('0');
-
-
-        pm_log = false;
-
-        printk(KERN_CONT "\n");
-
         rkpm_ddr_printch('\n');
-
-        RKPM_DDR_FUN(finish);
         
+        RKPM_DDR_FUN(finish);           
         return 0;
 }
 
+#if 0
 static int rkpm_enter_tst(void)
 {
 
        return rkpm_enter(0);
 
 }
+#endif
 
 static int rkpm_suspend_prepare(void)
 {