]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00181068: MX6 Source IPU_HSP and AXI clocks from 540M PFD.
authorRanjani Vaidyanathan <ra5478@freescale.com>
Thu, 26 Apr 2012 22:53:14 +0000 (17:53 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:34 +0000 (08:34 +0200)
IPU_HSP clocks should NOT be sourced from MMDC clock since the
MMDC clock can be scaled.
Move the IPU_HSP clock to be sourced from PLL3_PFD_540M instead.
Also don't source AXI_CLK from periph_clk as this domain is
scaled between 528MHz, 400MHz and 24MHz. Move AXI_CLK
clock to be sourced from PLL3_PFD_540M too.

When the system needs to enter low power mode, AXI_CLK is switched
from PLL3_PFD_540M to periph_clk. And then switched back
when low power mode is exited.

The code will print a warning message if PLL3_PFD_540M is
relocked to a different frequency when IPU_HSP or axi_clk is
sourced from it.

Currently remove the support for 400Mhz DDR working point for
MX6Q since we can get IPU underruns during the DDR frequency
transitions.

The DDR freq change code needs to ensure that all bus clocks
donot exceed max frequency during the frequency transition.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
arch/arm/mach-mx6/bus_freq.c
arch/arm/mach-mx6/clock.c
arch/arm/mach-mx6/cpu.c
arch/arm/mach-mx6/mx6_ddr_freq.S
arch/arm/mach-mx6/mx6_mmdc.c

index b721bc0479f006f873953a91eabfba79966ab1fe..ca5154af473b10657508c2181b5cfdf9aa3c1ee1 100644 (file)
 #define LPAPM_CLK      24000000
 #define DDR_MED_CLK    400000000
 #define DDR3_NORMAL_CLK        528000000
+#define AXI_CLK_RATE           270000000
+#define GPC_PGC_GPU_PGCR_OFFSET                0x260
+#define GPC_CNTR_OFFSET                                0x0
+
+
 
 DEFINE_SPINLOCK(ddr_freq_lock);
 
@@ -74,9 +79,10 @@ unsigned int ddr_normal_rate;
 int low_freq_bus_used(void);
 void set_ddr_freq(int ddr_freq);
 
+extern int init_mmdc_settings(void);
 extern struct cpu_op *(*get_cpu_op)(int *op);
 extern int update_ddr_freq(int ddr_rate);
-
+extern void __iomem *gpc_base;
 
 struct mutex bus_freq_mutex;
 
@@ -86,6 +92,9 @@ struct timeval end_time;
 static int cpu_op_nr;
 static struct cpu_op *cpu_op_tbl;
 static struct clk *pll2_400;
+static struct clk *axi_clk;
+static struct clk *periph_clk;
+static struct clk *pll3_540;
 static struct clk *cpu_clk;
 static unsigned int org_ldo;
 static struct clk *pll3;
@@ -117,6 +126,11 @@ static void reduce_bus_freq_handler(struct work_struct *work)
                return;
        }
 
+       /* Set the axi_clk to be sourced from the periph_clk.
+         * So that its frequency can be lowered down to 50MHz
+         * or 24MHz as the case may be. */
+       clk_set_parent(axi_clk, periph_clk);
+
        clk_enable(pll3);
 
        if (lp_audio_freq) {
@@ -141,13 +155,23 @@ static void reduce_bus_freq_handler(struct work_struct *work)
 
        if (cpu_is_mx6q()) {
                /* Power gate the PU LDO. */
+               /* Power gate the PU domain first. */
+               /* enable power down request */
+               reg = __raw_readl(gpc_base + GPC_PGC_GPU_PGCR_OFFSET);
+               __raw_writel(reg | 0x1, gpc_base + GPC_PGC_GPU_PGCR_OFFSET);
+               /* power down request */
+               reg = __raw_readl(gpc_base + GPC_CNTR_OFFSET);
+               __raw_writel(reg | 0x1, gpc_base + GPC_CNTR_OFFSET);
+               /* Wait for power down to complete. */
+               while (__raw_readl(gpc_base + GPC_CNTR_OFFSET) & 0x1)
+                       ;
+
                org_ldo = reg = __raw_readl(ANADIG_REG_CORE);
                reg &= ~(ANADIG_REG_TARGET_MASK << ANADIG_REG1_PU_TARGET_OFFSET);
                __raw_writel(reg, ANADIG_REG_CORE);
        }
        clk_disable(pll3);
        mutex_unlock(&bus_freq_mutex);
-
 }
 
 /* Set the DDR, AHB to 24MHz.
@@ -174,6 +198,8 @@ int set_low_bus_freq(void)
  */
 int set_high_bus_freq(int high_bus_freq)
 {
+       unsigned long reg;
+
        if (busfreq_suspended)
                return 0;
 
@@ -196,10 +222,31 @@ int set_high_bus_freq(int high_bus_freq)
        }
        clk_enable(pll3);
 
