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_data omap3_vdd1_vfsm_data = {
35 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
36 .voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT,
37 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
38 };
39
40 static struct omap_vdd_info omap3_vdd1_info = {
41 .vp_data = &omap3_vp1_data,
42 .vc_data = &omap3_vc1_data,
43 .vfsm = &omap3_vdd1_vfsm_data,
44 .voltdm = {
45 .name = "mpu",
46 },
47 };
48
49 static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = {
50 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
51 .voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT,
52 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
53 };
54
55 static struct omap_vdd_info omap3_vdd2_info = {
56 .vp_data = &omap3_vp2_data,
57 .vc_data = &omap3_vc2_data,
58 .vfsm = &omap3_vdd2_vfsm_data,
59 .voltdm = {
60 .name = "core",
61 },
62 };
63
64 /* OMAP3 VDD structures */
65 static struct omap_vdd_info *omap3_vdd_info[] = {
66 &omap3_vdd1_info,
67 &omap3_vdd2_info,
68 };
69
70 /* OMAP3 specific voltage init functions */
omap3xxx_voltage_early_init(void)71 static int __init omap3xxx_voltage_early_init(void)
72 {
73 s16 prm_mod = OMAP3430_GR_MOD;
74 s16 prm_irqst_ocp_mod = OCP_MOD;
75
76 if (!cpu_is_omap34xx())
77 return 0;
78
79 /*
80 * XXX Will depend on the process, validation, and binning
81 * for the currently-running IC
82 */
83 if (cpu_is_omap3630()) {
84 omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
85 omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
86 } else {
87 omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data;
88 omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data;
89 }
90
91 return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
92 omap3_vdd_info,
93 ARRAY_SIZE(omap3_vdd_info));
94 };
95 core_initcall(omap3xxx_voltage_early_init);
96