1c0718df4SPaul Walmsley /* 2c0718df4SPaul Walmsley * OMAP3 Voltage Controller (VC) data 3c0718df4SPaul Walmsley * 4c0718df4SPaul Walmsley * Copyright (C) 2007, 2010 Texas Instruments, Inc. 5c0718df4SPaul Walmsley * Rajendra Nayak <rnayak@ti.com> 6c0718df4SPaul Walmsley * Lesly A M <x0080970@ti.com> 7c0718df4SPaul Walmsley * Thara Gopinath <thara@ti.com> 8c0718df4SPaul Walmsley * 9c0718df4SPaul Walmsley * Copyright (C) 2008, 2011 Nokia Corporation 10c0718df4SPaul Walmsley * Kalle Jokiniemi 11c0718df4SPaul Walmsley * Paul Walmsley 12c0718df4SPaul Walmsley * 13c0718df4SPaul Walmsley * This program is free software; you can redistribute it and/or modify 14c0718df4SPaul Walmsley * it under the terms of the GNU General Public License version 2 as 15c0718df4SPaul Walmsley * published by the Free Software Foundation. 16c0718df4SPaul Walmsley */ 17c0718df4SPaul Walmsley #include <linux/io.h> 18c0718df4SPaul Walmsley #include <linux/err.h> 19c0718df4SPaul Walmsley #include <linux/init.h> 20c0718df4SPaul Walmsley 214e65331cSTony Lindgren #include "common.h" 22c0718df4SPaul Walmsley 23c0718df4SPaul Walmsley #include "prm-regbits-34xx.h" 24c0718df4SPaul Walmsley #include "voltage.h" 25c0718df4SPaul Walmsley 26c0718df4SPaul Walmsley #include "vc.h" 27c0718df4SPaul Walmsley 28c0718df4SPaul Walmsley /* 29c0718df4SPaul Walmsley * VC data common to 34xx/36xx chips 30c0718df4SPaul Walmsley * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. 31c0718df4SPaul Walmsley */ 32d84adcf4SKevin Hilman static struct omap_vc_common omap3_vc_common = { 33c0718df4SPaul Walmsley .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET, 34c0718df4SPaul Walmsley .data_shift = OMAP3430_DATA_SHIFT, 35c0718df4SPaul Walmsley .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT, 36c0718df4SPaul Walmsley .regaddr_shift = OMAP3430_REGADDR_SHIFT, 37c0718df4SPaul Walmsley .valid = OMAP3430_VALID_MASK, 38c0718df4SPaul Walmsley .cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT, 39c0718df4SPaul Walmsley .cmd_on_mask = OMAP3430_VC_CMD_ON_MASK, 40c0718df4SPaul Walmsley .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT, 41c0718df4SPaul Walmsley .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT, 42c0718df4SPaul Walmsley .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT, 43*102bcb6eSTony Lindgren .i2c_cfg_clear_mask = OMAP3430_SREN_MASK | OMAP3430_HSEN_MASK, 44f5395480SKevin Hilman .i2c_cfg_hsen_mask = OMAP3430_HSEN_MASK, 45f5395480SKevin Hilman .i2c_cfg_reg = OMAP3_PRM_VC_I2C_CFG_OFFSET, 46f5395480SKevin Hilman .i2c_mcode_mask = OMAP3430_MCODE_MASK, 47c0718df4SPaul Walmsley }; 48c0718df4SPaul Walmsley 49d84adcf4SKevin Hilman struct omap_vc_channel omap3_vc_mpu = { 50f9d29f16STero Kristo .flags = OMAP_VC_CHANNEL_DEFAULT, 51d84adcf4SKevin Hilman .common = &omap3_vc_common, 525876c940SKevin Hilman .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET, 535876c940SKevin Hilman .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET, 545876c940SKevin Hilman .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET, 555876c940SKevin Hilman .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET, 56c0718df4SPaul Walmsley .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET, 57c0718df4SPaul Walmsley .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK, 58c0718df4SPaul Walmsley .smps_volra_mask = OMAP3430_VOLRA0_MASK, 59e4e021c5SKevin Hilman .smps_cmdra_mask = OMAP3430_CMDRA0_MASK, 6024d3194aSKevin Hilman .cfg_channel_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT, 61c0718df4SPaul Walmsley }; 62c0718df4SPaul Walmsley 63d84adcf4SKevin Hilman struct omap_vc_channel omap3_vc_core = { 64d84adcf4SKevin Hilman .common = &omap3_vc_common, 655876c940SKevin Hilman .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET, 665876c940SKevin Hilman .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET, 675876c940SKevin Hilman .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET, 685876c940SKevin Hilman .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET, 69c0718df4SPaul Walmsley .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET, 70c0718df4SPaul Walmsley .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK, 71c0718df4SPaul Walmsley .smps_volra_mask = OMAP3430_VOLRA1_MASK, 72e4e021c5SKevin Hilman .smps_cmdra_mask = OMAP3430_CMDRA1_MASK, 7324d3194aSKevin Hilman .cfg_channel_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT, 74c0718df4SPaul Walmsley }; 758b5d8c0dSTero Kristo 768b5d8c0dSTero Kristo /* 778b5d8c0dSTero Kristo * Voltage levels for different operating modes: on, sleep, retention and off 788b5d8c0dSTero Kristo */ 798b5d8c0dSTero Kristo #define OMAP3_ON_VOLTAGE_UV 1200000 808b5d8c0dSTero Kristo #define OMAP3_ONLP_VOLTAGE_UV 1000000 818b5d8c0dSTero Kristo #define OMAP3_RET_VOLTAGE_UV 975000 828b5d8c0dSTero Kristo #define OMAP3_OFF_VOLTAGE_UV 600000 838b5d8c0dSTero Kristo 848b5d8c0dSTero Kristo struct omap_vc_param omap3_mpu_vc_data = { 858b5d8c0dSTero Kristo .on = OMAP3_ON_VOLTAGE_UV, 868b5d8c0dSTero Kristo .onlp = OMAP3_ONLP_VOLTAGE_UV, 878b5d8c0dSTero Kristo .ret = OMAP3_RET_VOLTAGE_UV, 888b5d8c0dSTero Kristo .off = OMAP3_OFF_VOLTAGE_UV, 898b5d8c0dSTero Kristo }; 908b5d8c0dSTero Kristo 918b5d8c0dSTero Kristo struct omap_vc_param omap3_core_vc_data = { 928b5d8c0dSTero Kristo .on = OMAP3_ON_VOLTAGE_UV, 938b5d8c0dSTero Kristo .onlp = OMAP3_ONLP_VOLTAGE_UV, 948b5d8c0dSTero Kristo .ret = OMAP3_RET_VOLTAGE_UV, 958b5d8c0dSTero Kristo .off = OMAP3_OFF_VOLTAGE_UV, 968b5d8c0dSTero Kristo }; 97