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 | |
Tony Lindgren | 4e65331 | 2011-11-10 22:45:17 +0100 | [diff] [blame] | 22 | #include "common.h" |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 23 | |
| 24 | #include "prm44xx.h" |
| 25 | #include "prm-regbits-44xx.h" |
| 26 | #include "voltage.h" |
| 27 | |
| 28 | #include "vp.h" |
| 29 | |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 30 | static 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 Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 35 | /* |
| 36 | * VP data common to 44xx chips |
| 37 | * XXX This stuff presumably belongs in the vp44xx.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 omap4_vp_common = { |
Kevin Hilman | 0ec3041 | 2011-04-04 16:02:28 -0700 | [diff] [blame] | 40 | .vpconfig_erroroffset_mask = OMAP4430_ERROROFFSET_MASK, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 41 | .vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 42 | .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, |
Todd Poynor | bea30ed | 2011-05-27 19:15:59 -0700 | [diff] [blame] | 54 | .vpvoltage_mask = OMAP4430_VPVOLTAGE_MASK, |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 55 | .ops = &omap4_vp_ops, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 56 | }; |
| 57 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 58 | struct omap_vp_instance omap4_vp_mpu = { |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 59 | .id = OMAP4_VP_VDD_MPU_ID, |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 60 | .common = &omap4_vp_common, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 61 | .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET, |
| 62 | .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET, |
| 63 | .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET, |
| 64 | .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET, |
| 65 | .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET, |
| 66 | .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 67 | }; |
| 68 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 69 | struct omap_vp_instance omap4_vp_iva = { |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 70 | .id = OMAP4_VP_VDD_IVA_ID, |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 71 | .common = &omap4_vp_common, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 72 | .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET, |
| 73 | .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET, |
| 74 | .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET, |
| 75 | .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET, |
| 76 | .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET, |
| 77 | .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 80 | struct omap_vp_instance omap4_vp_core = { |
Kevin Hilman | 58aaa59 | 2011-03-28 10:52:04 -0700 | [diff] [blame] | 81 | .id = OMAP4_VP_VDD_CORE_ID, |
Kevin Hilman | b7ea803 | 2011-04-04 15:25:07 -0700 | [diff] [blame] | 82 | .common = &omap4_vp_common, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 83 | .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET, |
| 84 | .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET, |
| 85 | .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET, |
| 86 | .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET, |
| 87 | .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET, |
| 88 | .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 89 | }; |
Tero Kristo | 8b5d8c0 | 2012-09-25 19:33:35 +0300 | [diff] [blame] | 90 | |
| 91 | struct omap_vp_param omap4_mpu_vp_data = { |
| 92 | .vddmin = OMAP4_VP_MPU_VLIMITTO_VDDMIN, |
| 93 | .vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX, |
| 94 | }; |
| 95 | |
| 96 | struct omap_vp_param omap4_iva_vp_data = { |
| 97 | .vddmin = OMAP4_VP_IVA_VLIMITTO_VDDMIN, |
| 98 | .vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX, |
| 99 | }; |
| 100 | |
| 101 | struct omap_vp_param omap4_core_vp_data = { |
| 102 | .vddmin = OMAP4_VP_CORE_VLIMITTO_VDDMIN, |
| 103 | .vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX, |
| 104 | }; |