blob: 0daf2a47dc28321678bba0de936bf97a791b8ea8 [file] [log] [blame]
Paul Walmsleyc0718df2011-03-10 22:17:45 -07001/*
2 * OMAP3 Voltage Processor (VP) 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
18#include <linux/io.h>
19#include <linux/err.h>
20#include <linux/init.h>
21
22#include <plat/common.h>
23
24#include "prm44xx.h"
25#include "prm-regbits-44xx.h"
26#include "voltage.h"
27
28#include "vp.h"
29
Kevin Hilman58aaa592011-03-28 10:52:04 -070030static const struct omap_vp_ops omap4_vp_ops = {
31 .check_txdone = omap4_prm_vp_check_txdone,
32 .clear_txdone = omap4_prm_vp_clear_txdone,
33};
34
Paul Walmsleyc0718df2011-03-10 22:17:45 -070035/*
36 * VP data common to 44xx chips
37 * XXX This stuff presumably belongs in the vp44xx.c or vp.c file.
38 */
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070039static const struct omap_vp_common omap4_vp_common = {
Kevin Hilman0ec30412011-04-04 16:02:28 -070040 .vpconfig_erroroffset_mask = OMAP4430_ERROROFFSET_MASK,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070041 .vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070042 .vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK,
43 .vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK,
44 .vpconfig_initvdd = OMAP4430_INITVDD_MASK,
45 .vpconfig_forceupdate = OMAP4430_FORCEUPDATE_MASK,
46 .vpconfig_vpenable = OMAP4430_VPENABLE_MASK,
47 .vstepmin_smpswaittimemin_shift = OMAP4430_SMPSWAITTIMEMIN_SHIFT,
48 .vstepmax_smpswaittimemax_shift = OMAP4430_SMPSWAITTIMEMAX_SHIFT,
49 .vstepmin_stepmin_shift = OMAP4430_VSTEPMIN_SHIFT,
50 .vstepmax_stepmax_shift = OMAP4430_VSTEPMAX_SHIFT,
51 .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT,
52 .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT,
53 .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT,
Kevin Hilman58aaa592011-03-28 10:52:04 -070054 .ops = &omap4_vp_ops,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070055};
56
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070057struct omap_vp_instance omap4_vp_mpu = {
Kevin Hilman58aaa592011-03-28 10:52:04 -070058 .id = OMAP4_VP_VDD_MPU_ID,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070059 .common = &omap4_vp_common,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070060 .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET,
61 .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET,
62 .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET,
63 .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET,
64 .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET,
65 .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070066};
67
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070068struct omap_vp_instance omap4_vp_iva = {
Kevin Hilman58aaa592011-03-28 10:52:04 -070069 .id = OMAP4_VP_VDD_IVA_ID,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070070 .common = &omap4_vp_common,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070071 .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET,
72 .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET,
73 .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET,
74 .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET,
75 .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET,
76 .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070077};
78
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070079struct omap_vp_instance omap4_vp_core = {
Kevin Hilman58aaa592011-03-28 10:52:04 -070080 .id = OMAP4_VP_VDD_CORE_ID,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070081 .common = &omap4_vp_common,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070082 .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET,
83 .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET,
84 .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET,
85 .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET,
86 .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET,
87 .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070088};