blob: b5b1bb3d59d60318e1adfba21e84d8724322a581 [file] [log] [blame]
Nishanth Menonf5a64222010-12-09 09:13:47 -06001/*
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 Walmsleyc0718df2011-03-10 22:17:45 -07008 * Copyright (C) 2010-2011 Nokia Corporation.
Nishanth Menonf5a64222010-12-09 09:13:47 -06009 * Eduardo Valentin
Paul Walmsleyc0718df2011-03-10 22:17:45 -070010 * Paul Walmsley
Nishanth Menonf5a64222010-12-09 09:13:47 -060011 *
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 Walmsleyc0718df2011-03-10 22:17:45 -070025#include "control.h"
Nishanth Menonf5a64222010-12-09 09:13:47 -060026#include "omap_opp_data.h"
27
Paul Walmsleyc0718df2011-03-10 22:17:45 -070028/*
29 * Structures containing OMAP4430 voltage supported and various
30 * voltage dependent data for each VDD.
31 */
32
33#define OMAP4430_VDD_MPU_OPP50_UV 930000
34#define OMAP4430_VDD_MPU_OPP100_UV 1100000
35#define OMAP4430_VDD_MPU_OPPTURBO_UV 1260000
36#define OMAP4430_VDD_MPU_OPPNITRO_UV 1350000
37
38struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
39 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
40 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
41 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
42 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
43 VOLT_DATA_DEFINE(0, 0, 0, 0),
44};
45
46#define OMAP4430_VDD_IVA_OPP50_UV 930000
47#define OMAP4430_VDD_IVA_OPP100_UV 1100000
48#define OMAP4430_VDD_IVA_OPPTURBO_UV 1260000
49
50struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
51 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
52 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
53 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
54 VOLT_DATA_DEFINE(0, 0, 0, 0),
55};
56
57#define OMAP4430_VDD_CORE_OPP50_UV 930000
58#define OMAP4430_VDD_CORE_OPP100_UV 1100000
59
60struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
61 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
62 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
63 VOLT_DATA_DEFINE(0, 0, 0, 0),
64};
65
66
Nishanth Menonf5a64222010-12-09 09:13:47 -060067static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
68 /* MPU OPP1 - OPP50 */
Vishwanath BS15f13e22011-03-05 15:57:22 +053069 OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV),
Nishanth Menonf5a64222010-12-09 09:13:47 -060070 /* MPU OPP2 - OPP100 */
Vishwanath BS15f13e22011-03-05 15:57:22 +053071 OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV),
Nishanth Menonf5a64222010-12-09 09:13:47 -060072 /* MPU OPP3 - OPP-Turbo */
Vishwanath BS15f13e22011-03-05 15:57:22 +053073 OPP_INITIALIZER("mpu", false, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV),
Nishanth Menonf5a64222010-12-09 09:13:47 -060074 /* MPU OPP4 - OPP-SB */
Vishwanath BS15f13e22011-03-05 15:57:22 +053075 OPP_INITIALIZER("mpu", false, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV),
Nishanth Menonf5a64222010-12-09 09:13:47 -060076 /* L3 OPP1 - OPP50 */
Vishwanath BS15f13e22011-03-05 15:57:22 +053077 OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV),
Nishanth Menonf5a64222010-12-09 09:13:47 -060078 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
Vishwanath BS15f13e22011-03-05 15:57:22 +053079 OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV),
Nishanth Menonf5a64222010-12-09 09:13:47 -060080 /* TODO: add IVA, DSP, aess, fdif, gpu */
81};
82
83/**
84 * omap4_opp_init() - initialize omap4 opp table
85 */
86static int __init omap4_opp_init(void)
87{
88 int r = -ENODEV;
89
90 if (!cpu_is_omap44xx())
91 return r;
92
93 r = omap_init_opp_table(omap44xx_opp_def_list,
94 ARRAY_SIZE(omap44xx_opp_def_list));
95
96 return r;
97}
98device_initcall(omap4_opp_init);