Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 1 | /* |
| 2 | * OMAP4 OPP table definitions. |
| 3 | * |
| 4 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ |
| 5 | * Nishanth Menon |
| 6 | * Kevin Hilman |
| 7 | * Thara Gopinath |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 8 | * Copyright (C) 2010-2011 Nokia Corporation. |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 9 | * Eduardo Valentin |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 10 | * Paul Walmsley |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License version 2 as |
| 14 | * published by the Free Software Foundation. |
| 15 | * |
| 16 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
| 17 | * kind, whether express or implied; without even the implied warranty |
| 18 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | */ |
| 21 | #include <linux/module.h> |
| 22 | |
| 23 | #include <plat/cpu.h> |
| 24 | |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 25 | #include "control.h" |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 26 | #include "omap_opp_data.h" |
Menon, Nishanth | eb05ead | 2011-01-05 20:49:35 +0000 | [diff] [blame] | 27 | #include "pm.h" |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 28 | |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 29 | /* |
| 30 | * Structures containing OMAP4430 voltage supported and various |
| 31 | * voltage dependent data for each VDD. |
| 32 | */ |
| 33 | |
Shweta Gulati | d9a2012 | 2011-03-10 10:23:49 +0530 | [diff] [blame] | 34 | #define OMAP4430_VDD_MPU_OPP50_UV 1025000 |
| 35 | #define OMAP4430_VDD_MPU_OPP100_UV 1200000 |
| 36 | #define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000 |
| 37 | #define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000 |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 38 | |
| 39 | struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = { |
| 40 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c), |
| 41 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16), |
| 42 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23), |
| 43 | VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27), |
| 44 | VOLT_DATA_DEFINE(0, 0, 0, 0), |
| 45 | }; |
| 46 | |
Shweta Gulati | d9a2012 | 2011-03-10 10:23:49 +0530 | [diff] [blame] | 47 | #define OMAP4430_VDD_IVA_OPP50_UV 1013000 |
| 48 | #define OMAP4430_VDD_IVA_OPP100_UV 1188000 |
| 49 | #define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000 |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 50 | |
| 51 | struct omap_volt_data omap44xx_vdd_iva_volt_data[] = { |
| 52 | VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c), |
| 53 | VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16), |
| 54 | VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23), |
| 55 | VOLT_DATA_DEFINE(0, 0, 0, 0), |
| 56 | }; |
| 57 | |
Shweta Gulati | d9a2012 | 2011-03-10 10:23:49 +0530 | [diff] [blame] | 58 | #define OMAP4430_VDD_CORE_OPP50_UV 1025000 |
| 59 | #define OMAP4430_VDD_CORE_OPP100_UV 1200000 |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 60 | |
| 61 | struct omap_volt_data omap44xx_vdd_core_volt_data[] = { |
| 62 | VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c), |
| 63 | VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16), |
| 64 | VOLT_DATA_DEFINE(0, 0, 0, 0), |
| 65 | }; |
| 66 | |
| 67 | |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 68 | static struct omap_opp_def __initdata omap44xx_opp_def_list[] = { |
| 69 | /* MPU OPP1 - OPP50 */ |
Vishwanath BS | 15f13e2 | 2011-03-05 15:57:22 +0530 | [diff] [blame] | 70 | OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV), |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 71 | /* MPU OPP2 - OPP100 */ |
Vishwanath BS | 15f13e2 | 2011-03-05 15:57:22 +0530 | [diff] [blame] | 72 | OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV), |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 73 | /* MPU OPP3 - OPP-Turbo */ |
Shweta Gulati | 273032f | 2011-03-05 15:21:21 +0530 | [diff] [blame] | 74 | OPP_INITIALIZER("mpu", true, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV), |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 75 | /* MPU OPP4 - OPP-SB */ |
Shweta Gulati | 273032f | 2011-03-05 15:21:21 +0530 | [diff] [blame] | 76 | OPP_INITIALIZER("mpu", true, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV), |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 77 | /* L3 OPP1 - OPP50 */ |
Vishwanath BS | 15f13e2 | 2011-03-05 15:57:22 +0530 | [diff] [blame] | 78 | OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV), |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 79 | /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ |
Vishwanath BS | 15f13e2 | 2011-03-05 15:57:22 +0530 | [diff] [blame] | 80 | OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV), |
Shweta Gulati | a271e58 | 2011-03-05 15:22:26 +0530 | [diff] [blame] | 81 | /* IVA OPP1 - OPP50 */ |
| 82 | OPP_INITIALIZER("iva", true, 133000000, OMAP4430_VDD_IVA_OPP50_UV), |
| 83 | /* IVA OPP2 - OPP100 */ |
| 84 | OPP_INITIALIZER("iva", true, 266100000, OMAP4430_VDD_IVA_OPP100_UV), |
| 85 | /* IVA OPP3 - OPP-Turbo */ |
| 86 | OPP_INITIALIZER("iva", false, 332000000, OMAP4430_VDD_IVA_OPPTURBO_UV), |
| 87 | /* TODO: add DSP, aess, fdif, gpu */ |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 88 | }; |
| 89 | |
| 90 | /** |
| 91 | * omap4_opp_init() - initialize omap4 opp table |
| 92 | */ |
Menon, Nishanth | eb05ead | 2011-01-05 20:49:35 +0000 | [diff] [blame] | 93 | int __init omap4_opp_init(void) |
Nishanth Menon | f5a6422 | 2010-12-09 09:13:47 -0600 | [diff] [blame] | 94 | { |
| 95 | int r = -ENODEV; |
| 96 | |
| 97 | if (!cpu_is_omap44xx()) |
| 98 | return r; |
| 99 | |
| 100 | r = omap_init_opp_table(omap44xx_opp_def_list, |
| 101 | ARRAY_SIZE(omap44xx_opp_def_list)); |
| 102 | |
| 103 | return r; |
| 104 | } |
| 105 | device_initcall(omap4_opp_init); |