From dab791258cfcb001b01f96053d53faa1a5a52ced Mon Sep 17 00:00:00 2001 From: Quinn Jensen Date: Wed, 24 Oct 2007 21:27:00 -0600 Subject: Bugzilla 802 - Fix MX3 DVFS/DPTC table initialization Patch for Bugzilla 802 - Fix MX3 DVFS/DPTC table initialization on linux 2.6.22 kernel for MX3 platforms. dvfs_dptc_init_default() gives MX32 the wrong default tables. This patch corrects the logic for MX32, while maintaining proper support for MX31 TO2. A side effect of this patch is to fix another instance of the obscure "register swizzle" bug, wherein a general register gets corrupted and causes various kernel oops crashes. http://www.bitshrine.org/gpp/linux-2.6.22-mx-Bugzilla-802-Fix-MX3-DVFS-DPTC-table-initi.patch --- drivers/mxc/pm/dvfs_dptc.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/mxc/pm/dvfs_dptc.c b/drivers/mxc/pm/dvfs_dptc.c index 50b22c9defaf..1339de6af7cc 100644 --- a/drivers/mxc/pm/dvfs_dptc.c +++ b/drivers/mxc/pm/dvfs_dptc.c @@ -423,20 +423,14 @@ static int __init dvfs_dptc_init_default_table(void) } table_str = default_table_str; - if (cpu_is_mx31() || cpu_is_mx32()) { - if (cpu_is_mx31_rev(CHIP_REV_2_0) < 0) { - clk = clk_get(NULL, "ckih"); - if (clk_get_rate(clk) == 27000000) { - printk(KERN_INFO - "DVFS & DPTC: using 27MHz CKIH table\n"); -#ifdef CONFIG_ARCH_MX3 - table_str = default_table_str_27ckih; -#endif - } - } else { -#ifdef CONFIG_ARCH_MX3 - table_str = default_table_str_rev2; -#endif + if (cpu_is_mx31_rev(CHIP_REV_2_0) >= 1) { + table_str = default_table_str_rev2; + } else { + clk = clk_get(NULL, "ckih"); + if (clk_get_rate(clk) == 27000000) { + printk(KERN_INFO + "DVFS & DPTC: using 27MHz CKIH table\n"); + table_str = default_table_str_27ckih; } clk_put(clk); } -- cgit v1.2.3