ddr_rk32.c: addition fix system reboot stop at DDR_DEBUG information
authorhcy <hcy@rock-chips.com>
Fri, 6 Jun 2014 07:42:34 +0000 (15:42 +0800)
committerhcy <hcy@rock-chips.com>
Fri, 6 Jun 2014 07:42:34 +0000 (15:42 +0800)
arch/arm/mach-rockchip/ddr_rk32.c

index 516baa66befd942c1706079baef51688057a4a3a..461037a32772b94c10340ea6c3446e5083bc4bc5 100755 (executable)
@@ -3633,6 +3633,11 @@ void PIE_FUNC(ddr_change_freq_sram)(void *arg)
 }
 EXPORT_PIE_SYMBOL(FUNC(ddr_change_freq_sram));
 
+typedef struct freq_tag{
+    uint32_t nMHz;
+    struct ddr_freq_t *p_ddr_freq_t;
+}freq_t;
+
 static int dclk_div;
 static noinline uint32 ddr_change_freq_sram(void *arg)
 {
@@ -3645,8 +3650,9 @@ static noinline uint32 ddr_change_freq_sram(void *arg)
     volatile unsigned int * temp=(volatile unsigned int *)SRAM_CODE_OFFSET;
     uint32 i;
     uint32 gpllvaluel;
-    uint32 nMHz=*(uint32 *)arg;
-    struct ddr_freq_t *p_ddr_freq_t=(struct ddr_freq_t *)((uint32)arg + 4);
+    freq_t *p_freq_t=(freq_t *)arg;    
+    uint32 nMHz=p_freq_t->nMHz;
+    struct ddr_freq_t *p_ddr_freq_t=p_freq_t->p_ddr_freq_t;
 
 
 #if defined(CONFIG_ARCH_RK3066B)
@@ -3966,10 +3972,7 @@ static void ddr_adjust_config(void)
 
 static int __ddr_change_freq(uint32_t nMHz, struct ddr_freq_t ddr_freq_t)
 {
-    struct {
-        uint32_t nMHz;
-        struct ddr_freq_t *p_ddr_freq_t;
-    }freq;
+    freq_t freq;
     int ret = 0;
 
     freq.nMHz = nMHz;