xref: /openbmc/linux/arch/arm/mach-omap2/vp3xxx_data.c (revision 4e65331c6bb4a777bd61a4dac0daa9fc47777b63)
1c0718df4SPaul Walmsley /*
2c0718df4SPaul Walmsley  * OMAP3 Voltage Processor (VP) data
3c0718df4SPaul Walmsley  *
4c0718df4SPaul Walmsley  * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5c0718df4SPaul Walmsley  * Rajendra Nayak <rnayak@ti.com>
6c0718df4SPaul Walmsley  * Lesly A M <x0080970@ti.com>
7c0718df4SPaul Walmsley  * Thara Gopinath <thara@ti.com>
8c0718df4SPaul Walmsley  *
9c0718df4SPaul Walmsley  * Copyright (C) 2008, 2011 Nokia Corporation
10c0718df4SPaul Walmsley  * Kalle Jokiniemi
11c0718df4SPaul Walmsley  * Paul Walmsley
12c0718df4SPaul Walmsley  *
13c0718df4SPaul Walmsley  * This program is free software; you can redistribute it and/or modify
14c0718df4SPaul Walmsley  * it under the terms of the GNU General Public License version 2 as
15c0718df4SPaul Walmsley  * published by the Free Software Foundation.
16c0718df4SPaul Walmsley  */
17c0718df4SPaul Walmsley 
18c0718df4SPaul Walmsley #include <linux/io.h>
19c0718df4SPaul Walmsley #include <linux/err.h>
20c0718df4SPaul Walmsley #include <linux/init.h>
21c0718df4SPaul Walmsley 
22*4e65331cSTony Lindgren #include "common.h"
23c0718df4SPaul Walmsley 
24c0718df4SPaul Walmsley #include "prm-regbits-34xx.h"
25c0718df4SPaul Walmsley #include "voltage.h"
26c0718df4SPaul Walmsley 
27c0718df4SPaul Walmsley #include "vp.h"
2858aaa599SKevin Hilman #include "prm2xxx_3xxx.h"
2958aaa599SKevin Hilman 
3058aaa599SKevin Hilman static const struct omap_vp_ops omap3_vp_ops = {
3158aaa599SKevin Hilman 	.check_txdone = omap3_prm_vp_check_txdone,
3258aaa599SKevin Hilman 	.clear_txdone = omap3_prm_vp_clear_txdone,
3358aaa599SKevin Hilman };
34c0718df4SPaul Walmsley 
35c0718df4SPaul Walmsley /*
36c0718df4SPaul Walmsley  * VP data common to 34xx/36xx chips
37c0718df4SPaul Walmsley  * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file.
38c0718df4SPaul Walmsley  */
39b7ea803eSKevin Hilman static const struct omap_vp_common omap3_vp_common = {
400ec3041eSKevin Hilman 	.vpconfig_erroroffset_mask = OMAP3430_ERROROFFSET_MASK,
41c0718df4SPaul Walmsley 	.vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK,
42c0718df4SPaul Walmsley 	.vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK,
43c0718df4SPaul Walmsley 	.vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK,
44c0718df4SPaul Walmsley 	.vpconfig_initvdd = OMAP3430_INITVDD_MASK,
45c0718df4SPaul Walmsley 	.vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK,
46c0718df4SPaul Walmsley 	.vpconfig_vpenable = OMAP3430_VPENABLE_MASK,
47c0718df4SPaul Walmsley 	.vstepmin_smpswaittimemin_shift = OMAP3430_SMPSWAITTIMEMIN_SHIFT,
48c0718df4SPaul Walmsley 	.vstepmax_smpswaittimemax_shift = OMAP3430_SMPSWAITTIMEMAX_SHIFT,
49c0718df4SPaul Walmsley 	.vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT,
50c0718df4SPaul Walmsley 	.vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT,
51c0718df4SPaul Walmsley 	.vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT,
52c0718df4SPaul Walmsley 	.vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT,
53c0718df4SPaul Walmsley 	.vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT,
54bea30ed6STodd Poynor 	.vpvoltage_mask = OMAP3430_VPVOLTAGE_MASK,
55bea30ed6STodd Poynor 
5658aaa599SKevin Hilman 	.ops = &omap3_vp_ops,
57c0718df4SPaul Walmsley };
58c0718df4SPaul Walmsley 
59b7ea803eSKevin Hilman struct omap_vp_instance omap3_vp_mpu = {
6058aaa599SKevin Hilman 	.id = OMAP3_VP_VDD_MPU_ID,
61b7ea803eSKevin Hilman 	.common = &omap3_vp_common,
62c0718df4SPaul Walmsley 	.vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET,
63c0718df4SPaul Walmsley 	.vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET,
64c0718df4SPaul Walmsley 	.vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET,
65c0718df4SPaul Walmsley 	.vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET,
66c0718df4SPaul Walmsley 	.vstatus = OMAP3_PRM_VP1_STATUS_OFFSET,
67c0718df4SPaul Walmsley 	.voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET,
68c0718df4SPaul Walmsley };
69c0718df4SPaul Walmsley 
70b7ea803eSKevin Hilman struct omap_vp_instance omap3_vp_core = {
7158aaa599SKevin Hilman 	.id = OMAP3_VP_VDD_CORE_ID,
72b7ea803eSKevin Hilman 	.common = &omap3_vp_common,
73c0718df4SPaul Walmsley 	.vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET,
74c0718df4SPaul Walmsley 	.vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET,
75c0718df4SPaul Walmsley 	.vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET,
76c0718df4SPaul Walmsley 	.vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET,
77c0718df4SPaul Walmsley 	.vstatus = OMAP3_PRM_VP2_STATUS_OFFSET,
78c0718df4SPaul Walmsley 	.voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET,
79c0718df4SPaul Walmsley };
80