MT6572平台ddr1如何做降频处理
时间:10-02
整理:3721RD
点击:
MT6572平台ddr1如何做降频处理,把频率从200Mhz降到166Mhz或者133Mhz
int mtk_pll_init_emi(unsigned int freq)
{
kal_uint32 reg_val = 0;
switch (freq)
{
case 200:
/* rg_emi2x_gfmux_sel = 0xA: main pll/4 */
reg_val = DRV_Reg32(CLK_SEL_0) & ~BITMASK(4:1);
reg_val |= BITS(4:1, 0xA);
DRV_WriteReg32(CLK_SEL_0, reg_val);
break;
case 266:
/* rg_emi2x_gfmux_sel = 0x9: main pll/3 */
reg_val = DRV_Reg32(CLK_SEL_0) & ~BITMASK(4:1);
reg_val |= BITS(4:1, 0x9);
DRV_WriteReg32(CLK_SEL_0, reg_val);
break;
case 333:
/* adjust main pll frequency for EMI @ 667Mhz */
// POSdiv: 1, VCO: 1326.0, PLL: 1326.0
reg_val = 0x800CC000; // | ((DRV_Reg32(MAINPLL_CON0) & 1) << 31);
DRV_WriteReg32(MAINPLL_CON1, reg_val);
//5. Wait 100us for ARMPLL, MAINPLL and UNIVPLL settle
/* wait for 1ms */
GPT_busy_wait_us(1000);
reg_val = DRV_Reg32(CLK_SEL_0) & ~(BITMASK(4:1) | BITMASK(7:5));
/* rg_emi2x_gfmux_sel = 0xC: main pll/2 */
reg_val |= BITS(4:1, 0xC);
/* rg_axibus_gfmux_sel = 0x2: main pll/10 */
reg_val |= BITS(7:5, 0x2);
DRV_WriteReg32(CLK_SEL_0, reg_val);
break;
default:
return -1;
}
return 0;
}
int mtk_pll_init_emi(unsigned int freq)
{
kal_uint32 reg_val = 0;
switch (freq)
{
case 200:
/* rg_emi2x_gfmux_sel = 0xA: main pll/4 */
reg_val = DRV_Reg32(CLK_SEL_0) & ~BITMASK(4:1);
reg_val |= BITS(4:1, 0xA);
DRV_WriteReg32(CLK_SEL_0, reg_val);
break;
case 266:
/* rg_emi2x_gfmux_sel = 0x9: main pll/3 */
reg_val = DRV_Reg32(CLK_SEL_0) & ~BITMASK(4:1);
reg_val |= BITS(4:1, 0x9);
DRV_WriteReg32(CLK_SEL_0, reg_val);
break;
case 333:
/* adjust main pll frequency for EMI @ 667Mhz */
// POSdiv: 1, VCO: 1326.0, PLL: 1326.0
reg_val = 0x800CC000; // | ((DRV_Reg32(MAINPLL_CON0) & 1) << 31);
DRV_WriteReg32(MAINPLL_CON1, reg_val);
//5. Wait 100us for ARMPLL, MAINPLL and UNIVPLL settle
/* wait for 1ms */
GPT_busy_wait_us(1000);
reg_val = DRV_Reg32(CLK_SEL_0) & ~(BITMASK(4:1) | BITMASK(7:5));
/* rg_emi2x_gfmux_sel = 0xC: main pll/2 */
reg_val |= BITS(4:1, 0xC);
/* rg_axibus_gfmux_sel = 0x2: main pll/10 */
reg_val |= BITS(7:5, 0x2);
DRV_WriteReg32(CLK_SEL_0, reg_val);
break;
default:
return -1;
}
return 0;
}
更改pll.h em.c
我降过DDR2的不知跟你的是否一样,你只需要看你的时序表相应的频率有没有对应的值就可以了,然后在custom_memorydevice.h配成对应的
ddr2 具体是如何做的,能否明示?
只需更换带有你所需的flash 时序就可以了呀
开机随意性的死在开机LOGO,在系统里面也出现死机(但是出现概率低)想降低DDR3频率,和8127降主频试试?使用MTK默认的LOGO也是一样会随机性的死在开机LOGO。
更改pll.h em.c