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