修改新版am335x支持1G主频的方法[来自A Xian调试记录]

记录群里网友 A Xian调试 am3354ZCZ100提升CPU主频到1G的问题


uboot设置电压...从1.26提升到 1.325

board.c
//if (!voltage_update(MPU, PMIC_OP_REG_SEL_1_2_6) &&
    if (!voltage_update(MPU, PMIC_OP_REG_SEL_1_3_2_5) &&
          !voltage_update(CORE, PMIC_OP_REG_SEL_1_1_3))
    {
        mpu_pll_config(MPUPLL_M_720);
        //mpu_pll_config(MPUPLL_M_600);
    }
我这个不考虑功耗..所以我对电压无所谓.
直接设置1g也是可以的.


linux-3.2.0-psp05.06.00.00\arch\arm\mach-omap2\opp3xxx_data.c


文件
修改omap3_opp_init函数 此函数加入
还是要做个补丁才好.


arch/arm/plat-omap/include/plat/cpu.h:441:#define AM335X_REV_ES2_1 (AM335X_CLASS | (0x2 << 8))
加入
这个是宏定义
*** ti-sdk-am335x-evm-05.06.00.00/board-support/linux-3.2.0-psp05.06.00.00/arch/arm/mach-omap2/id.c 2012-12-17 03:53:58.000000000 +0800
--- ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/arch/arm/mach-omap2/id.c 2013-06-26 05:37:58.000000000 +0800
***************
*** 415,425 ****
            cpu_rev = "1.0";
            break;
        case 1:
-       /* FALLTHROUGH */
-       default:
            omap_revision = AM335X_REV_ES2_0;
            cpu_rev = "2.0";
            break;
        }
        break;
    case 0xb8f2:
--- 415,429 ----
            cpu_rev = "1.0";
            break;
        case 1:
            omap_revision = AM335X_REV_ES2_0;
            cpu_rev = "2.0";
            break;
+       case 2:
+       /* FALLTHROUGH */
+       default:
+           omap_revision = AM335X_REV_ES2_1;
+           cpu_rev = "2.1";
+           break;
        }
        break;
    case 0xb8f2:
id.c




添加uboot命令

static int do_CPUFreq(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
    int cpufreq;
    if (argc < 2) {
        const struct cm_wkuppll *cmwkup = (struct cm_wkuppll *)CM_WKUP;
        cpufreq = readl(&cmwkup->clkseldpllmpu);
        cpufreq = (cpufreq >> 8) & 0x3FF;
        printf("Current CPU Freqency = %d MHz\n", cpufreq);
        return 0;
    }
    cpufreq = (int)simple_strtoul(argv[1], NULL, 10);
    printf("Modify CPU Freqency = %d MHz\n", cpufreq);
    if (1000 >= cpufreq && 200 <= cpufreq)
        mpu_pll_config(cpufreq);
    else
        return CMD_RET_USAGE;
    return 0;
}
U_BOOT_CMD(cpufreq, 2, 0, do_CPUFreq,
    "Modify the CPU frequency",
    " [cpu freq MHz]\n"
    "    cpu frequency = 200MHz ~ 1000MHz"
);


附件补丁下载

可参考 diff -u 比较新的BBB板子的代码,uboot和kernel部分

你可能感兴趣的:(am335x)