blob: 578eef86fcf2b514e5f98cf4190a808de456bb92 [file] [log] [blame]
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +03001/*
Paul Walmsley6e014782010-12-21 20:01:20 -07002 * OMAP2XXX powerdomain definitions
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +03003 *
Paul Walmsley81794882011-09-14 11:34:21 -06004 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
Paul Walmsley4cb49fe2011-03-07 19:28:15 -07005 * Copyright (C) 2007-2011 Nokia Corporation
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +03006 *
Paul Walmsley6e014782010-12-21 20:01:20 -07007 * Paul Walmsley, Jouni Högander
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +03008 *
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 Walmsley6e014782010-12-21 20:01:20 -070014#include <linux/kernel.h>
15#include <linux/init.h>
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030016
Tony Lindgrene4c060d2012-10-05 13:25:59 -070017#include "soc.h"
Paul Walmsley72e06d02010-12-21 21:05:16 -070018#include "powerdomain.h"
Paul Walmsley6e014782010-12-21 20:01:20 -070019#include "powerdomains2xxx_3xxx_data.h"
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030020
21#include "prcm-common.h"
Paul Walmsley59fb6592010-12-21 15:30:55 -070022#include "prm2xxx_3xxx.h"
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030023#include "prm-regbits-24xx.h"
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030024
25/* 24XX powerdomains and dependencies */
26
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030027/* Powerdomains */
28
29static struct powerdomain dsp_pwrdm = {
30 .name = "dsp_pwrdm",
31 .prcm_offs = OMAP24XX_DSP_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030032 .pwrsts = PWRSTS_OFF_RET_ON,
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070033 .pwrsts_logic_ret = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030034 .banks = 1,
35 .pwrsts_mem_ret = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070036 [0] = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030037 },
38 .pwrsts_mem_on = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070039 [0] = PWRSTS_ON,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030040 },
Paul Walmsley562e54d2013-01-26 00:58:17 -070041 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030042};
43
44static struct powerdomain mpu_24xx_pwrdm = {
45 .name = "mpu_pwrdm",
46 .prcm_offs = MPU_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030047 .pwrsts = PWRSTS_OFF_RET_ON,
48 .pwrsts_logic_ret = PWRSTS_OFF_RET,
49 .banks = 1,
50 .pwrsts_mem_ret = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070051 [0] = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030052 },
53 .pwrsts_mem_on = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070054 [0] = PWRSTS_ON,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030055 },
Paul Walmsley562e54d2013-01-26 00:58:17 -070056 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030057};
58
59static struct powerdomain core_24xx_pwrdm = {
60 .name = "core_pwrdm",
61 .prcm_offs = CORE_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030062 .pwrsts = PWRSTS_OFF_RET_ON,
Paul Walmsley8e1ff672013-01-26 00:58:12 -070063 .pwrsts_logic_ret = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030064 .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 Walmsley562e54d2013-01-26 00:58:17 -070075 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030076};
77
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030078
79/*
80 * 2430-specific powerdomains
81 */
82
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030083/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
84
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030085static struct powerdomain mdm_pwrdm = {
86 .name = "mdm_pwrdm",
87 .prcm_offs = OMAP2430_MDM_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030088 .pwrsts = PWRSTS_OFF_RET_ON,
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070089 .pwrsts_logic_ret = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030090 .banks = 1,
91 .pwrsts_mem_ret = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070092 [0] = PWRSTS_RET, /* MEMRETSTATE */
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030093 },
94 .pwrsts_mem_on = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070095 [0] = PWRSTS_ON, /* MEMONSTATE */
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030096 },
Paul Walmsley562e54d2013-01-26 00:58:17 -070097 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030098};
99
Paul Walmsley81794882011-09-14 11:34:21 -0600100/*
101 *
102 */
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +0300103
Paul Walmsley81794882011-09-14 11:34:21 -0600104static struct powerdomain *powerdomains_omap24xx[] __initdata = {
Paul Walmsley6e014782010-12-21 20:01:20 -0700105 &wkup_omap2_pwrdm,
106 &gfx_omap2_pwrdm,
Paul Walmsley6e014782010-12-21 20:01:20 -0700107 &dsp_pwrdm,
108 &mpu_24xx_pwrdm,
109 &core_24xx_pwrdm,
Paul Walmsley6e014782010-12-21 20:01:20 -0700110 NULL
111};
112
Paul Walmsley81794882011-09-14 11:34:21 -0600113static struct powerdomain *powerdomains_omap2430[] __initdata = {
114 &mdm_pwrdm,
115 NULL
116};
117
118void __init omap242x_powerdomains_init(void)
Paul Walmsley6e014782010-12-21 20:01:20 -0700119{
Paul Walmsley81794882011-09-14 11:34:21 -0600120 if (!cpu_is_omap2420())
121 return;
122
Paul Walmsley129c65e2011-09-14 16:01:21 -0600123 pwrdm_register_platform_funcs(&omap2_pwrdm_operations);
Paul Walmsley81794882011-09-14 11:34:21 -0600124 pwrdm_register_pwrdms(powerdomains_omap24xx);
125 pwrdm_complete_init();
126}
127
128void __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 Walmsley129c65e2011-09-14 16:01:21 -0600136 pwrdm_complete_init();
Paul Walmsley6e014782010-12-21 20:01:20 -0700137}