+       if (clk_get_parent(axi_clk) != pll3_540) {
+               /* We need to set axi_clk to be sourced from PLL3_540MHz. */
+               /* Ensure the divider is set to divide by 2 before changing the
+                 * parent. */
+               if (low_bus_freq_mode)
+                       clk_set_rate(axi_clk, clk_get_rate(axi_clk) / 2);
+               clk_set_parent(axi_clk, pll3_540);
+               clk_set_rate(axi_clk, AXI_CLK_RATE);
+       }
+
        /* Enable the PU LDO */
-       if (cpu_is_mx6q() && low_bus_freq_mode)
+       if (cpu_is_mx6q() && low_bus_freq_mode) {
                __raw_writel(org_ldo, ANADIG_REG_CORE);
 
+               /* enable power up request */
+               reg = __raw_readl(gpc_base + GPC_PGC_GPU_PGCR_OFFSET);
+               __raw_writel(reg | 0x1, gpc_base + GPC_PGC_GPU_PGCR_OFFSET);
+               /* power up request */
+               reg = __raw_readl(gpc_base + GPC_CNTR_OFFSET);
+               __raw_writel(reg | 0x2, gpc_base + GPC_CNTR_OFFSET);
+               /* Wait for the power up bit to clear */
+               while (__raw_readl(gpc_base + GPC_CNTR_OFFSET) & 0x2)
+                       ;
+       }
+
        if (high_bus_freq) {
                update_ddr_freq(ddr_normal_rate);
                if (med_bus_freq_mode)
@@ -308,7 +355,7 @@ static int __devinit busfreq_probe(struct platform_device *pdev)
 
        pll2_400 = clk_get(NULL, "pll2_pfd_400M");
        if (IS_ERR(pll2_400)) {
-               printk(KERN_DEBUG "%s: failed to get axi_clk\n",
+               printk(KERN_DEBUG "%s: failed to get pll2_pfd_400M\n",
                       __func__);
                return PTR_ERR(pll2_400);
        }
@@ -321,6 +368,32 @@ static int __devinit busfreq_probe(struct platform_device *pdev)
        }
 
        pll3 = clk_get(NULL, "pll3_main_clk");
+       if (IS_ERR(pll3)) {
+               printk(KERN_DEBUG "%s: failed to get pll3\n",
+                      __func__);
+               return PTR_ERR(cpu_clk);
+       }
+
+       axi_clk = clk_get(NULL, "axi_clk");
+       if (IS_ERR(axi_clk)) {
+               printk(KERN_DEBUG "%s: failed to get axi_clk\n",
+                      __func__);
+               return PTR_ERR(axi_clk);
+       }
+
+       periph_clk = clk_get(NULL, "periph_clk");
+       if (IS_ERR(periph_clk)) {
+               printk(KERN_DEBUG "%s: failed to get periph_clk\n",
+                      __func__);
+               return PTR_ERR(periph_clk);
+       }
+
+       pll3_540 = clk_get(NULL, "pll3_pfd_540M");
+       if (IS_ERR(pll3_540)) {
+               printk(KERN_DEBUG "%s: failed to get periph_clk\n",
+                      __func__);
+               return PTR_ERR(pll3_540);
+       }
 
        err = sysfs_create_file(&busfreq_dev->kobj, &dev_attr_enable.attr);
        if (err) {
@@ -350,6 +423,8 @@ static int __devinit busfreq_probe(struct platform_device *pdev)
 
        mutex_init(&bus_freq_mutex);
 
+       init_mmdc_settings();
+
        return 0;
 }
 
index 33f75c0965abe8e5aa355f045641f4e27cc38881..d49b12527e1c0474243be2829157146248df7604 100644 (file)
@@ -50,6 +50,9 @@ extern int lp_med_freq;
 extern int lp_audio_freq;
 
 void __iomem *apll_base;
+static struct clk ipu1_clk;
+static struct clk ipu2_clk;
+static struct clk axi_clk;
 static struct clk pll1_sys_main_clk;
 static struct clk pll2_528_bus_main_clk;
 static struct clk pll2_pfd_400M;
@@ -780,6 +783,17 @@ static struct clk pll3_pfd_720M = {
        .round_rate = pfd_round_rate,
 };
 
+static int pfd_540M_set_rate(struct clk *clk,  unsigned long rate)
+{
+       if ((clk_get_parent(&ipu1_clk) == clk) ||
+               (clk_get_parent(&ipu2_clk) == clk) ||
+               (clk_get_parent(&axi_clk) == clk))
+               WARN(1, "CHANGING rate of 540M PFD when IPU and \
+                                       AXI is sourced from it \n");
+
+       return pfd_set_rate(clk, rate);
+}
+
 static struct clk pll3_pfd_540M = {
        __INIT_CLK_DEBUG(pll3_pfd_540M)
        .parent = &pll3_usb_otg_main_clk,
@@ -787,7 +801,7 @@ static struct clk pll3_pfd_540M = {
        .enable_shift = ANADIG_PFD1_FRAC_OFFSET,
        .enable = _clk_pfd_enable,
        .disable = _clk_pfd_disable,
-       .set_rate = pfd_set_rate,
+       .set_rate = pfd_540M_set_rate,
        .get_rate = pfd_get_rate,
        .round_rate = pfd_round_rate,
        .get_rate = pfd_get_rate,
@@ -2061,7 +2075,7 @@ static struct clk vpu_clk[] = {
        .set_rate = _clk_vpu_axi_set_rate,
        .get_rate = _clk_vpu_axi_get_rate,
        .secondary = &vpu_clk[1],
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
        },
        {
        .parent =  &mmdc_ch0_axi_clk[0],
@@ -2151,7 +2165,7 @@ static struct clk ipu1_clk = {
        .round_rate = _clk_ipu_round_rate,
        .set_rate = _clk_ipu1_set_rate,
        .get_rate = _clk_ipu1_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
 };
 
 static int _clk_ipu2_set_parent(struct clk *clk, struct clk *parent)
@@ -2212,7 +2226,7 @@ static struct clk ipu2_clk = {
        .round_rate = _clk_ipu_round_rate,
        .set_rate = _clk_ipu2_set_rate,
        .get_rate = _clk_ipu2_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
 };
 
 static struct clk usdhc_dep_clk = {
@@ -2785,7 +2799,7 @@ static struct clk ldb_di0_clk = {
        .set_rate = _clk_ldb_di0_set_rate,
        .round_rate = _clk_ldb_di_round_rate,
        .get_rate = _clk_ldb_di0_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
 };
 
 static unsigned long _clk_ldb_di1_get_rate(struct clk *clk)
@@ -2856,7 +2870,7 @@ static struct clk ldb_di1_clk = {
        .set_rate = _clk_ldb_di1_set_rate,
        .round_rate = _clk_ldb_di_round_rate,
        .get_rate = _clk_ldb_di1_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
 };
 
 
@@ -3049,7 +3063,7 @@ static struct clk ipu1_di_clk[] = {
        .set_rate = _clk_ipu1_di0_set_rate,
        .round_rate = _clk_ipu_di_round_rate,
        .get_rate = _clk_ipu1_di0_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
        },
        {
         __INIT_CLK_DEBUG(ipu1_di_clk_1)
@@ -3063,7 +3077,7 @@ static struct clk ipu1_di_clk[] = {
        .set_rate = _clk_ipu1_di1_set_rate,
        .round_rate = _clk_ipu_di_round_rate,
        .get_rate = _clk_ipu1_di1_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
        },
 };
 
@@ -3226,7 +3240,7 @@ static struct clk ipu2_di_clk[] = {
        .set_rate = _clk_ipu2_di0_set_rate,
        .round_rate = _clk_ipu_di_round_rate,
        .get_rate = _clk_ipu2_di0_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
        },
        {
         __INIT_CLK_DEBUG(ipu2_di_clk_1)
@@ -3240,7 +3254,7 @@ static struct clk ipu2_di_clk[] = {
        .set_rate = _clk_ipu2_di1_set_rate,
        .round_rate = _clk_ipu_di_round_rate,
        .get_rate = _clk_ipu2_di1_get_rate,
-       .flags = AHB_MED_SET_POINT | CPU_FREQ_TRIG_UPDATE,
+       .flags = AHB_HIGH_SET_POINT | CPU_FREQ_TRIG_UPDATE,
        },
 };
 
@@ -5238,12 +5252,23 @@ int __init mx6_clocks_init(unsigned long ckil, unsigned long osc,
                /* on mx6dl gpu2d_axi_clk source from mmdc0 directly */
                clk_set_parent(&gpu2d_axi_clk, &mmdc_ch0_axi_clk[0]);
 
-               /* set axi_clk parent to pll3_pfd_540M */
-               clk_set_parent(&axi_clk, &pll3_pfd_540M);
+               /* pxp & epdc */
+               clk_set_parent(&ipu2_clk, &pll2_pfd_400M);
+               clk_set_rate(&ipu2_clk, 200000000);
+       } else if (cpu_is_mx6q())
+               /* Donot source IPU from MMDC clock, as it can be scaled. */
+               clk_set_parent(&ipu2_clk, &pll3_pfd_540M);
+
+       /* Donot source IPU from MMDC clock, as it can be scaled. */
+       clk_set_parent(&ipu1_clk, &pll3_pfd_540M);
+
+       /* set axi_clk parent to pll3_pfd_540M, don't source from
+         * periph_clk as it can be scaled.
+         */
+       clk_set_parent(&axi_clk, &pll3_pfd_540M);
+       /* Need to keep PLL3_PFD_540M enabled until AXI is sourced from it. */
+       clk_enable(&axi_clk);
 
-               /* on mx6dl, max ipu clock is 274M */
-               clk_set_parent(&ipu1_clk, &pll3_pfd_540M);
-       }
        if (cpu_is_mx6q())
                clk_set_parent(&gpu2d_core_clk[0], &pll3_usb_otg_main_clk);
 
index 581a2acbbf33414290b10ff88c7e4016f64af7c8..06353676fee3c8e55b62c734214278c596be9228 100644 (file)
@@ -36,7 +36,6 @@ extern unsigned int num_cpu_idle_lock;
 void *mx6_wait_in_iram_base;
 void (*mx6_wait_in_iram)(void);
 extern void mx6_wait(void);
-extern int init_mmdc_settings(void);
 
 struct cpu_op *(*get_cpu_op)(int *op);
 bool enable_wait_mode;
@@ -140,7 +139,6 @@ static int __init post_cpu_init(void)
 
        num_cpu_idle_lock = 0x0;
 
-       init_mmdc_settings();
        return 0;
 }
 postcore_initcall(post_cpu_init);
index 85af2a402e684e26894a9fd4996a7ea5789d6745..80600dd0163b7795efe1af15bb7e3fad4b7d07bd 100644 (file)
@@ -27,7 +27,7 @@
        ldr     r0, [r6, #0x14]
        and     r0, r0, #0x2000000
        cmp     r0, #0x2000000
-       beq         switch_pre_periph_clk_528
+       beq         set_ahb_podf_before_switch
 
        /* Step 1: Change periph_clk to be sourced from pll3_clk. */
        /* Ensure PLL3 is the source and set the divider to 1. */
        bic     r0, r0, #0x38000000
        str     r0, [r6, #0x14]
 
+       /* Set the AHB dividers before the switch. */
+       /* Don't change AXI clock divider. */
+       /* Set the MMDC_DIV=1, AHB_DIV=4 (need to maintain GPT divider). */
+       ldr     r0, [r6, #0x14]
+       ldr     r2, =0x381D00
+       bic     r0, r0, r2
+       orr     r0, r0, #0xD00
+       str     r0, [r6, #0x14]
+
+wait_div_update528:
+       ldr     r0, [r6, #0x48]
+       cmp     r0, #0
+       bne     wait_div_update528
+
        /* Now switch periph_clk to pll3_main_clk. */
        ldr     r0, [r6, #0x14]
        orr     r0, r0, #0x2000000
@@ -49,25 +63,33 @@ periph_clk_switch3:
        cmp    r0, #0
        bne     periph_clk_switch3
 
-switch_pre_periph_clk_528:
-
-       /* Now switch pre_periph_clk to PLL2_528MHz. */
-       ldr     r0, [r6, #0x18]
-       bic     r0, r0, #0xC0000
-       str     r0, [r6, #0x18]
+       b       switch_pre_periph_clk_528
 
-       /* Set the MMDC_DIV=1, AXI_DIV = 2, AHB_DIV=4 (need to maintain GPT divider). */
+set_ahb_podf_before_switch:
+       /* Set the AHB dividers before the switch. */
+       /* Especially if the AHB is at 24MHz, divider
+         * would be at divide by 1 and clock
+         * would be too fast when switching to PLL3.
+         */
+       /* Don't change AXI clock divider. */
+       /* Set the MMDC_DIV=1, AHB_DIV=4 (need to maintain GPT divider). */
        ldr     r0, [r6, #0x14]
-       ldr     r2, =0x3F1D00
+       ldr     r2, =0x381D00
        bic     r0, r0, r2
-       orr     r0, r0, #0x10000
        orr     r0, r0, #0xD00
        str     r0, [r6, #0x14]
 
-wait_div_update1:
+wait_div_update528_1:
        ldr     r0, [r6, #0x48]
        cmp     r0, #0
-       bne     wait_div_update1
+       bne     wait_div_update528_1
+
+switch_pre_periph_clk_528:
+
+       /* Now switch pre_periph_clk to PLL2_528MHz. */
+       ldr     r0, [r6, #0x18]
+       bic     r0, r0, #0xC0000
+       str     r0, [r6, #0x18]
 
        /* Now switch periph_clk back. */
        ldr     r0, [r6, #0x14]
@@ -82,18 +104,17 @@ periph_clk_switch4:
        /* Change the GPT divider so that its at 6MHz. */
        ldr     r0, [r6, #0x1C]
        bic     r0, r0, #0x3F
-       orr     r0, r0, #0xB
+       orr     r0, r0, #0xA
        str     r0, [r6, #0x1C]
-
        .endm
 
        .macro   switch_to_400MHz
 
        /* check if periph_clk_sel is already set */
-       ldr     r0, [r6, #0x14]
-       and     r0, r0, #0x2000000
-       cmp      r0, #0x2000000
-       beq      switch_pre_periph_clk_400
+       ldr         r0, [r6, #0x14]
+       and       r0, r0, #0x2000000
+       cmp      r0, #0x2000000
+       beq          set_ahb_podf_before_switch1
 
        /* Step 1: Change periph_clk to be sourced from pll3_clk. */
        /* Ensure PLL3 is the source and set the divider to 1. */
@@ -115,26 +136,34 @@ periph_clk_switch5:
        cmp    r0, #0
        bne     periph_clk_switch5
 
-switch_pre_periph_clk_400:
+       b       switch_pre_periph_clk_400
 
-    /* Now switch pre_periph_clk to PFD_400MHz. */
-       ldr     r0, [r6, #0x18]
-       bic     r0, r0, #0xC0000
-       orr     r0, r0, #0x40000
-       str     r0, [r6, #0x18]
-
-       /* Set the MMDC_DIV=1, AXI_DIV = 2, AHB_DIV=3 (need to maintain GPT divider). */
+set_ahb_podf_before_switch1:
+       /* Set the AHB dividers before the switch. */
+       /* Especially if the AHB is at 24MHz, divider
+         * would be at divide by 1 and clock
+         * would be too fast when switching to PLL3.
+         */
+       /* Don't change AXI clock divider. */
+       /* Set the MMDC_DIV=1, AHB_DIV=4 (need to maintain GPT divider). */
        ldr     r0, [r6, #0x14]
-       ldr     r2, =0x3F1D00
+       ldr     r2, =0x381D00
        bic     r0, r0, r2
-       orr     r0, r0, #0x10000
-       orr     r0, r0, #0x900
+       orr     r0, r0, #0xD00
        str     r0, [r6, #0x14]
 
-wait_div_update400:
+wait_div_update400_1:
        ldr     r0, [r6, #0x48]
        cmp     r0, #0
-       bne     wait_div_update400
+       bne     wait_div_update400_1
+
+switch_pre_periph_clk_400:
+
+       /* Now switch pre_periph_clk to PFD_400MHz. */
+       ldr     r0, [r6, #0x18]
+       bic     r0, r0, #0xC0000
+       orr     r0, r0, #0x40000
+       str     r0, [r6, #0x18]
 
        /* Now switch periph_clk back. */
        ldr     r0, [r6, #0x14]
@@ -146,10 +175,24 @@ periph_clk_switch6:
        cmp    r0, #0
        bne     periph_clk_switch6
 
+       /* Change AHB divider so that we are at 400/3=133MHz. */
+       /* Don't change AXI clock divider. */
+       /* Set the MMDC_DIV=1, AHB_DIV=3 (need to maintain GPT divider). */
+       ldr     r0, [r6, #0x14]
+       ldr     r2, =0x381D00
+       bic     r0, r0, r2
+       orr     r0, r0, #0x900
+       str     r0, [r6, #0x14]
+
+wait_div_update400_2:
+       ldr     r0, [r6, #0x48]
+       cmp     r0, #0
+       bne     wait_div_update400_2
+
        /* Change the GPT divider so that its at 6MHz. */
        ldr     r0, [r6, #0x1C]
        bic     r0, r0, #0x3F
-       orr     r0, r0, #0xB
+       orr     r0, r0, #0xA
        str     r0, [r6, #0x1C]
 
        .endm
@@ -614,7 +657,7 @@ switch_freq_528:
 
 continue_dll_on:
 
-       /* set step-by-step mode */
+       /* set SBS step-by-step mode */
        ldr     r0, [r5, #0x410]
        orr     r0, r0, #0x100
        str     r0, [r5, #0x410]
@@ -668,7 +711,6 @@ cont5:
        sub     r1, r1, #1
        cmp    r1, #0
        bgt     delay5
-
        /* Disable dqs pull down in the IOMUX. */
        /*
        setmem /32 0x020e05a8 = 0x00000030 // IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS0 - DSE=110
index 2498f01e088945e201eded0a8a00762bf0ea5898..c4f232f0e56d5f53107087bdc6f4e4d25d6c98c2 100644 (file)
@@ -227,7 +227,6 @@ int update_ddr_freq(int ddr_rate)
                        /* Set the interrupt to be pending in the GIC. */
                        reg = 1 << (irq_used[cpu] % 32);
                        writel_relaxed(reg, gic_dist_base + GIC_DIST_PENDING_SET + (irq_used[cpu] / 32) * 4);
-                       udelay(10);
                }
        }
        while (cpus_in_wfe != online_cpus)
@@ -343,6 +342,8 @@ int init_mmdc_settings(void)
        memcpy(ddr_freq_change_iram_base, mx6_ddr_freq_change, SZ_8K);
        mx6_change_ddr_freq = (void *)ddr_freq_change_iram_base;
 
+       curr_ddr_rate = ddr_normal_rate;
+
        for_each_online_cpu(cpu) {
                /* Set up a reserved interrupt to get all the active cores into a WFE state
                  * before changing the DDR frequency.