Commit | Line | Data |
---|---|---|
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 | ||
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 | ||
5892bb1f | 34 | static const struct omap_vfsm_instance omap3_vdd1_vfsm = { |
c0718df4 | 35 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, |
c0718df4 PW |
36 | .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK, |
37 | }; | |
38 | ||
5892bb1f | 39 | static const struct omap_vfsm_instance omap3_vdd2_vfsm = { |
c0718df4 | 40 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, |
c0718df4 PW |
41 | .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK, |
42 | }; | |
43 | ||
81a60482 | 44 | static struct voltagedomain omap3_voltdm_mpu = { |
280a7275 | 45 | .name = "mpu_iva", |
37efca7e | 46 | .scalable = true, |
4bcc475e KH |
47 | .read = omap3_prm_vcvp_read, |
48 | .write = omap3_prm_vcvp_write, | |
49 | .rmw = omap3_prm_vcvp_rmw, | |
d84adcf4 | 50 | .vc = &omap3_vc_mpu, |
5892bb1f | 51 | .vfsm = &omap3_vdd1_vfsm, |
b7ea803e | 52 | .vp = &omap3_vp_mpu, |
c0718df4 PW |
53 | }; |
54 | ||
81a60482 KH |
55 | static struct voltagedomain omap3_voltdm_core = { |
56 | .name = "core", | |
37efca7e | 57 | .scalable = true, |
4bcc475e KH |
58 | .read = omap3_prm_vcvp_read, |
59 | .write = omap3_prm_vcvp_write, | |
60 | .rmw = omap3_prm_vcvp_rmw, | |
d84adcf4 | 61 | .vc = &omap3_vc_core, |
5892bb1f | 62 | .vfsm = &omap3_vdd2_vfsm, |
b7ea803e | 63 | .vp = &omap3_vp_core, |
81a60482 | 64 | }; |
c0718df4 | 65 | |
ace19ffa KH |
66 | static struct voltagedomain omap3_voltdm_wkup = { |
67 | .name = "wakeup", | |
68 | }; | |
69 | ||
81a60482 KH |
70 | static struct voltagedomain *voltagedomains_omap3[] __initdata = { |
71 | &omap3_voltdm_mpu, | |
72 | &omap3_voltdm_core, | |
ace19ffa | 73 | &omap3_voltdm_wkup, |
81a60482 KH |
74 | NULL, |
75 | }; | |
76 | ||
0e2f3d9c KH |
77 | static const char *sys_clk_name __initdata = "sys_ck"; |
78 | ||
81a60482 KH |
79 | void __init omap3xxx_voltagedomains_init(void) |
80 | { | |
0e2f3d9c KH |
81 | struct voltagedomain *voltdm; |
82 | int i; | |
83 | ||
c0718df4 PW |
84 | /* |
85 | * XXX Will depend on the process, validation, and binning | |
86 | * for the currently-running IC | |
87 | */ | |
88 | if (cpu_is_omap3630()) { | |
e3277880 KH |
89 | omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data; |
90 | omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data; | |
c0718df4 | 91 | } else { |
e3277880 KH |
92 | omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data; |
93 | omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data; | |
c0718df4 PW |
94 | } |
95 | ||
0e2f3d9c KH |
96 | for (i = 0; voltdm = voltagedomains_omap3[i], voltdm; i++) |
97 | voltdm->sys_clk.name = sys_clk_name; | |
98 | ||
81a60482 | 99 | voltdm_init(voltagedomains_omap3); |
c0718df4 | 100 | }; |