blob: 7cb27ec64890d5a45d0466d8c1d9c370309c947f [file] [log] [blame]
Paul Walmsleyc0718df2011-03-10 22:17:45 -07001/*
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
34static 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
40static struct omap_vdd_info omap3_vdd1_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070041 .prm_irqst_mod = OCP_MOD,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070042 .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070043 .vp_data = &omap3_vp1_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070044 .vfsm = &omap3_vdd1_vfsm_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070045};
46
47static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = {
48 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
49 .voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT,
50 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
51};
52
53static struct omap_vdd_info omap3_vdd2_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070054 .prm_irqst_mod = OCP_MOD,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070055 .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070056 .vp_data = &omap3_vp2_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070057 .vfsm = &omap3_vdd2_vfsm_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070058};
59
Kevin Hilman81a60482011-03-16 14:25:45 -070060static struct voltagedomain omap3_voltdm_mpu = {
Kevin Hilman280a7272011-03-23 11:18:08 -070061 .name = "mpu_iva",
Kevin Hilman37efca72011-03-23 17:00:21 -070062 .scalable = true,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070063 .vc = &omap3_vc_mpu,
Kevin Hilman81a60482011-03-16 14:25:45 -070064 .vdd = &omap3_vdd1_info,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070065};
66
Kevin Hilman81a60482011-03-16 14:25:45 -070067static struct voltagedomain omap3_voltdm_core = {
68 .name = "core",
Kevin Hilman37efca72011-03-23 17:00:21 -070069 .scalable = true,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070070 .vc = &omap3_vc_core,
Kevin Hilman81a60482011-03-16 14:25:45 -070071 .vdd = &omap3_vdd2_info,
72};
73
Kevin Hilmanace19ff2011-03-23 13:30:33 -070074static struct voltagedomain omap3_voltdm_wkup = {
75 .name = "wakeup",
76};
77
Kevin Hilman81a60482011-03-16 14:25:45 -070078static struct voltagedomain *voltagedomains_omap3[] __initdata = {
79 &omap3_voltdm_mpu,
80 &omap3_voltdm_core,
Kevin Hilmanace19ff2011-03-23 13:30:33 -070081 &omap3_voltdm_wkup,
Kevin Hilman81a60482011-03-16 14:25:45 -070082 NULL,
83};
84
85void __init omap3xxx_voltagedomains_init(void)
Paul Walmsleyc0718df2011-03-10 22:17:45 -070086{
Paul Walmsleyc0718df2011-03-10 22:17:45 -070087 /*
88 * XXX Will depend on the process, validation, and binning
89 * for the currently-running IC
90 */
91 if (cpu_is_omap3630()) {
92 omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
93 omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
94 } else {
95 omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data;
96 omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data;
97 }
98
Kevin Hilman81a60482011-03-16 14:25:45 -070099 voltdm_init(voltagedomains_omap3);
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700100};