/** * scale_vcore_omap4460() - Scale for OMAP4460 * @rev: OMAP chip revision * * PMIC assumed to be used is TWL6030 + TPS62361 */ static void scale_vcore_omap4460(unsigned int rev) { u32 volt; /* vdd_core - TWL6030 VCORE 1 - OPP100 - 1.127V */ omap_vc_bypass_send_value(TWL6030_SRI2C_SLAVE_ADDR, TWL6030_SRI2C_REG_ADDR_VCORE1, 0x22); /* WKUP clocks */ set_modify(CM_WKUP_GPIO1_CLKCTRL, 0x00000000, 0x1); check_loop(BIT17|BIT16, 0, CM_WKUP_GPIO1_CLKCTRL); /* vdd_mpu - TPS62361 - OPP100 - 1.210V (roundup from 1.2V) */ volt = 1210; volt -= TPS62361_BASE_VOLT_MV; volt /= 10; do_scale_tps62361(TPS62361_REG_ADDR_SET1, volt); /* vdd_iva - TWL6030 VCORE 2 - OPP50 - 0.950V */ omap_vc_bypass_send_value(TWL6030_SRI2C_SLAVE_ADDR, TWL6030_SRI2C_REG_ADDR_VCORE2, 0x14); }
/* * Setup the voltages for vdd_mpu, vdd_core, and vdd_iva * We set the maximum voltages allowed here because Smart-Reflex is not * enabled in bootloader. Voltage initialization in the kernel will set * these to the nominal values after enabling Smart-Reflex */ static void scale_vcores(void) { u32 volt, sys_clk_khz, cycles_hi, cycles_low, temp, omap4_rev; sys_clk_khz = get_sys_clk_freq() / 1000; /* * Setup the dedicated I2C controller for Voltage Control * I2C clk - high period 40% low period 60% */ cycles_hi = sys_clk_khz * 4 / PRM_VC_I2C_CHANNEL_FREQ_KHZ / 10; cycles_low = sys_clk_khz * 6 / PRM_VC_I2C_CHANNEL_FREQ_KHZ / 10; /* values to be set in register - less by 5 & 7 respectively */ cycles_hi -= 5; cycles_low -= 7; temp = (cycles_hi << PRM_VC_CFG_I2C_CLK_SCLH_SHIFT) | (cycles_low << PRM_VC_CFG_I2C_CLK_SCLL_SHIFT); writel(temp, &prcm->prm_vc_cfg_i2c_clk); /* Disable high speed mode and all advanced features */ writel(0x0, &prcm->prm_vc_cfg_i2c_mode); omap4_rev = omap_revision(); /* TPS - supplies vdd_mpu on 4460 */ if (omap4_rev >= OMAP4460_ES1_0) { volt = 1430; do_scale_tps62361(TPS62361_REG_ADDR_SET1, volt); } /* * VCORE 1 * * 4430 : supplies vdd_mpu * Setting a high voltage for Nitro mode as smart reflex is not enabled. * We use the maximum possible value in the AVS range because the next * higher voltage in the discrete range (code >= 0b111010) is way too * high * * 4460 : supplies vdd_core */ if (omap4_rev < OMAP4460_ES1_0) { volt = 1417; do_scale_vcore(SMPS_REG_ADDR_VCORE1, volt); } else { volt = 1200; do_scale_vcore(SMPS_REG_ADDR_VCORE1, volt); } /* VCORE 2 - supplies vdd_iva */ volt = 1200; do_scale_vcore(SMPS_REG_ADDR_VCORE2, volt); /* * VCORE 3 * 4430 : supplies vdd_core * 4460 : not connected */ if (omap4_rev < OMAP4460_ES1_0) { volt = 1200; do_scale_vcore(SMPS_REG_ADDR_VCORE3, volt); } }