Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * OMAP3 voltage domain 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 | #include <linux/kernel.h> |
| 18 | #include <linux/err.h> |
| 19 | #include <linux/init.h> |
| 20 | |
| 21 | #include <plat/common.h> |
| 22 | #include <plat/cpu.h> |
| 23 | |
| 24 | #include "prm-regbits-34xx.h" |
| 25 | #include "omap_opp_data.h" |
| 26 | #include "voltage.h" |
| 27 | #include "vc.h" |
| 28 | #include "vp.h" |
| 29 | |
| 30 | /* |
| 31 | * VDD data |
| 32 | */ |
| 33 | |
| 34 | static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = { |
| 35 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, |
| 36 | .voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT, |
| 37 | .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK, |
| 38 | }; |
| 39 | |
| 40 | static struct omap_vdd_info omap3_vdd1_info = { |
Kevin Hilman | a7460daf | 2011-03-16 13:35:22 -0700 | [diff] [blame] | 41 | .prm_irqst_mod = OCP_MOD, |
Kevin Hilman | c39263c | 2011-03-16 17:20:35 -0700 | [diff] [blame] | 42 | .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 43 | .vp_data = &omap3_vp1_data, |
| 44 | .vc_data = &omap3_vc1_data, |
| 45 | .vfsm = &omap3_vdd1_vfsm_data, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = { |
| 49 | .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, |
| 50 | .voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT, |
| 51 | .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK, |
| 52 | }; |
| 53 | |
| 54 | static struct omap_vdd_info omap3_vdd2_info = { |
Kevin Hilman | a7460daf | 2011-03-16 13:35:22 -0700 | [diff] [blame] | 55 | .prm_irqst_mod = OCP_MOD, |
Kevin Hilman | c39263c | 2011-03-16 17:20:35 -0700 | [diff] [blame] | 56 | .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 57 | .vp_data = &omap3_vp2_data, |
| 58 | .vc_data = &omap3_vc2_data, |
| 59 | .vfsm = &omap3_vdd2_vfsm_data, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 60 | }; |
| 61 | |
Kevin Hilman | 81a6048 | 2011-03-16 14:25:45 -0700 | [diff] [blame^] | 62 | static struct voltagedomain omap3_voltdm_mpu = { |
| 63 | .name = "mpu", |
| 64 | .vdd = &omap3_vdd1_info, |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 65 | }; |
| 66 | |
Kevin Hilman | 81a6048 | 2011-03-16 14:25:45 -0700 | [diff] [blame^] | 67 | static struct voltagedomain omap3_voltdm_core = { |
| 68 | .name = "core", |
| 69 | .vdd = &omap3_vdd2_info, |
| 70 | }; |
| 71 | |
| 72 | static struct voltagedomain *voltagedomains_omap3[] __initdata = { |
| 73 | &omap3_voltdm_mpu, |
| 74 | &omap3_voltdm_core, |
| 75 | NULL, |
| 76 | }; |
| 77 | |
| 78 | void __init omap3xxx_voltagedomains_init(void) |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 79 | { |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 80 | /* |
| 81 | * XXX Will depend on the process, validation, and binning |
| 82 | * for the currently-running IC |
| 83 | */ |
| 84 | if (cpu_is_omap3630()) { |
| 85 | omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data; |
| 86 | omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data; |
| 87 | } else { |
| 88 | omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data; |
| 89 | omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data; |
| 90 | } |
| 91 | |
Kevin Hilman | 81a6048 | 2011-03-16 14:25:45 -0700 | [diff] [blame^] | 92 | voltdm_init(voltagedomains_omap3); |
Paul Walmsley | c0718df | 2011-03-10 22:17:45 -0700 | [diff] [blame] | 93 | }; |