2010-12-09 08:13:47 -07:00
|
|
|
/*
|
|
|
|
* OMAP4 OPP table definitions.
|
|
|
|
*
|
2012-09-25 10:33:50 -06:00
|
|
|
* Copyright (C) 2010-2012 Texas Instruments Incorporated - http://www.ti.com/
|
2010-12-09 08:13:47 -07:00
|
|
|
* Nishanth Menon
|
|
|
|
* Kevin Hilman
|
|
|
|
* Thara Gopinath
|
2011-03-10 22:17:45 -07:00
|
|
|
* Copyright (C) 2010-2011 Nokia Corporation.
|
2010-12-09 08:13:47 -07:00
|
|
|
* Eduardo Valentin
|
2011-03-10 22:17:45 -07:00
|
|
|
* Paul Walmsley
|
2010-12-09 08:13:47 -07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
|
|
|
|
* kind, whether express or implied; without even the implied warranty
|
|
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
|
|
|
2012-08-31 11:59:07 -06:00
|
|
|
#include "soc.h"
|
2011-03-10 22:17:45 -07:00
|
|
|
#include "control.h"
|
2010-12-09 08:13:47 -07:00
|
|
|
#include "omap_opp_data.h"
|
2011-01-05 13:49:35 -07:00
|
|
|
#include "pm.h"
|
2010-12-09 08:13:47 -07:00
|
|
|
|
2011-03-10 22:17:45 -07:00
|
|
|
/*
|
|
|
|
* Structures containing OMAP4430 voltage supported and various
|
|
|
|
* voltage dependent data for each VDD.
|
|
|
|
*/
|
|
|
|
|
2011-03-09 21:53:49 -07:00
|
|
|
#define OMAP4430_VDD_MPU_OPP50_UV 1025000
|
|
|
|
#define OMAP4430_VDD_MPU_OPP100_UV 1200000
|
|
|
|
#define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000
|
|
|
|
#define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000
|
2011-03-10 22:17:45 -07:00
|
|
|
|
2012-09-25 10:33:50 -06:00
|
|
|
struct omap_volt_data omap443x_vdd_mpu_volt_data[] = {
|
2011-03-10 22:17:45 -07:00
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
|
|
|
|
VOLT_DATA_DEFINE(0, 0, 0, 0),
|
|
|
|
};
|
|
|
|
|
2011-03-09 21:53:49 -07:00
|
|
|
#define OMAP4430_VDD_IVA_OPP50_UV 1013000
|
|
|
|
#define OMAP4430_VDD_IVA_OPP100_UV 1188000
|
|
|
|
#define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000
|
2011-03-10 22:17:45 -07:00
|
|
|
|
2012-09-25 10:33:50 -06:00
|
|
|
struct omap_volt_data omap443x_vdd_iva_volt_data[] = {
|
2011-03-10 22:17:45 -07:00
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
|
|
|
|
VOLT_DATA_DEFINE(0, 0, 0, 0),
|
|
|
|
};
|
|
|
|
|
2011-03-09 21:53:49 -07:00
|
|
|
#define OMAP4430_VDD_CORE_OPP50_UV 1025000
|
|
|
|
#define OMAP4430_VDD_CORE_OPP100_UV 1200000
|
2011-03-10 22:17:45 -07:00
|
|
|
|
2012-09-25 10:33:50 -06:00
|
|
|
struct omap_volt_data omap443x_vdd_core_volt_data[] = {
|
2011-03-10 22:17:45 -07:00
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(0, 0, 0, 0),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-09-25 10:33:50 -06:00
|
|
|
static struct omap_opp_def __initdata omap443x_opp_def_list[] = {
|
2010-12-09 08:13:47 -07:00
|
|
|
/* MPU OPP1 - OPP50 */
|
2011-03-05 03:27:22 -07:00
|
|
|
OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV),
|
2010-12-09 08:13:47 -07:00
|
|
|
/* MPU OPP2 - OPP100 */
|
2011-03-05 03:27:22 -07:00
|
|
|
OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV),
|
2010-12-09 08:13:47 -07:00
|
|
|
/* MPU OPP3 - OPP-Turbo */
|
2011-03-05 02:51:21 -07:00
|
|
|
OPP_INITIALIZER("mpu", true, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV),
|
2010-12-09 08:13:47 -07:00
|
|
|
/* MPU OPP4 - OPP-SB */
|
2011-03-05 02:51:21 -07:00
|
|
|
OPP_INITIALIZER("mpu", true, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV),
|
2010-12-09 08:13:47 -07:00
|
|
|
/* L3 OPP1 - OPP50 */
|
2011-03-05 03:27:22 -07:00
|
|
|
OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV),
|
2010-12-09 08:13:47 -07:00
|
|
|
/* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
|
2011-03-05 03:27:22 -07:00
|
|
|
OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV),
|
2011-03-05 02:52:26 -07:00
|
|
|
/* IVA OPP1 - OPP50 */
|
|
|
|
OPP_INITIALIZER("iva", true, 133000000, OMAP4430_VDD_IVA_OPP50_UV),
|
|
|
|
/* IVA OPP2 - OPP100 */
|
|
|
|
OPP_INITIALIZER("iva", true, 266100000, OMAP4430_VDD_IVA_OPP100_UV),
|
|
|
|
/* IVA OPP3 - OPP-Turbo */
|
|
|
|
OPP_INITIALIZER("iva", false, 332000000, OMAP4430_VDD_IVA_OPPTURBO_UV),
|
|
|
|
/* TODO: add DSP, aess, fdif, gpu */
|
2010-12-09 08:13:47 -07:00
|
|
|
};
|
|
|
|
|
2012-09-25 10:33:50 -06:00
|
|
|
#define OMAP4460_VDD_MPU_OPP50_UV 1025000
|
|
|
|
#define OMAP4460_VDD_MPU_OPP100_UV 1200000
|
|
|
|
#define OMAP4460_VDD_MPU_OPPTURBO_UV 1313000
|
|
|
|
#define OMAP4460_VDD_MPU_OPPNITRO_UV 1375000
|
|
|
|
|
|
|
|
struct omap_volt_data omap446x_vdd_mpu_volt_data[] = {
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
|
|
|
|
VOLT_DATA_DEFINE(0, 0, 0, 0),
|
|
|
|
};
|
|
|
|
|
|
|
|
#define OMAP4460_VDD_IVA_OPP50_UV 1025000
|
|
|
|
#define OMAP4460_VDD_IVA_OPP100_UV 1200000
|
|
|
|
#define OMAP4460_VDD_IVA_OPPTURBO_UV 1313000
|
|
|
|
#define OMAP4460_VDD_IVA_OPPNITRO_UV 1375000
|
|
|
|
|
|
|
|
struct omap_volt_data omap446x_vdd_iva_volt_data[] = {
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO, 0xfa, 0x23),
|
|
|
|
VOLT_DATA_DEFINE(0, 0, 0, 0),
|
|
|
|
};
|
|
|
|
|
|
|
|
#define OMAP4460_VDD_CORE_OPP50_UV 1025000
|
|
|
|
#define OMAP4460_VDD_CORE_OPP100_UV 1200000
|
|
|
|
#define OMAP4460_VDD_CORE_OPP100_OV_UV 1250000
|
|
|
|
|
|
|
|
struct omap_volt_data omap446x_vdd_core_volt_data[] = {
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(OMAP4460_VDD_CORE_OPP100_OV_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100OV, 0xf9, 0x16),
|
|
|
|
VOLT_DATA_DEFINE(0, 0, 0, 0),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct omap_opp_def __initdata omap446x_opp_def_list[] = {
|
|
|
|
/* MPU OPP1 - OPP50 */
|
|
|
|
OPP_INITIALIZER("mpu", true, 350000000, OMAP4460_VDD_MPU_OPP50_UV),
|
|
|
|
/* MPU OPP2 - OPP100 */
|
|
|
|
OPP_INITIALIZER("mpu", true, 700000000, OMAP4460_VDD_MPU_OPP100_UV),
|
|
|
|
/* MPU OPP3 - OPP-Turbo */
|
|
|
|
OPP_INITIALIZER("mpu", true, 920000000, OMAP4460_VDD_MPU_OPPTURBO_UV),
|
|
|
|
/*
|
|
|
|
* MPU OPP4 - OPP-Nitro + Disabled as the reference schematics
|
|
|
|
* recommends TPS623631 - confirm and enable the opp in board file
|
|
|
|
* XXX: May be we should enable these based on mpu capability and
|
|
|
|
* Exception board files disable it...
|
|
|
|
*/
|
|
|
|
OPP_INITIALIZER("mpu", false, 1200000000, OMAP4460_VDD_MPU_OPPNITRO_UV),
|
|
|
|
/* MPU OPP4 - OPP-Nitro SpeedBin */
|
|
|
|
OPP_INITIALIZER("mpu", false, 1500000000, OMAP4460_VDD_MPU_OPPNITRO_UV),
|
|
|
|
/* L3 OPP1 - OPP50 */
|
|
|
|
OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4460_VDD_CORE_OPP50_UV),
|
|
|
|
/* L3 OPP2 - OPP100 */
|
|
|
|
OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4460_VDD_CORE_OPP100_UV),
|
|
|
|
/* IVA OPP1 - OPP50 */
|
|
|
|
OPP_INITIALIZER("iva", true, 133000000, OMAP4460_VDD_IVA_OPP50_UV),
|
|
|
|
/* IVA OPP2 - OPP100 */
|
|
|
|
OPP_INITIALIZER("iva", true, 266100000, OMAP4460_VDD_IVA_OPP100_UV),
|
|
|
|
/*
|
|
|
|
* IVA OPP3 - OPP-Turbo + Disabled as the reference schematics
|
|
|
|
* recommends Phoenix VCORE2 which can supply only 600mA - so the ones
|
|
|
|
* above this OPP frequency, even though OMAP is capable, should be
|
|
|
|
* enabled by board file which is sure of the chip power capability
|
|
|
|
*/
|
|
|
|
OPP_INITIALIZER("iva", false, 332000000, OMAP4460_VDD_IVA_OPPTURBO_UV),
|
|
|
|
/* IVA OPP4 - OPP-Nitro */
|
|
|
|
OPP_INITIALIZER("iva", false, 430000000, OMAP4460_VDD_IVA_OPPNITRO_UV),
|
|
|
|
/* IVA OPP5 - OPP-Nitro SpeedBin*/
|
|
|
|
OPP_INITIALIZER("iva", false, 500000000, OMAP4460_VDD_IVA_OPPNITRO_UV),
|
|
|
|
|
|
|
|
/* TODO: add DSP, aess, fdif, gpu */
|
|
|
|
};
|
|
|
|
|
2010-12-09 08:13:47 -07:00
|
|
|
/**
|
|
|
|
* omap4_opp_init() - initialize omap4 opp table
|
|
|
|
*/
|
2011-01-05 13:49:35 -07:00
|
|
|
int __init omap4_opp_init(void)
|
2010-12-09 08:13:47 -07:00
|
|
|
{
|
|
|
|
int r = -ENODEV;
|
|
|
|
|
2012-09-25 10:33:50 -06:00
|
|
|
if (cpu_is_omap443x())
|
|
|
|
r = omap_init_opp_table(omap443x_opp_def_list,
|
|
|
|
ARRAY_SIZE(omap443x_opp_def_list));
|
|
|
|
else if (cpu_is_omap446x())
|
|
|
|
r = omap_init_opp_table(omap446x_opp_def_list,
|
|
|
|
ARRAY_SIZE(omap446x_opp_def_list));
|
2010-12-09 08:13:47 -07:00
|
|
|
return r;
|
|
|
|
}
|
2013-01-11 12:24:18 -07:00
|
|
|
omap_device_initcall(omap4_opp_init);
|