Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 1 | /* |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 2 | * OMAP2XXX powerdomain definitions |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 3 | * |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 4 | * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc. |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 6 | * |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 7 | * Paul Walmsley, Jouni Högander |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | */ |
| 13 | |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 16 | |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 17 | #include "powerdomain.h" |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 18 | #include "powerdomains2xxx_3xxx_data.h" |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 19 | |
| 20 | #include "prcm-common.h" |
Paul Walmsley | 59fb659 | 2010-12-21 15:30:55 -0700 | [diff] [blame] | 21 | #include "prm2xxx_3xxx.h" |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 22 | #include "prm-regbits-24xx.h" |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 23 | |
| 24 | /* 24XX powerdomains and dependencies */ |
| 25 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 26 | /* Powerdomains */ |
| 27 | |
| 28 | static struct powerdomain dsp_pwrdm = { |
| 29 | .name = "dsp_pwrdm", |
| 30 | .prcm_offs = OMAP24XX_DSP_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 31 | .pwrsts = PWRSTS_OFF_RET_ON, |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 32 | .pwrsts_logic_ret = PWRSTS_RET, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 33 | .banks = 1, |
| 34 | .pwrsts_mem_ret = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 35 | [0] = PWRSTS_RET, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 36 | }, |
| 37 | .pwrsts_mem_on = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 38 | [0] = PWRSTS_ON, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 39 | }, |
Kevin Hilman | aae030f | 2011-03-23 16:09:41 -0700 | [diff] [blame] | 40 | .voltdm = { .name = "core" }, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | static struct powerdomain mpu_24xx_pwrdm = { |
| 44 | .name = "mpu_pwrdm", |
| 45 | .prcm_offs = MPU_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 46 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 47 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 48 | .banks = 1, |
| 49 | .pwrsts_mem_ret = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 50 | [0] = PWRSTS_RET, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 51 | }, |
| 52 | .pwrsts_mem_on = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 53 | [0] = PWRSTS_ON, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 54 | }, |
Kevin Hilman | aae030f | 2011-03-23 16:09:41 -0700 | [diff] [blame] | 55 | .voltdm = { .name = "core" }, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | static struct powerdomain core_24xx_pwrdm = { |
| 59 | .name = "core_pwrdm", |
| 60 | .prcm_offs = CORE_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 61 | .pwrsts = PWRSTS_OFF_RET_ON, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 62 | .banks = 3, |
| 63 | .pwrsts_mem_ret = { |
| 64 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ |
| 65 | [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ |
| 66 | [2] = PWRSTS_OFF_RET, /* MEM3RETSTATE */ |
| 67 | }, |
| 68 | .pwrsts_mem_on = { |
| 69 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ |
| 70 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ |
| 71 | [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ |
| 72 | }, |
Kevin Hilman | aae030f | 2011-03-23 16:09:41 -0700 | [diff] [blame] | 73 | .voltdm = { .name = "core" }, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 74 | }; |
| 75 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 76 | |
| 77 | /* |
| 78 | * 2430-specific powerdomains |
| 79 | */ |
| 80 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 81 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
| 82 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 83 | static struct powerdomain mdm_pwrdm = { |
| 84 | .name = "mdm_pwrdm", |
| 85 | .prcm_offs = OMAP2430_MDM_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 86 | .pwrsts = PWRSTS_OFF_RET_ON, |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 87 | .pwrsts_logic_ret = PWRSTS_RET, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 88 | .banks = 1, |
| 89 | .pwrsts_mem_ret = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 90 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 91 | }, |
| 92 | .pwrsts_mem_on = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 93 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 94 | }, |
Kevin Hilman | aae030f | 2011-03-23 16:09:41 -0700 | [diff] [blame] | 95 | .voltdm = { .name = "core" }, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 96 | }; |
| 97 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 98 | /* |
| 99 | * |
| 100 | */ |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 101 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 102 | static struct powerdomain *powerdomains_omap24xx[] __initdata = { |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 103 | &wkup_omap2_pwrdm, |
| 104 | &gfx_omap2_pwrdm, |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 105 | &dsp_pwrdm, |
| 106 | &mpu_24xx_pwrdm, |
| 107 | &core_24xx_pwrdm, |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 108 | NULL |
| 109 | }; |
| 110 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 111 | static struct powerdomain *powerdomains_omap2430[] __initdata = { |
| 112 | &mdm_pwrdm, |
| 113 | NULL |
| 114 | }; |
| 115 | |
| 116 | void __init omap242x_powerdomains_init(void) |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 117 | { |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 118 | if (!cpu_is_omap2420()) |
| 119 | return; |
| 120 | |
Paul Walmsley | 129c65e | 2011-09-14 16:01:21 -0600 | [diff] [blame] | 121 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 122 | pwrdm_register_pwrdms(powerdomains_omap24xx); |
| 123 | pwrdm_complete_init(); |
| 124 | } |
| 125 | |
| 126 | void __init omap243x_powerdomains_init(void) |
| 127 | { |
| 128 | if (!cpu_is_omap2430()) |
| 129 | return; |
| 130 | |
| 131 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); |
| 132 | pwrdm_register_pwrdms(powerdomains_omap24xx); |
| 133 | pwrdm_register_pwrdms(powerdomains_omap2430); |
Paul Walmsley | 129c65e | 2011-09-14 16:01:21 -0600 | [diff] [blame] | 134 | pwrdm_complete_init(); |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 135 | } |