1 // SPDX-License-Identifier: GPL-2.0-only
3 * OMAP3 voltage domain data
5 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
6 * Rajendra Nayak <rnayak@ti.com>
7 * Lesly A M <x0080970@ti.com>
8 * Thara Gopinath <thara@ti.com>
10 * Copyright (C) 2008, 2011 Nokia Corporation
14 #include <linux/kernel.h>
15 #include <linux/err.h>
16 #include <linux/init.h>
20 #include "prm-regbits-34xx.h"
21 #include "omap_opp_data.h"
30 /* OMAP3-common voltagedomain data */
32 static struct voltagedomain omap3_voltdm_wkup
= {
36 /* 34xx/36xx voltagedomain data */
38 static const struct omap_vfsm_instance omap3_vdd1_vfsm
= {
39 .voltsetup_reg
= OMAP3_PRM_VOLTSETUP1_OFFSET
,
40 .voltsetup_mask
= OMAP3430_SETUP_TIME1_MASK
,
43 static const struct omap_vfsm_instance omap3_vdd2_vfsm
= {
44 .voltsetup_reg
= OMAP3_PRM_VOLTSETUP1_OFFSET
,
45 .voltsetup_mask
= OMAP3430_SETUP_TIME2_MASK
,
48 static struct voltagedomain omap3_voltdm_mpu
= {
51 .read
= omap3_prm_vcvp_read
,
52 .write
= omap3_prm_vcvp_write
,
53 .rmw
= omap3_prm_vcvp_rmw
,
55 .vfsm
= &omap3_vdd1_vfsm
,
59 static struct voltagedomain omap3_voltdm_core
= {
62 .read
= omap3_prm_vcvp_read
,
63 .write
= omap3_prm_vcvp_write
,
64 .rmw
= omap3_prm_vcvp_rmw
,
66 .vfsm
= &omap3_vdd2_vfsm
,
70 static struct voltagedomain
*voltagedomains_omap3
[] __initdata
= {
77 /* AM35xx voltagedomain data */
79 static struct voltagedomain am35xx_voltdm_mpu
= {
83 static struct voltagedomain am35xx_voltdm_core
= {
87 static struct voltagedomain
*voltagedomains_am35xx
[] __initdata
= {
95 static const char *const sys_clk_name __initconst
= "sys_ck";
97 void __init
omap3xxx_voltagedomains_init(void)
99 struct voltagedomain
*voltdm
;
100 struct voltagedomain
**voltdms
;
104 * XXX Will depend on the process, validation, and binning
105 * for the currently-running IC
108 if (cpu_is_omap3630()) {
109 omap3_voltdm_mpu
.volt_data
= omap36xx_vddmpu_volt_data
;
110 omap3_voltdm_core
.volt_data
= omap36xx_vddcore_volt_data
;
112 omap3_voltdm_mpu
.volt_data
= omap34xx_vddmpu_volt_data
;
113 omap3_voltdm_core
.volt_data
= omap34xx_vddcore_volt_data
;
117 omap3_voltdm_mpu
.vp_param
= &omap3_mpu_vp_data
;
118 omap3_voltdm_core
.vp_param
= &omap3_core_vp_data
;
119 omap3_voltdm_mpu
.vc_param
= &omap3_mpu_vc_data
;
120 omap3_voltdm_core
.vc_param
= &omap3_core_vc_data
;
123 voltdms
= voltagedomains_am35xx
;
125 voltdms
= voltagedomains_omap3
;
127 for (i
= 0; voltdm
= voltdms
[i
], voltdm
; i
++)
128 voltdm
->sys_clk
.name
= sys_clk_name
;
130 voltdm_init(voltdms
);