]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00215668 [MX6]Only restore PU field value instead of whole reg value
authorAnson Huang <b20788@freescale.com>
Tue, 3 Jul 2012 20:09:37 +0000 (04:09 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:57 +0000 (08:34 +0200)
Only need to save and restore PU field register value instead of the
whole CORE REG value to avoid changing SOC and ARM voltage.

No need to increase BUS freq before CPU freq increase when system
is in audio bus mode.

Signed-off-by: Anson Huang <b20788@freescale.com>
arch/arm/mach-mx6/bus_freq.c
arch/arm/plat-mxc/cpufreq.c

index 6ebd76c1bd7dbd40f879cfedba99843a16dbaba4..cb4d6eaf880fdd457f37303032afe32df1258f8e 100644 (file)
@@ -203,7 +203,8 @@ static void reduce_bus_freq_handler(struct work_struct *work)
                __raw_writel(reg, gpc_base + 0x14);
 
                /* PU power gating. */
-               org_ldo = reg = __raw_readl(ANADIG_REG_CORE);
+               reg = __raw_readl(ANADIG_REG_CORE);
+               org_ldo = reg & (ANADIG_REG_TARGET_MASK << ANADIG_REG1_PU_TARGET_OFFSET);
                reg &= ~(ANADIG_REG_TARGET_MASK << ANADIG_REG1_PU_TARGET_OFFSET);
                __raw_writel(reg, ANADIG_REG_CORE);
 
@@ -212,6 +213,7 @@ static void reduce_bus_freq_handler(struct work_struct *work)
                reg |= 0x80000000;
                __raw_writel(reg, ANADIG_MISC1_REG);
        }
+
        mutex_unlock(&bus_freq_mutex);
 }
 
@@ -265,8 +267,9 @@ int set_high_bus_freq(int high_bus_freq)
 
        /* Enable the PU LDO */
        if (low_bus_freq_mode || audio_bus_freq_mode) {
-               /* Set the voltage of VDDSOC as in normal mode. */
-               __raw_writel(org_ldo, ANADIG_REG_CORE);
+               /* Set the voltage of VDDPU as in normal mode. */
+               __raw_writel(org_ldo | (__raw_readl(ANADIG_REG_CORE) &
+               (~(ANADIG_REG_TARGET_MASK << ANADIG_REG1_PU_TARGET_OFFSET))), ANADIG_REG_CORE);
 
                /* Need to wait for the regulator to come back up */
                /*
index 2627327378d1406ac73ef71a591792126b1b239a..b31970c667d2a2f1531a2d5fc5436dc5c543bdb0 100755 (executable)
@@ -56,7 +56,6 @@ extern struct regulator *cpu_regulator;
 extern int dvfs_core_is_active;
 extern struct cpu_op *(*get_cpu_op)(int *op);
 extern int low_bus_freq_mode;
-extern int audio_bus_freq_mode;
 extern int high_bus_freq_mode;
 extern int set_low_bus_freq(void);
 extern int set_high_bus_freq(int high_bus_speed);
@@ -86,7 +85,7 @@ int set_cpu_freq(int freq)
 #endif
        /*Set the voltage for the GP domain. */
        if (freq > org_cpu_rate) {
-               if (low_bus_freq_mode || audio_bus_freq_mode)
+               if (low_bus_freq_mode)
                        set_high_bus_freq(0);
                ret = regulator_set_voltage(cpu_regulator, gp_volt,
                                            gp_volt);