blob: 52c25a5e2646c8392d2b7c3e3bb0fa1b71c2d27f [file] [log] [blame]
Magnus Damma6557eb2014-01-15 16:43:08 +09001/*
2 * R-Car SYSC Power management support
3 *
4 * Copyright (C) 2014 Magnus Damm
Geert Uytterhoevenafa6f532017-03-31 11:01:55 +02005 * Copyright (C) 2015-2017 Glider bvba
Magnus Damma6557eb2014-01-15 16:43:08 +09006 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
Geert Uytterhoeven1c8c77f2016-04-20 14:02:40 +020012#include <linux/clk/renesas.h>
Magnus Damma6557eb2014-01-15 16:43:08 +090013#include <linux/delay.h>
14#include <linux/err.h>
15#include <linux/mm.h>
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +020016#include <linux/of_address.h>
17#include <linux/pm_domain.h>
18#include <linux/slab.h>
Magnus Damma6557eb2014-01-15 16:43:08 +090019#include <linux/spinlock.h>
Dan Williams2584cf82015-08-10 23:07:05 -040020#include <linux/io.h>
Geert Uytterhoevenbe32bcb2016-04-20 14:02:36 +020021#include <linux/soc/renesas/rcar-sysc.h>
Magnus Damma6557eb2014-01-15 16:43:08 +090022
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +020023#include "rcar-sysc.h"
24
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020025/* SYSC Common */
26#define SYSCSR 0x00 /* SYSC Status Register */
27#define SYSCISR 0x04 /* Interrupt Status Register */
28#define SYSCISCR 0x08 /* Interrupt Status Clear Register */
29#define SYSCIER 0x0c /* Interrupt Enable Register */
30#define SYSCIMR 0x10 /* Interrupt Mask Register */
Magnus Damma6557eb2014-01-15 16:43:08 +090031
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020032/* SYSC Status Register */
33#define SYSCSR_PONENB 1 /* Ready for power resume requests */
34#define SYSCSR_POFFENB 0 /* Ready for power shutoff requests */
Magnus Damma6557eb2014-01-15 16:43:08 +090035
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020036/*
37 * Power Control Register Offsets inside the register block for each domain
38 * Note: The "CR" registers for ARM cores exist on H1 only
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +020039 * Use WFI to power off, CPG/APMU to resume ARM cores on R-Car Gen2
40 * Use PSCI on R-Car Gen3
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020041 */
42#define PWRSR_OFFS 0x00 /* Power Status Register */
43#define PWROFFCR_OFFS 0x04 /* Power Shutoff Control Register */
44#define PWROFFSR_OFFS 0x08 /* Power Shutoff Status Register */
45#define PWRONCR_OFFS 0x0c /* Power Resume Control Register */
46#define PWRONSR_OFFS 0x10 /* Power Resume Status Register */
47#define PWRER_OFFS 0x14 /* Power Shutoff/Resume Error */
Magnus Damma6557eb2014-01-15 16:43:08 +090048
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020049
50#define SYSCSR_RETRIES 100
51#define SYSCSR_DELAY_US 1
52
Geert Uytterhoeven2f575fc2015-06-04 20:22:29 +020053#define PWRER_RETRIES 100
54#define PWRER_DELAY_US 1
55
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020056#define SYSCISR_RETRIES 1000
57#define SYSCISR_DELAY_US 1
Magnus Damma6557eb2014-01-15 16:43:08 +090058
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +020059#define RCAR_PD_ALWAYS_ON 32 /* Always-on power area */
60
Magnus Dammc4ca5d82014-02-24 14:52:12 +090061static void __iomem *rcar_sysc_base;
Magnus Damma6557eb2014-01-15 16:43:08 +090062static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */
63
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +020064static int rcar_sysc_pwr_on_off(const struct rcar_sysc_ch *sysc_ch, bool on)
Magnus Damma6557eb2014-01-15 16:43:08 +090065{
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +020066 unsigned int sr_bit, reg_offs;
Magnus Damma6557eb2014-01-15 16:43:08 +090067 int k;
68
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +020069 if (on) {
70 sr_bit = SYSCSR_PONENB;
71 reg_offs = PWRONCR_OFFS;
72 } else {
73 sr_bit = SYSCSR_POFFENB;
74 reg_offs = PWROFFCR_OFFS;
75 }
76
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020077 /* Wait until SYSC is ready to accept a power request */
Magnus Damma6557eb2014-01-15 16:43:08 +090078 for (k = 0; k < SYSCSR_RETRIES; k++) {
Geert Uytterhoeven21437c52015-06-04 20:22:31 +020079 if (ioread32(rcar_sysc_base + SYSCSR) & BIT(sr_bit))
Magnus Damma6557eb2014-01-15 16:43:08 +090080 break;
81 udelay(SYSCSR_DELAY_US);
82 }
83
84 if (k == SYSCSR_RETRIES)
85 return -EAGAIN;
86
Geert Uytterhoeven577d1042015-06-04 20:22:27 +020087 /* Submit power shutoff or power resume request */
Geert Uytterhoeven21437c52015-06-04 20:22:31 +020088 iowrite32(BIT(sysc_ch->chan_bit),
Magnus Damma6557eb2014-01-15 16:43:08 +090089 rcar_sysc_base + sysc_ch->chan_offs + reg_offs);
90
91 return 0;
92}
93
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +020094static int rcar_sysc_power(const struct rcar_sysc_ch *sysc_ch, bool on)
Magnus Damma6557eb2014-01-15 16:43:08 +090095{
Geert Uytterhoeven21437c52015-06-04 20:22:31 +020096 unsigned int isr_mask = BIT(sysc_ch->isr_bit);
97 unsigned int chan_mask = BIT(sysc_ch->chan_bit);
Magnus Damma6557eb2014-01-15 16:43:08 +090098 unsigned int status;
99 unsigned long flags;
100 int ret = 0;
101 int k;
102
103 spin_lock_irqsave(&rcar_sysc_lock, flags);
104
105 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR);
106
Geert Uytterhoeven577d1042015-06-04 20:22:27 +0200107 /* Submit power shutoff or resume request until it was accepted */
Geert Uytterhoeven2f575fc2015-06-04 20:22:29 +0200108 for (k = 0; k < PWRER_RETRIES; k++) {
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +0200109 ret = rcar_sysc_pwr_on_off(sysc_ch, on);
Magnus Damma6557eb2014-01-15 16:43:08 +0900110 if (ret)
111 goto out;
112
113 status = ioread32(rcar_sysc_base +
114 sysc_ch->chan_offs + PWRER_OFFS);
Geert Uytterhoeven2f575fc2015-06-04 20:22:29 +0200115 if (!(status & chan_mask))
116 break;
117
118 udelay(PWRER_DELAY_US);
119 }
120
121 if (k == PWRER_RETRIES) {
122 ret = -EIO;
123 goto out;
124 }
Magnus Damma6557eb2014-01-15 16:43:08 +0900125
Geert Uytterhoeven577d1042015-06-04 20:22:27 +0200126 /* Wait until the power shutoff or resume request has completed * */
Magnus Damma6557eb2014-01-15 16:43:08 +0900127 for (k = 0; k < SYSCISR_RETRIES; k++) {
128 if (ioread32(rcar_sysc_base + SYSCISR) & isr_mask)
129 break;
130 udelay(SYSCISR_DELAY_US);
131 }
132
133 if (k == SYSCISR_RETRIES)
134 ret = -EIO;
135
136 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR);
137
138 out:
139 spin_unlock_irqrestore(&rcar_sysc_lock, flags);
140
Geert Uytterhoeven68667ce2016-04-20 14:02:37 +0200141 pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off",
Magnus Damma6557eb2014-01-15 16:43:08 +0900142 sysc_ch->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret);
143 return ret;
144}
145
Geert Uytterhoeven624deb32015-06-04 20:22:30 +0200146int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch)
Magnus Damma6557eb2014-01-15 16:43:08 +0900147{
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +0200148 return rcar_sysc_power(sysc_ch, false);
Magnus Damma6557eb2014-01-15 16:43:08 +0900149}
150
Geert Uytterhoeven624deb32015-06-04 20:22:30 +0200151int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch)
Magnus Damma6557eb2014-01-15 16:43:08 +0900152{
Geert Uytterhoevenbcb82432015-06-04 20:22:32 +0200153 return rcar_sysc_power(sysc_ch, true);
Magnus Damma6557eb2014-01-15 16:43:08 +0900154}
155
Geert Uytterhoeven2f024ce2016-04-20 14:02:39 +0200156static bool rcar_sysc_power_is_off(const struct rcar_sysc_ch *sysc_ch)
Magnus Damma6557eb2014-01-15 16:43:08 +0900157{
158 unsigned int st;
159
160 st = ioread32(rcar_sysc_base + sysc_ch->chan_offs + PWRSR_OFFS);
Geert Uytterhoeven21437c52015-06-04 20:22:31 +0200161 if (st & BIT(sysc_ch->chan_bit))
Magnus Damma6557eb2014-01-15 16:43:08 +0900162 return true;
163
164 return false;
165}
166
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200167struct rcar_sysc_pd {
168 struct generic_pm_domain genpd;
169 struct rcar_sysc_ch ch;
170 unsigned int flags;
171 char name[0];
172};
173
174static inline struct rcar_sysc_pd *to_rcar_pd(struct generic_pm_domain *d)
175{
176 return container_of(d, struct rcar_sysc_pd, genpd);
177}
178
179static int rcar_sysc_pd_power_off(struct generic_pm_domain *genpd)
180{
181 struct rcar_sysc_pd *pd = to_rcar_pd(genpd);
182
183 pr_debug("%s: %s\n", __func__, genpd->name);
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200184 return rcar_sysc_power_down(&pd->ch);
185}
186
187static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd)
188{
189 struct rcar_sysc_pd *pd = to_rcar_pd(genpd);
190
191 pr_debug("%s: %s\n", __func__, genpd->name);
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200192 return rcar_sysc_power_up(&pd->ch);
193}
194
Geert Uytterhoeven1c8c77f2016-04-20 14:02:40 +0200195static bool has_cpg_mstp;
196
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200197static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
198{
199 struct generic_pm_domain *genpd = &pd->genpd;
200 const char *name = pd->genpd.name;
201 struct dev_power_governor *gov = &simple_qos_governor;
202
203 if (pd->flags & PD_CPU) {
204 /*
205 * This domain contains a CPU core and therefore it should
206 * only be turned off if the CPU is not in use.
207 */
208 pr_debug("PM domain %s contains %s\n", name, "CPU");
Geert Uytterhoeven980532a2017-06-12 11:23:45 +0200209 genpd->flags |= GENPD_FLAG_ALWAYS_ON;
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200210 } else if (pd->flags & PD_SCU) {
211 /*
212 * This domain contains an SCU and cache-controller, and
213 * therefore it should only be turned off if the CPU cores are
214 * not in use.
215 */
216 pr_debug("PM domain %s contains %s\n", name, "SCU");
Geert Uytterhoeven980532a2017-06-12 11:23:45 +0200217 genpd->flags |= GENPD_FLAG_ALWAYS_ON;
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200218 } else if (pd->flags & PD_NO_CR) {
219 /*
220 * This domain cannot be turned off.
221 */
Geert Uytterhoeven980532a2017-06-12 11:23:45 +0200222 genpd->flags |= GENPD_FLAG_ALWAYS_ON;
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200223 }
224
Geert Uytterhoeven1c8c77f2016-04-20 14:02:40 +0200225 if (!(pd->flags & (PD_CPU | PD_SCU))) {
226 /* Enable Clock Domain for I/O devices */
Geert Uytterhoeven91c719f2017-11-09 14:27:02 +0100227 genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP;
Geert Uytterhoeven1c8c77f2016-04-20 14:02:40 +0200228 if (has_cpg_mstp) {
229 genpd->attach_dev = cpg_mstp_attach_dev;
230 genpd->detach_dev = cpg_mstp_detach_dev;
231 } else {
232 genpd->attach_dev = cpg_mssr_attach_dev;
233 genpd->detach_dev = cpg_mssr_detach_dev;
234 }
235 }
236
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200237 genpd->power_off = rcar_sysc_pd_power_off;
238 genpd->power_on = rcar_sysc_pd_power_on;
239
240 if (pd->flags & (PD_CPU | PD_NO_CR)) {
241 /* Skip CPUs (handled by SMP code) and areas without control */
242 pr_debug("%s: Not touching %s\n", __func__, genpd->name);
243 goto finalize;
244 }
245
246 if (!rcar_sysc_power_is_off(&pd->ch)) {
247 pr_debug("%s: %s is already powered\n", __func__, genpd->name);
248 goto finalize;
249 }
250
251 rcar_sysc_power_up(&pd->ch);
252
253finalize:
254 pm_genpd_init(genpd, gov, false);
255}
256
257static const struct of_device_id rcar_sysc_matches[] = {
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200258#ifdef CONFIG_SYSC_R8A7743
Sergei Shtylyov603311b2016-10-05 14:35:01 -0700259 { .compatible = "renesas,r8a7743-sysc", .data = &r8a7743_sysc_info },
260#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200261#ifdef CONFIG_SYSC_R8A7745
Sergei Shtylyov141723e2016-11-05 00:46:13 +0300262 { .compatible = "renesas,r8a7745-sysc", .data = &r8a7745_sysc_info },
263#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200264#ifdef CONFIG_SYSC_R8A7779
Geert Uytterhoeven9b83ea12016-04-20 14:02:41 +0200265 { .compatible = "renesas,r8a7779-sysc", .data = &r8a7779_sysc_info },
266#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200267#ifdef CONFIG_SYSC_R8A7790
Geert Uytterhoevenad7c9db2016-04-20 14:02:42 +0200268 { .compatible = "renesas,r8a7790-sysc", .data = &r8a7790_sysc_info },
269#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200270#ifdef CONFIG_SYSC_R8A7791
Geert Uytterhoevenc5fbb3c2016-04-20 14:02:43 +0200271 { .compatible = "renesas,r8a7791-sysc", .data = &r8a7791_sysc_info },
Geert Uytterhoevena247eb92016-04-20 14:02:44 +0200272 /* R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. */
273 { .compatible = "renesas,r8a7793-sysc", .data = &r8a7791_sysc_info },
274#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200275#ifdef CONFIG_SYSC_R8A7792
276 { .compatible = "renesas,r8a7792-sysc", .data = &r8a7792_sysc_info },
277#endif
278#ifdef CONFIG_SYSC_R8A7794
Geert Uytterhoeven9af1dbc2016-04-20 14:02:45 +0200279 { .compatible = "renesas,r8a7794-sysc", .data = &r8a7794_sysc_info },
280#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200281#ifdef CONFIG_SYSC_R8A7795
Geert Uytterhoeven23f1e2e2016-04-20 14:02:46 +0200282 { .compatible = "renesas,r8a7795-sysc", .data = &r8a7795_sysc_info },
283#endif
Geert Uytterhoeven8be381a2017-05-19 10:35:10 +0200284#ifdef CONFIG_SYSC_R8A7796
Geert Uytterhoevene0c98b92016-05-30 19:05:11 +0200285 { .compatible = "renesas,r8a7796-sysc", .data = &r8a7796_sysc_info },
286#endif
Sergei Shtylyovbab9b2a2017-09-12 23:37:20 +0300287#ifdef CONFIG_SYSC_R8A77970
288 { .compatible = "renesas,r8a77970-sysc", .data = &r8a77970_sysc_info },
289#endif
Geert Uytterhoeveneed17c42017-07-20 14:34:53 +0200290#ifdef CONFIG_SYSC_R8A77995
291 { .compatible = "renesas,r8a77995-sysc", .data = &r8a77995_sysc_info },
292#endif
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200293 { /* sentinel */ }
294};
295
296struct rcar_pm_domains {
297 struct genpd_onecell_data onecell_data;
298 struct generic_pm_domain *domains[RCAR_PD_ALWAYS_ON + 1];
299};
300
301static int __init rcar_sysc_pd_init(void)
302{
303 const struct rcar_sysc_info *info;
304 const struct of_device_id *match;
305 struct rcar_pm_domains *domains;
306 struct device_node *np;
307 u32 syscier, syscimr;
308 void __iomem *base;
309 unsigned int i;
310 int error;
311
Geert Uytterhoevenb1e52282016-06-28 16:10:32 +0200312 if (rcar_sysc_base)
313 return 0;
314
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200315 np = of_find_matching_node_and_match(NULL, rcar_sysc_matches, &match);
316 if (!np)
317 return -ENODEV;
318
319 info = match->data;
320
Geert Uytterhoevenafa6f532017-03-31 11:01:55 +0200321 if (info->init) {
322 error = info->init();
323 if (error)
324 return error;
325 }
326
Geert Uytterhoeven1c8c77f2016-04-20 14:02:40 +0200327 has_cpg_mstp = of_find_compatible_node(NULL, NULL,
328 "renesas,cpg-mstp-clocks");
329
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200330 base = of_iomap(np, 0);
331 if (!base) {
Rob Herring37c342c2017-07-18 16:43:29 -0500332 pr_warn("%pOF: Cannot map regs\n", np);
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200333 error = -ENOMEM;
334 goto out_put;
335 }
336
337 rcar_sysc_base = base;
338
339 domains = kzalloc(sizeof(*domains), GFP_KERNEL);
340 if (!domains) {
341 error = -ENOMEM;
342 goto out_put;
343 }
344
345 domains->onecell_data.domains = domains->domains;
346 domains->onecell_data.num_domains = ARRAY_SIZE(domains->domains);
347
348 for (i = 0, syscier = 0; i < info->num_areas; i++)
349 syscier |= BIT(info->areas[i].isr_bit);
350
351 /*
352 * Mask all interrupt sources to prevent the CPU from receiving them.
353 * Make sure not to clear reserved bits that were set before.
354 */
355 syscimr = ioread32(base + SYSCIMR);
356 syscimr |= syscier;
Rob Herring37c342c2017-07-18 16:43:29 -0500357 pr_debug("%pOF: syscimr = 0x%08x\n", np, syscimr);
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200358 iowrite32(syscimr, base + SYSCIMR);
359
360 /*
361 * SYSC needs all interrupt sources enabled to control power.
362 */
Rob Herring37c342c2017-07-18 16:43:29 -0500363 pr_debug("%pOF: syscier = 0x%08x\n", np, syscier);
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200364 iowrite32(syscier, base + SYSCIER);
365
366 for (i = 0; i < info->num_areas; i++) {
367 const struct rcar_sysc_area *area = &info->areas[i];
368 struct rcar_sysc_pd *pd;
369
Geert Uytterhoevenafa6f532017-03-31 11:01:55 +0200370 if (!area->name) {
371 /* Skip NULLified area */
372 continue;
373 }
374
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200375 pd = kzalloc(sizeof(*pd) + strlen(area->name) + 1, GFP_KERNEL);
376 if (!pd) {
377 error = -ENOMEM;
378 goto out_put;
379 }
380
381 strcpy(pd->name, area->name);
382 pd->genpd.name = pd->name;
383 pd->ch.chan_offs = area->chan_offs;
384 pd->ch.chan_bit = area->chan_bit;
385 pd->ch.isr_bit = area->isr_bit;
386 pd->flags = area->flags;
387
388 rcar_sysc_pd_setup(pd);
389 if (area->parent >= 0)
390 pm_genpd_add_subdomain(domains->domains[area->parent],
391 &pd->genpd);
392
393 domains->domains[area->isr_bit] = &pd->genpd;
394 }
395
Geert Uytterhoeven10235782016-06-28 16:10:31 +0200396 error = of_genpd_add_provider_onecell(np, &domains->onecell_data);
Geert Uytterhoevendcc09fd2016-04-20 14:02:38 +0200397
398out_put:
399 of_node_put(np);
400 return error;
401}
402early_initcall(rcar_sysc_pd_init);
Geert Uytterhoevenb1e52282016-06-28 16:10:32 +0200403
Geert Uytterhoevenafa6f532017-03-31 11:01:55 +0200404void __init rcar_sysc_nullify(struct rcar_sysc_area *areas,
405 unsigned int num_areas, u8 id)
406{
407 unsigned int i;
408
409 for (i = 0; i < num_areas; i++)
410 if (areas[i].isr_bit == id) {
411 areas[i].name = NULL;
412 return;
413 }
414}
415
Geert Uytterhoeven05323992016-06-28 16:10:33 +0200416void __init rcar_sysc_init(phys_addr_t base, u32 syscier)
Geert Uytterhoevenb1e52282016-06-28 16:10:32 +0200417{
Geert Uytterhoevenced42732016-06-28 16:10:34 +0200418 u32 syscimr;
419
Geert Uytterhoeven05323992016-06-28 16:10:33 +0200420 if (!rcar_sysc_pd_init())
421 return;
Geert Uytterhoevenb1e52282016-06-28 16:10:32 +0200422
Geert Uytterhoeven05323992016-06-28 16:10:33 +0200423 rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE);
424
Geert Uytterhoevenced42732016-06-28 16:10:34 +0200425 /*
426 * Mask all interrupt sources to prevent the CPU from receiving them.
427 * Make sure not to clear reserved bits that were set before.
428 */
429 syscimr = ioread32(rcar_sysc_base + SYSCIMR);
430 syscimr |= syscier;
431 pr_debug("%s: syscimr = 0x%08x\n", __func__, syscimr);
432 iowrite32(syscimr, rcar_sysc_base + SYSCIMR);
433
434 /*
435 * SYSC needs all interrupt sources enabled to control power.
436 */
437 pr_debug("%s: syscier = 0x%08x\n", __func__, syscier);
Geert Uytterhoeven05323992016-06-28 16:10:33 +0200438 iowrite32(syscier, rcar_sysc_base + SYSCIER);
Geert Uytterhoevenb1e52282016-06-28 16:10:32 +0200439}