]> git.ipfire.org Git - people/ms/linux.git/blame - arch/arm/mach-omap2/powerdomains43xx_data.c
Importing "grsecurity-3.1-3.19.2-201503201903.patch"
[people/ms/linux.git] / arch / arm / mach-omap2 / powerdomains43xx_data.c
CommitLineData
eadc62fc
A
1/*
2 * AM43xx Power domains framework
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
63d9c273 13#include <asm/pgtable.h>
eadc62fc
A
14
15#include "powerdomain.h"
16
17#include "prcm-common.h"
18#include "prcm44xx.h"
19#include "prcm43xx.h"
20
21static struct powerdomain gfx_43xx_pwrdm = {
22 .name = "gfx_pwrdm",
23 .voltdm = { .name = "core" },
24 .prcm_offs = AM43XX_PRM_GFX_INST,
25 .prcm_partition = AM43XX_PRM_PARTITION,
26 .pwrsts = PWRSTS_OFF_ON,
27 .banks = 1,
28 .pwrsts_mem_on = {
29 [0] = PWRSTS_ON, /* gfx_mem */
30 },
31 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
32};
33
34static struct powerdomain mpu_43xx_pwrdm = {
35 .name = "mpu_pwrdm",
36 .voltdm = { .name = "mpu" },
37 .prcm_offs = AM43XX_PRM_MPU_INST,
38 .prcm_partition = AM43XX_PRM_PARTITION,
39 .pwrsts = PWRSTS_OFF_RET_ON,
40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
41 .banks = 3,
42 .pwrsts_mem_ret = {
43 [0] = PWRSTS_OFF_RET, /* mpu_l1 */
44 [1] = PWRSTS_OFF_RET, /* mpu_l2 */
45 [2] = PWRSTS_OFF_RET, /* mpu_ram */
46 },
47 .pwrsts_mem_on = {
48 [0] = PWRSTS_ON, /* mpu_l1 */
49 [1] = PWRSTS_ON, /* mpu_l2 */
50 [2] = PWRSTS_ON, /* mpu_ram */
51 },
52 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
53};
54
55static struct powerdomain rtc_43xx_pwrdm = {
56 .name = "rtc_pwrdm",
57 .voltdm = { .name = "rtc" },
58 .prcm_offs = AM43XX_PRM_RTC_INST,
59 .prcm_partition = AM43XX_PRM_PARTITION,
60 .pwrsts = PWRSTS_ON,
61};
62
63static struct powerdomain wkup_43xx_pwrdm = {
64 .name = "wkup_pwrdm",
65 .voltdm = { .name = "core" },
66 .prcm_offs = AM43XX_PRM_WKUP_INST,
67 .prcm_partition = AM43XX_PRM_PARTITION,
68 .pwrsts = PWRSTS_ON,
69 .banks = 1,
70 .pwrsts_mem_on = {
71 [0] = PWRSTS_ON, /* debugss_mem */
72 },
73};
74
75static struct powerdomain tamper_43xx_pwrdm = {
76 .name = "tamper_pwrdm",
77 .voltdm = { .name = "tamper" },
78 .prcm_offs = AM43XX_PRM_TAMPER_INST,
79 .prcm_partition = AM43XX_PRM_PARTITION,
80 .pwrsts = PWRSTS_ON,
81};
82
83static struct powerdomain cefuse_43xx_pwrdm = {
84 .name = "cefuse_pwrdm",
85 .voltdm = { .name = "core" },
86 .prcm_offs = AM43XX_PRM_CEFUSE_INST,
87 .prcm_partition = AM43XX_PRM_PARTITION,
88 .pwrsts = PWRSTS_OFF_ON,
89 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
90};
91
92static struct powerdomain per_43xx_pwrdm = {
93 .name = "per_pwrdm",
94 .voltdm = { .name = "core" },
95 .prcm_offs = AM43XX_PRM_PER_INST,
96 .prcm_partition = AM43XX_PRM_PARTITION,
97 .pwrsts = PWRSTS_OFF_RET_ON,
98 .pwrsts_logic_ret = PWRSTS_OFF_RET,
99 .banks = 4,
100 .pwrsts_mem_ret = {
101 [0] = PWRSTS_OFF_RET, /* icss_mem */
102 [1] = PWRSTS_OFF_RET, /* per_mem */
103 [2] = PWRSTS_OFF_RET, /* ram1_mem */
104 [3] = PWRSTS_OFF_RET, /* ram2_mem */
105 },
106 .pwrsts_mem_on = {
107 [0] = PWRSTS_ON, /* icss_mem */
108 [1] = PWRSTS_ON, /* per_mem */
109 [2] = PWRSTS_ON, /* ram1_mem */
110 [3] = PWRSTS_ON, /* ram2_mem */
111 },
112 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
113};
114
115static struct powerdomain *powerdomains_am43xx[] __initdata = {
116 &gfx_43xx_pwrdm,
117 &mpu_43xx_pwrdm,
118 &rtc_43xx_pwrdm,
119 &wkup_43xx_pwrdm,
120 &tamper_43xx_pwrdm,
121 &cefuse_43xx_pwrdm,
122 &per_43xx_pwrdm,
123 NULL
124};
125
126static int am43xx_check_vcvp(void)
127{
128 return 0;
129}
130
131void __init am43xx_powerdomains_init(void)
132{
63d9c273
MT
133 pax_open_kernel();
134 *(void **)&omap4_pwrdm_operations.pwrdm_has_voltdm = am43xx_check_vcvp;
135 pax_close_kernel();
eadc62fc
A
136 pwrdm_register_platform_funcs(&omap4_pwrdm_operations);
137 pwrdm_register_pwrdms(powerdomains_am43xx);
138 pwrdm_complete_init();
139}