]> Pileus Git - ~andy/linux/blob - arch/arm/mach-omap2/voltagedomains3xxx_data.c
OMAP3+: VP: move SoC-specific sys clock rate retreival late init
[~andy/linux] / arch / arm / mach-omap2 / voltagedomains3xxx_data.c
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
21 #include <plat/common.h>
22 #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
34 static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
35         .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
36         .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
37 };
38
39 static struct omap_vdd_info omap3_vdd1_info;
40
41 static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
42         .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
43         .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
44 };
45
46 static struct omap_vdd_info omap3_vdd2_info;
47
48 static struct voltagedomain omap3_voltdm_mpu = {
49         .name = "mpu_iva",
50         .scalable = true,
51         .read = omap3_prm_vcvp_read,
52         .write = omap3_prm_vcvp_write,
53         .rmw = omap3_prm_vcvp_rmw,
54         .vc = &omap3_vc_mpu,
55         .vfsm = &omap3_vdd1_vfsm,
56         .vp = &omap3_vp_mpu,
57         .vdd = &omap3_vdd1_info,
58 };
59
60 static struct voltagedomain omap3_voltdm_core = {
61         .name = "core",
62         .scalable = true,
63         .read = omap3_prm_vcvp_read,
64         .write = omap3_prm_vcvp_write,
65         .rmw = omap3_prm_vcvp_rmw,
66         .vc = &omap3_vc_core,
67         .vfsm = &omap3_vdd2_vfsm,
68         .vp = &omap3_vp_core,
69         .vdd = &omap3_vdd2_info,
70 };
71
72 static struct voltagedomain omap3_voltdm_wkup = {
73         .name = "wakeup",
74 };
75
76 static struct voltagedomain *voltagedomains_omap3[] __initdata = {
77         &omap3_voltdm_mpu,
78         &omap3_voltdm_core,
79         &omap3_voltdm_wkup,
80         NULL,
81 };
82
83 static const char *sys_clk_name __initdata = "sys_ck";
84
85 void __init omap3xxx_voltagedomains_init(void)
86 {
87         struct voltagedomain *voltdm;
88         int i;
89
90         /*
91          * XXX Will depend on the process, validation, and binning
92          * for the currently-running IC
93          */
94         if (cpu_is_omap3630()) {
95                 omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
96                 omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
97         } else {
98                 omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data;
99                 omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data;
100         }
101
102         for (i = 0; voltdm = voltagedomains_omap3[i], voltdm; i++)
103                 voltdm->sys_clk.name = sys_clk_name;
104
105         voltdm_init(voltagedomains_omap3);
106 };