Merge tag 'omap-for-v4.8/legacy-signed' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / arch / arm / mach-omap2 / voltagedomains3xxx_data.c
CommitLineData
c0718df4
PW
1/*
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
dbc04161 21#include "soc.h"
4e65331c 22#include "common.h"
c0718df4
PW
23#include "prm-regbits-34xx.h"
24#include "omap_opp_data.h"
25#include "voltage.h"
26#include "vc.h"
27#include "vp.h"
28
29/*
30 * VDD data
31 */
32
ddf536d0
PW
33/* OMAP3-common voltagedomain data */
34
35static struct voltagedomain omap3_voltdm_wkup = {
36 .name = "wakeup",
37};
38
39/* 34xx/36xx voltagedomain data */
40
5892bb1f 41static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
c0718df4 42 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
c0718df4
PW
43 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
44};
45
5892bb1f 46static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
c0718df4 47 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
c0718df4
PW
48 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
49};
50
81a60482 51static struct voltagedomain omap3_voltdm_mpu = {
280a7275 52 .name = "mpu_iva",
37efca7e 53 .scalable = true,
4bcc475e
KH
54 .read = omap3_prm_vcvp_read,
55 .write = omap3_prm_vcvp_write,
56 .rmw = omap3_prm_vcvp_rmw,
d84adcf4 57 .vc = &omap3_vc_mpu,
5892bb1f 58 .vfsm = &omap3_vdd1_vfsm,
b7ea803e 59 .vp = &omap3_vp_mpu,
c0718df4
PW
60};
61
81a60482
KH
62static struct voltagedomain omap3_voltdm_core = {
63 .name = "core",
37efca7e 64 .scalable = true,
4bcc475e
KH
65 .read = omap3_prm_vcvp_read,
66 .write = omap3_prm_vcvp_write,
67 .rmw = omap3_prm_vcvp_rmw,
d84adcf4 68 .vc = &omap3_vc_core,
5892bb1f 69 .vfsm = &omap3_vdd2_vfsm,
b7ea803e 70 .vp = &omap3_vp_core,
81a60482 71};
c0718df4 72
81a60482
KH
73static struct voltagedomain *voltagedomains_omap3[] __initdata = {
74 &omap3_voltdm_mpu,
75 &omap3_voltdm_core,
ace19ffa 76 &omap3_voltdm_wkup,
81a60482
KH
77 NULL,
78};
79
ddf536d0
PW
80/* AM35xx voltagedomain data */
81
82static struct voltagedomain am35xx_voltdm_mpu = {
83 .name = "mpu_iva",
84};
85
86static struct voltagedomain am35xx_voltdm_core = {
87 .name = "core",
88};
89
90static struct voltagedomain *voltagedomains_am35xx[] __initdata = {
91 &am35xx_voltdm_mpu,
92 &am35xx_voltdm_core,
93 &omap3_voltdm_wkup,
94 NULL,
95};
96
97
19c233b7 98static const char *const sys_clk_name __initconst = "sys_ck";
0e2f3d9c 99
81a60482
KH
100void __init omap3xxx_voltagedomains_init(void)
101{
0e2f3d9c 102 struct voltagedomain *voltdm;
ddf536d0 103 struct voltagedomain **voltdms;
0e2f3d9c
KH
104 int i;
105
c0718df4
PW
106 /*
107 * XXX Will depend on the process, validation, and binning
108 * for the currently-running IC
109 */
3ddd4d0c 110#ifdef CONFIG_PM_OPP
c0718df4 111 if (cpu_is_omap3630()) {
e3277880
KH
112 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
113 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
c0718df4 114 } else {
e3277880
KH
115 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
116 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
c0718df4 117 }
3ddd4d0c 118#endif
c0718df4 119
8b5d8c0d
TK
120 omap3_voltdm_mpu.vp_param = &omap3_mpu_vp_data;
121 omap3_voltdm_core.vp_param = &omap3_core_vp_data;
122 omap3_voltdm_mpu.vc_param = &omap3_mpu_vc_data;
123 omap3_voltdm_core.vc_param = &omap3_core_vc_data;
124
68a88b98 125 if (soc_is_am35xx())
ddf536d0
PW
126 voltdms = voltagedomains_am35xx;
127 else
128 voltdms = voltagedomains_omap3;
129
130 for (i = 0; voltdm = voltdms[i], voltdm; i++)
0e2f3d9c
KH
131 voltdm->sys_clk.name = sys_clk_name;
132
ddf536d0 133 voltdm_init(voltdms);
c0718df4 134};
This page took 0.319856 seconds and 5 git commands to generate.