blob: 2385c1f009ee32338db1508a71863801dbd6e60c [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
Paul Walmsley72e06d02010-12-21 21:05:16 -070017#include "powerdomain.h"
Paul Walmsley6e014782010-12-21 20:01:20 -070018#include "powerdomains2xxx_3xxx_data.h"
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030019
20#include "prcm-common.h"
Paul Walmsley59fb6592010-12-21 15:30:55 -070021#include "prm2xxx_3xxx.h"
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030022#include "prm-regbits-24xx.h"
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030023
24/* 24XX powerdomains and dependencies */
25
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030026/* Powerdomains */
27
28static struct powerdomain dsp_pwrdm = {
29 .name = "dsp_pwrdm",
30 .prcm_offs = OMAP24XX_DSP_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030031 .pwrsts = PWRSTS_OFF_RET_ON,
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070032 .pwrsts_logic_ret = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030033 .banks = 1,
34 .pwrsts_mem_ret = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070035 [0] = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030036 },
37 .pwrsts_mem_on = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070038 [0] = PWRSTS_ON,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030039 },
Kevin Hilmanaae030f2011-03-23 16:09:41 -070040 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030041};
42
43static struct powerdomain mpu_24xx_pwrdm = {
44 .name = "mpu_pwrdm",
45 .prcm_offs = MPU_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030046 .pwrsts = PWRSTS_OFF_RET_ON,
47 .pwrsts_logic_ret = PWRSTS_OFF_RET,
48 .banks = 1,
49 .pwrsts_mem_ret = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070050 [0] = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030051 },
52 .pwrsts_mem_on = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070053 [0] = PWRSTS_ON,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030054 },
Kevin Hilmanaae030f2011-03-23 16:09:41 -070055 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030056};
57
58static struct powerdomain core_24xx_pwrdm = {
59 .name = "core_pwrdm",
60 .prcm_offs = CORE_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030061 .pwrsts = PWRSTS_OFF_RET_ON,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030062 .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 Hilmanaae030f2011-03-23 16:09:41 -070073 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030074};
75
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030076
77/*
78 * 2430-specific powerdomains
79 */
80
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030081/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
82
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030083static struct powerdomain mdm_pwrdm = {
84 .name = "mdm_pwrdm",
85 .prcm_offs = OMAP2430_MDM_MOD,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030086 .pwrsts = PWRSTS_OFF_RET_ON,
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070087 .pwrsts_logic_ret = PWRSTS_RET,
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030088 .banks = 1,
89 .pwrsts_mem_ret = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070090 [0] = PWRSTS_RET, /* MEMRETSTATE */
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030091 },
92 .pwrsts_mem_on = {
Paul Walmsley4cb49fe2011-03-07 19:28:15 -070093 [0] = PWRSTS_ON, /* MEMONSTATE */
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030094 },
Kevin Hilmanaae030f2011-03-23 16:09:41 -070095 .voltdm = { .name = "core" },
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +030096};
97
Paul Walmsley81794882011-09-14 11:34:21 -060098/*
99 *
100 */
Paul Walmsleyfe6a58f2008-08-19 11:08:42 +0300101
Paul Walmsley81794882011-09-14 11:34:21 -0600102static struct powerdomain *powerdomains_omap24xx[] __initdata = {
Paul Walmsley6e014782010-12-21 20:01:20 -0700103 &wkup_omap2_pwrdm,
104 &gfx_omap2_pwrdm,
Paul Walmsley6e014782010-12-21 20:01:20 -0700105 &dsp_pwrdm,
106 &mpu_24xx_pwrdm,
107 &core_24xx_pwrdm,
Paul Walmsley6e014782010-12-21 20:01:20 -0700108 NULL
109};
110
Paul Walmsley81794882011-09-14 11:34:21 -0600111static struct powerdomain *powerdomains_omap2430[] __initdata = {
112 &mdm_pwrdm,
113 NULL
114};
115
116void __init omap242x_powerdomains_init(void)
Paul Walmsley6e014782010-12-21 20:01:20 -0700117{
Paul Walmsley81794882011-09-14 11:34:21 -0600118 if (!cpu_is_omap2420())
119 return;
120
Paul Walmsley129c65e2011-09-14 16:01:21 -0600121 pwrdm_register_platform_funcs(&omap2_pwrdm_operations);
Paul Walmsley81794882011-09-14 11:34:21 -0600122 pwrdm_register_pwrdms(powerdomains_omap24xx);
123 pwrdm_complete_init();
124}
125
126void __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 Walmsley129c65e2011-09-14 16:01:21 -0600134 pwrdm_complete_init();
Paul Walmsley6e014782010-12-21 20:01:20 -0700135}