blob: 9db9dd269ae3ce31a35f11edc6126205894ebeab [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Paul Walmsleyc0718df2011-03-10 22:17:45 -07002/*
3 * OMAP3 Voltage Processor (VP) data
4 *
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>
9 *
10 * Copyright (C) 2008, 2011 Nokia Corporation
11 * Kalle Jokiniemi
12 * Paul Walmsley
Paul Walmsleyc0718df2011-03-10 22:17:45 -070013 */
14
15#include <linux/io.h>
16#include <linux/err.h>
17#include <linux/init.h>
18
Tony Lindgren4e653312011-11-10 22:45:17 +010019#include "common.h"
Paul Walmsleyc0718df2011-03-10 22:17:45 -070020
21#include "prm-regbits-34xx.h"
22#include "voltage.h"
23
24#include "vp.h"
Kevin Hilman58aaa592011-03-28 10:52:04 -070025#include "prm2xxx_3xxx.h"
26
27static const struct omap_vp_ops omap3_vp_ops = {
Tero Kristoe9f1ddc2014-04-04 15:52:01 +030028 .check_txdone = omap_prm_vp_check_txdone,
29 .clear_txdone = omap_prm_vp_clear_txdone,
Kevin Hilman58aaa592011-03-28 10:52:04 -070030};
Paul Walmsleyc0718df2011-03-10 22:17:45 -070031
32/*
33 * VP data common to 34xx/36xx chips
34 * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file.
35 */
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070036static const struct omap_vp_common omap3_vp_common = {
Kevin Hilman0ec30412011-04-04 16:02:28 -070037 .vpconfig_erroroffset_mask = OMAP3430_ERROROFFSET_MASK,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070038 .vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070039 .vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK,
40 .vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK,
41 .vpconfig_initvdd = OMAP3430_INITVDD_MASK,
42 .vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK,
43 .vpconfig_vpenable = OMAP3430_VPENABLE_MASK,
44 .vstepmin_smpswaittimemin_shift = OMAP3430_SMPSWAITTIMEMIN_SHIFT,
45 .vstepmax_smpswaittimemax_shift = OMAP3430_SMPSWAITTIMEMAX_SHIFT,
46 .vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT,
47 .vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT,
48 .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT,
49 .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT,
50 .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT,
Todd Poynorbea30ed2011-05-27 19:15:59 -070051 .vpvoltage_mask = OMAP3430_VPVOLTAGE_MASK,
52
Kevin Hilman58aaa592011-03-28 10:52:04 -070053 .ops = &omap3_vp_ops,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070054};
55
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070056struct omap_vp_instance omap3_vp_mpu = {
Kevin Hilman58aaa592011-03-28 10:52:04 -070057 .id = OMAP3_VP_VDD_MPU_ID,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070058 .common = &omap3_vp_common,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070059 .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET,
60 .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET,
61 .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET,
62 .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET,
63 .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET,
64 .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070065};
66
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070067struct omap_vp_instance omap3_vp_core = {
Kevin Hilman58aaa592011-03-28 10:52:04 -070068 .id = OMAP3_VP_VDD_CORE_ID,
Kevin Hilmanb7ea8032011-04-04 15:25:07 -070069 .common = &omap3_vp_common,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070070 .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET,
71 .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET,
72 .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET,
73 .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET,
74 .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET,
75 .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET,
Paul Walmsleyc0718df2011-03-10 22:17:45 -070076};
Tero Kristo8b5d8c02012-09-25 19:33:35 +030077
78struct omap_vp_param omap3_mpu_vp_data = {
79 .vddmin = OMAP3430_VP1_VLIMITTO_VDDMIN,
80 .vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX,
81};
82
83struct omap_vp_param omap3_core_vp_data = {
84 .vddmin = OMAP3430_VP2_VLIMITTO_VDDMIN,
85 .vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX,
86};