Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 1 | /* |
| 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 "prm-regbits-34xx.h" |
| 25 | #include "voltage.h" |
| 26 | |
| 27 | #include "vp.h" |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 28 | #include "prm2xxx_3xxx.h" |
| 29 | |
| 30 | static const struct omap_vp_ops omap3_vp_ops = { |
| 31 | .check_txdone = omap3_prm_vp_check_txdone, |
| 32 | .clear_txdone = omap3_prm_vp_clear_txdone, |
| 33 | }; |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 34 | |
| 35 | /* |
| 36 | * VP data common to 34xx/36xx chips |
| 37 | * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file. |
| 38 | */ |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 39 | static const struct omap_vp_common omap3_vp_common = { |
Kevin Hilman | 0ec3041 | 2011-04-04 16:02:28 -0700 | [diff] [blame] | 40 | .vpconfig_erroroffset_mask = OMAP3430_ERROROFFSET_MASK, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 41 | .vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 42 | .vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK, |
| 43 | .vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK, |
| 44 | .vpconfig_initvdd = OMAP3430_INITVDD_MASK, |
| 45 | .vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK, |
| 46 | .vpconfig_vpenable = OMAP3430_VPENABLE_MASK, |
| 47 | .vstepmin_smpswaittimemin_shift = OMAP3430_SMPSWAITTIMEMIN_SHIFT, |
| 48 | .vstepmax_smpswaittimemax_shift = OMAP3430_SMPSWAITTIMEMAX_SHIFT, |
| 49 | .vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT, |
| 50 | .vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT, |
| 51 | .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, |
| 52 | .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, |
| 53 | .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, |
Todd Poynor | bea30ed | 2011-05-27 19:15:59 -0700 | [diff] [blame] | 54 | .vpvoltage_mask = OMAP3430_VPVOLTAGE_MASK, |
| 55 | |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 56 | .ops = &omap3_vp_ops, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 59 | struct omap_vp_instance omap3_vp_mpu = { |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 60 | .id = OMAP3_VP_VDD_MPU_ID, |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 61 | .common = &omap3_vp_common, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 62 | .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET, |
| 63 | .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET, |
| 64 | .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET, |
| 65 | .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET, |
| 66 | .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET, |
| 67 | .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 70 | struct omap_vp_instance omap3_vp_core = { |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 71 | .id = OMAP3_VP_VDD_CORE_ID, |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 72 | .common = &omap3_vp_common, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 73 | .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET, |
| 74 | .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET, |
| 75 | .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET, |
| 76 | .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET, |
| 77 | .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET, |
| 78 | .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 79 | }; |