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 | }, |
| 40 | }; |
| 41 | |
| 42 | static struct powerdomain mpu_24xx_pwrdm = { |
| 43 | .name = "mpu_pwrdm", |
| 44 | .prcm_offs = MPU_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 45 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 46 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 47 | .banks = 1, |
| 48 | .pwrsts_mem_ret = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 49 | [0] = PWRSTS_RET, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 50 | }, |
| 51 | .pwrsts_mem_on = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 52 | [0] = PWRSTS_ON, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 53 | }, |
| 54 | }; |
| 55 | |
| 56 | static struct powerdomain core_24xx_pwrdm = { |
| 57 | .name = "core_pwrdm", |
| 58 | .prcm_offs = CORE_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 59 | .pwrsts = PWRSTS_OFF_RET_ON, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 60 | .banks = 3, |
| 61 | .pwrsts_mem_ret = { |
| 62 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ |
| 63 | [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ |
| 64 | [2] = PWRSTS_OFF_RET, /* MEM3RETSTATE */ |
| 65 | }, |
| 66 | .pwrsts_mem_on = { |
| 67 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ |
| 68 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ |
| 69 | [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ |
| 70 | }, |
| 71 | }; |
| 72 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 73 | |
| 74 | /* |
| 75 | * 2430-specific powerdomains |
| 76 | */ |
| 77 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 78 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
| 79 | |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 80 | static struct powerdomain mdm_pwrdm = { |
| 81 | .name = "mdm_pwrdm", |
| 82 | .prcm_offs = OMAP2430_MDM_MOD, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 83 | .pwrsts = PWRSTS_OFF_RET_ON, |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 84 | .pwrsts_logic_ret = PWRSTS_RET, |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 85 | .banks = 1, |
| 86 | .pwrsts_mem_ret = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 87 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 88 | }, |
| 89 | .pwrsts_mem_on = { |
Paul Walmsley | 4cb49fe | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 90 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 91 | }, |
| 92 | }; |
| 93 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame^] | 94 | /* |
| 95 | * |
| 96 | */ |
Paul Walmsley | fe6a58f | 2008-08-19 11:08:42 +0300 | [diff] [blame] | 97 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame^] | 98 | static struct powerdomain *powerdomains_omap24xx[] __initdata = { |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 99 | &wkup_omap2_pwrdm, |
| 100 | &gfx_omap2_pwrdm, |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 101 | &dsp_pwrdm, |
| 102 | &mpu_24xx_pwrdm, |
| 103 | &core_24xx_pwrdm, |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 104 | NULL |
| 105 | }; |
| 106 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame^] | 107 | static struct powerdomain *powerdomains_omap2430[] __initdata = { |
| 108 | &mdm_pwrdm, |
| 109 | NULL |
| 110 | }; |
| 111 | |
| 112 | void __init omap242x_powerdomains_init(void) |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 113 | { |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame^] | 114 | if (!cpu_is_omap2420()) |
| 115 | return; |
| 116 | |
Paul Walmsley | 129c65e | 2011-09-14 16:01:21 -0600 | [diff] [blame] | 117 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame^] | 118 | pwrdm_register_pwrdms(powerdomains_omap24xx); |
| 119 | pwrdm_complete_init(); |
| 120 | } |
| 121 | |
| 122 | void __init omap243x_powerdomains_init(void) |
| 123 | { |
| 124 | if (!cpu_is_omap2430()) |
| 125 | return; |
| 126 | |
| 127 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); |
| 128 | pwrdm_register_pwrdms(powerdomains_omap24xx); |
| 129 | pwrdm_register_pwrdms(powerdomains_omap2430); |
Paul Walmsley | 129c65e | 2011-09-14 16:01:21 -0600 | [diff] [blame] | 130 | pwrdm_complete_init(); |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 131 | } |