blob: 64dc265aa2ad0726350b2b704cc4748635f42f90 [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,
43 .vc_data = &omap4_vc_mpu_data,
44 .vfsm = &omap4_vdd_mpu_vfsm_data,
45 .voltdm = {
46 .name = "mpu",
47 },
48};
49
50static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
51 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
52};
53
54static struct omap_vdd_info omap4_vdd_iva_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070055 .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070056 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070057 .vp_data = &omap4_vp_iva_data,
58 .vc_data = &omap4_vc_iva_data,
59 .vfsm = &omap4_vdd_iva_vfsm_data,
60 .voltdm = {
61 .name = "iva",
62 },
63};
64
65static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
66 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
67};
68
69static struct omap_vdd_info omap4_vdd_core_info = {
Kevin Hilmana7460daf2011-03-16 13:35:22 -070070 .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
Kevin Hilmanc39263c2011-03-16 17:20:35 -070071 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070072 .vp_data = &omap4_vp_core_data,
73 .vc_data = &omap4_vc_core_data,
74 .vfsm = &omap4_vdd_core_vfsm_data,
75 .voltdm = {
76 .name = "core",
77 },
78};
79
80/* OMAP4 VDD structures */
81static struct omap_vdd_info *omap4_vdd_info[] = {
82 &omap4_vdd_mpu_info,
83 &omap4_vdd_iva_info,
84 &omap4_vdd_core_info,
85};
86
87/* OMAP4 specific voltage init functions */
88static int __init omap44xx_voltage_early_init(void)
89{
Paul Walmsleyc0718df2011-03-10 22:17:45 -070090 if (!cpu_is_omap44xx())
91 return 0;
92
93 /*
94 * XXX Will depend on the process, validation, and binning
95 * for the currently-running IC
96 */
97 omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
98 omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
99 omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
100
Kevin Hilmana7460daf2011-03-16 13:35:22 -0700101 return omap_voltage_early_init(omap4_vdd_info,
Paul Walmsleyc0718df2011-03-10 22:17:45 -0700102 ARRAY_SIZE(omap4_vdd_info));
103};
104core_initcall(omap44xx_voltage_early_init);