blob: d0103c80d04085376a41d77d97995d4c558831c6 [file] [log] [blame]
Paul Walmsleyc0718df2011-03-10 22:17:45 -07001/*
2 * OMAP3 voltage domain data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17#include <linux/kernel.h>
18#include <linux/err.h>
19#include <linux/init.h>
20
Tony Lindgren4e653312011-11-10 22:45:17 +010021#include "common.h"
Paul Walmsleyc0718df2011-03-10 22:17:45 -070022#include <plat/cpu.h>
23
24#include "prm-regbits-34xx.h"
25#include "omap_opp_data.h"
26#include "voltage.h"
27#include "vc.h"
28#include "vp.h"
29
30/*
31 * VDD data
32 */
33
Paul Walmsleyddf536d2011-12-16 16:09:11 -080034/* OMAP3-common voltagedomain data */
35
36static struct voltagedomain omap3_voltdm_wkup = {
37 .name = "wakeup",
38};
39
40/* 34xx/36xx voltagedomain data */
41
Kevin Hilman5892bb12011-03-29 14:36:04 -070042static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
Paul Walmsleyc0718df2011-03-10 22:17:45 -070043 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070044 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
45};
46
Kevin Hilman5892bb12011-03-29 14:36:04 -070047static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
Paul Walmsleyc0718df2011-03-10 22:17:45 -070048 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070049 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
50};
51
Kevin Hilman81a60482011-03-16 14:25:45 -070052static struct voltagedomain omap3_voltdm_mpu = {
Kevin Hilman280a7272011-03-23 11:18:08 -070053 .name = "mpu_iva",
Kevin Hilman37efca72011-03-23 17:00:21 -070054 .scalable = true,
Kevin Hilman4bcc4752011-03-28 10:40:15 -070055 .read = omap3_prm_vcvp_read,
56 .write = omap3_prm_vcvp_write,
57 .rmw = omap3_prm_vcvp_rmw,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070058 .vc = &omap3_vc_mpu,
Kevin Hilman5892bb12011-03-29 14:36:04 -070059 .vfsm = &omap3_vdd1_vfsm,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070060 .vp = &omap3_vp_mpu,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070061};
62
Kevin Hilman81a60482011-03-16 14:25:45 -070063static struct voltagedomain omap3_voltdm_core = {
64 .name = "core",
Kevin Hilman37efca72011-03-23 17:00:21 -070065 .scalable = true,
Kevin Hilman4bcc4752011-03-28 10:40:15 -070066 .read = omap3_prm_vcvp_read,
67 .write = omap3_prm_vcvp_write,
68 .rmw = omap3_prm_vcvp_rmw,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070069 .vc = &omap3_vc_core,
Kevin Hilman5892bb12011-03-29 14:36:04 -070070 .vfsm = &omap3_vdd2_vfsm,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070071 .vp = &omap3_vp_core,
Kevin Hilman81a60482011-03-16 14:25:45 -070072};
73
74static struct voltagedomain *voltagedomains_omap3[] __initdata = {
75 &omap3_voltdm_mpu,
76 &omap3_voltdm_core,
Kevin Hilmanace19ff2011-03-23 13:30:33 -070077 &omap3_voltdm_wkup,
Kevin Hilman81a60482011-03-16 14:25:45 -070078 NULL,
79};
80
Paul Walmsleyddf536d2011-12-16 16:09:11 -080081/* AM35xx voltagedomain data */
82
83static struct voltagedomain am35xx_voltdm_mpu = {
84 .name = "mpu_iva",
85};
86
87static struct voltagedomain am35xx_voltdm_core = {
88 .name = "core",
89};
90
91static struct voltagedomain *voltagedomains_am35xx[] __initdata = {
92 &am35xx_voltdm_mpu,
93 &am35xx_voltdm_core,
94 &omap3_voltdm_wkup,
95 NULL,
96};
97
98
Kevin Hilman0e2f3d92011-04-04 17:22:28 -070099static const char *sys_clk_name __initdata = "sys_ck";
100
Kevin Hilman81a60482011-03-16 14:25:45 -0700101void __init omap3xxx_voltagedomains_init(void)
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700102{
Kevin Hilman0e2f3d92011-04-04 17:22:28 -0700103 struct voltagedomain *voltdm;
Paul Walmsleyddf536d2011-12-16 16:09:11 -0800104 struct voltagedomain **voltdms;
Kevin Hilman0e2f3d92011-04-04 17:22:28 -0700105 int i;
106
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700107 /*
108 * XXX Will depend on the process, validation, and binning
109 * for the currently-running IC
110 */
Russell King3ddd4d02012-02-15 11:28:06 +0000111#ifdef CONFIG_PM_OPP
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700112 if (cpu_is_omap3630()) {
Kevin Hilmane3277882011-07-14 11:29:06 -0700113 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
114 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700115 } else {
Kevin Hilmane3277882011-07-14 11:29:06 -0700116 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
117 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700118 }
Russell King3ddd4d02012-02-15 11:28:06 +0000119#endif
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700120
Kevin Hilman68a88b92012-04-30 16:37:10 -0700121 if (soc_is_am35xx())
Paul Walmsleyddf536d2011-12-16 16:09:11 -0800122 voltdms = voltagedomains_am35xx;
123 else
124 voltdms = voltagedomains_omap3;
125
126 for (i = 0; voltdm = voltdms[i], voltdm; i++)
Kevin Hilman0e2f3d92011-04-04 17:22:28 -0700127 voltdm->sys_clk.name = sys_clk_name;
128
Paul Walmsleyddf536d2011-12-16 16:09:11 -0800129 voltdm_init(voltdms);
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700130};