dsb();
#if defined (DDR_CHANGE_FREQ_IN_LCDC_VSYNC)
+ n = ddr_freq_t.screen_ft_us;
+ n = ddr_freq_t.t0;
+ dsb();
+
if(ddr_freq_t.screen_ft_us > 0)
{
ddr_freq_t.t1 = cpu_clock(0);
- ddr_freq_t.t2 = (u32)(ddr_freq_t.t1 - ddr_freq_t.t0)/1000;
+ ddr_freq_t.t2 = (u32)(ddr_freq_t.t1 - ddr_freq_t.t0); //ns
- if(ddr_freq_t.t2 > ddr_freq_t.screen_ft_us)
+ //if test_count exceed maximum test times,ddr_freq_t.screen_ft_us == 0xfefefefe by ddr_freq.c
+ if( (ddr_freq_t.t2 > ddr_freq_t.screen_ft_us*1000) && (ddr_freq_t.screen_ft_us != 0xfefefefe))
{
DDR_RESTORE_SP(save_sp);
local_fiq_enable();
uint32_t die=1;
uint32_t gsr,dqstr;
- ddr_print("version 1.00 201300806 \n");
+ ddr_print("version 1.00 201300810 \n");
mem_type = pPHY_Reg->DCR.b.DDRMD;
ddr_speed_bin = dram_speed_bin;
u32 timeout = MAX_TIMEOUT;
unsigned int cpu;
unsigned int this_cpu = smp_processor_id();
- int ret;
+ int ret = 0;
cpu_maps_update_begin();
ddr_freq_t.screen_ft_us = rk_fb_get_prmry_screen_ft();
test_count++;
- //dprintk(DEBUG_VERBOSE,"test_count=%d\n",test_count);
+ if(test_count > 10) //test 10 times
+ {
+ ddr_freq_t.screen_ft_us = 0xfefefefe;
+ dprintk(DEBUG_DDR,"%s:test_count exceed maximum!\n",__func__);
+ }
+ dprintk(DEBUG_VERBOSE,"%s:test_count=%d\n",__func__,test_count);
usleep_range(ddr_freq_t.screen_ft_us-test_count*1000,ddr_freq_t.screen_ft_us-test_count*1000);
flush_cache_all();
register_reboot_notifier(&ddrfreq_reboot_notifier);
- pr_info("verion 3.1 20130805 1\n");
+ pr_info("verion 3.1 20130810\n");
dprintk(DEBUG_DDR, "normal %luMHz video %luMHz video_low %luMHz dualview %luMHz idle %luMHz suspend %luMHz reboot %luMHz\n",
ddr.normal_rate / MHZ, ddr.video_rate / MHZ, ddr.video_low_rate / MHZ, ddr.dualview_rate / MHZ, ddr.idle_rate / MHZ, ddr.suspend_rate / MHZ, ddr.reboot_rate / MHZ);
bool rk_fb_poll_wait_frame_complete(void)
{
- uint32_t timeout = MAX_TIMEOUT;
+ uint32_t timeout = RK_LF_MAX_TIMEOUT;
if(rk_fb_poll_prmry_screen_vblank() == RK_LF_STATUS_NC)
return false;
#define RK_LF_STATUS_FC 0xef
#define RK_LF_STATUS_FR 0xee
#define RK_LF_STATUS_NC 0xfe
-#define MAX_TIMEOUT (1600000UL << 6) //>0.64s
+#define RK_LF_MAX_TIMEOUT (1600000UL << 6) //>0.64s
extern int rk_fb_poll_prmry_screen_vblank(void);