{
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);
{
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 ;
}
}
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();
}
// 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)
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