blob: a05d90ab68696e700f745aca711938ab063d5e55 [file] [log] [blame]
Paul Walmsleyc0718df2011-03-10 22:17:45 -07001/*
2 * OMAP3/OMAP4 Voltage Management Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2007 Texas Instruments, Inc.
7 * Rajendra Nayak <rnayak@ti.com>
8 * Lesly A M <x0080970@ti.com>
9 *
10 * Copyright (C) 2008 Nokia Corporation
11 * Kalle Jokiniemi
12 *
13 * Copyright (C) 2010 Texas Instruments, Inc.
14 * Thara Gopinath <thara@ti.com>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20#include <linux/kernel.h>
21#include <linux/err.h>
22#include <linux/init.h>
23
24#include <plat/common.h>
25
26#include "prm-regbits-44xx.h"
27#include "prm44xx.h"
28#include "prcm44xx.h"
29#include "prminst44xx.h"
30#include "voltage.h"
31#include "omap_opp_data.h"
32#include "vc.h"
33#include "vp.h"
34
35static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
36 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
37};
38
39static struct omap_vdd_info omap4_vdd_mpu_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070040 .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070041 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070042 .vp_data = &omap4_vp_mpu_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070043 .vfsm = &omap4_vdd_mpu_vfsm_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070044};
45
46static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
47 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
48};
49
50static struct omap_vdd_info omap4_vdd_iva_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070051 .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070052 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070053 .vp_data = &omap4_vp_iva_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070054 .vfsm = &omap4_vdd_iva_vfsm_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070055};
56
57static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
58 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
59};
60
61static struct omap_vdd_info omap4_vdd_core_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070062 .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070063 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070064 .vp_data = &omap4_vp_core_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070065 .vfsm = &omap4_vdd_core_vfsm_data,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070066};
67
Kevin Hilman81a60482011-03-16 14:25:45 -070068static struct voltagedomain omap4_voltdm_mpu = {
69 .name = "mpu",
Kevin Hilman37efca72011-03-23 17:00:21 -070070 .scalable = true,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070071 .vc = &omap4_vc_mpu,
Kevin Hilman81a60482011-03-16 14:25:45 -070072 .vdd = &omap4_vdd_mpu_info,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070073};
74
Kevin Hilman81a60482011-03-16 14:25:45 -070075static struct voltagedomain omap4_voltdm_iva = {
76 .name = "iva",
Kevin Hilman37efca72011-03-23 17:00:21 -070077 .scalable = true,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070078 .vc = &omap4_vc_iva,
Kevin Hilman81a60482011-03-16 14:25:45 -070079 .vdd = &omap4_vdd_iva_info,
80};
81
82static struct voltagedomain omap4_voltdm_core = {
83 .name = "core",
Kevin Hilman37efca72011-03-23 17:00:21 -070084 .scalable = true,
Kevin Hilmand84adcf2011-03-22 16:14:57 -070085 .vc = &omap4_vc_core,
Kevin Hilman81a60482011-03-16 14:25:45 -070086 .vdd = &omap4_vdd_core_info,
87};
88
Benoit Cousson7e1b9402011-03-21 12:11:54 +010089static struct voltagedomain omap4_voltdm_wkup = {
90 .name = "wakeup",
91};
92
Kevin Hilman81a60482011-03-16 14:25:45 -070093static struct voltagedomain *voltagedomains_omap4[] __initdata = {
94 &omap4_voltdm_mpu,
95 &omap4_voltdm_iva,
96 &omap4_voltdm_core,
Benoit Cousson7e1b9402011-03-21 12:11:54 +010097 &omap4_voltdm_wkup,
Kevin Hilman81a60482011-03-16 14:25:45 -070098 NULL,
99};
100
101void __init omap44xx_voltagedomains_init(void)
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700102{
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700103 /*
104 * XXX Will depend on the process, validation, and binning
105 * for the currently-running IC
106 */
107 omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
108 omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
109 omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
110
Kevin Hilman81a60482011-03-16 14:25:45 -0700111 voltdm_init(voltagedomains_omap4);
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700112};