0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <linux/kernel.h>
0015 #include <linux/err.h>
0016 #include <linux/init.h>
0017
0018 #include "soc.h"
0019 #include "common.h"
0020 #include "prm-regbits-34xx.h"
0021 #include "omap_opp_data.h"
0022 #include "voltage.h"
0023 #include "vc.h"
0024 #include "vp.h"
0025
0026
0027
0028
0029
0030
0031
0032 static struct voltagedomain omap3_voltdm_wkup = {
0033 .name = "wakeup",
0034 };
0035
0036
0037
0038 static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
0039 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
0040 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
0041 };
0042
0043 static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
0044 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
0045 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
0046 };
0047
0048 static struct voltagedomain omap3_voltdm_mpu = {
0049 .name = "mpu_iva",
0050 .scalable = true,
0051 .read = omap3_prm_vcvp_read,
0052 .write = omap3_prm_vcvp_write,
0053 .rmw = omap3_prm_vcvp_rmw,
0054 .vc = &omap3_vc_mpu,
0055 .vfsm = &omap3_vdd1_vfsm,
0056 .vp = &omap3_vp_mpu,
0057 };
0058
0059 static struct voltagedomain omap3_voltdm_core = {
0060 .name = "core",
0061 .scalable = true,
0062 .read = omap3_prm_vcvp_read,
0063 .write = omap3_prm_vcvp_write,
0064 .rmw = omap3_prm_vcvp_rmw,
0065 .vc = &omap3_vc_core,
0066 .vfsm = &omap3_vdd2_vfsm,
0067 .vp = &omap3_vp_core,
0068 };
0069
0070 static struct voltagedomain *voltagedomains_omap3[] __initdata = {
0071 &omap3_voltdm_mpu,
0072 &omap3_voltdm_core,
0073 &omap3_voltdm_wkup,
0074 NULL,
0075 };
0076
0077
0078
0079 static struct voltagedomain am35xx_voltdm_mpu = {
0080 .name = "mpu_iva",
0081 };
0082
0083 static struct voltagedomain am35xx_voltdm_core = {
0084 .name = "core",
0085 };
0086
0087 static struct voltagedomain *voltagedomains_am35xx[] __initdata = {
0088 &am35xx_voltdm_mpu,
0089 &am35xx_voltdm_core,
0090 &omap3_voltdm_wkup,
0091 NULL,
0092 };
0093
0094
0095 static const char *const sys_clk_name __initconst = "sys_ck";
0096
0097 void __init omap3xxx_voltagedomains_init(void)
0098 {
0099 struct voltagedomain *voltdm;
0100 struct voltagedomain **voltdms;
0101 int i;
0102
0103
0104
0105
0106
0107 #ifdef CONFIG_PM_OPP
0108 if (cpu_is_omap3630()) {
0109 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
0110 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
0111 } else {
0112 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
0113 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
0114 }
0115 #endif
0116
0117 omap3_voltdm_mpu.vp_param = &omap3_mpu_vp_data;
0118 omap3_voltdm_core.vp_param = &omap3_core_vp_data;
0119 omap3_voltdm_mpu.vc_param = &omap3_mpu_vc_data;
0120 omap3_voltdm_core.vc_param = &omap3_core_vc_data;
0121
0122 if (soc_is_am35xx())
0123 voltdms = voltagedomains_am35xx;
0124 else
0125 voltdms = voltagedomains_omap3;
0126
0127 for (i = 0; voltdm = voltdms[i], voltdm; i++)
0128 voltdm->sys_clk.name = sys_clk_name;
0129
0130 voltdm_init(voltdms);
0131 };