xref: /linux/drivers/pmdomain/renesas/rcar-sysc.h (revision 6e7fd890f1d6ac83805409e9c346240de2705584)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Renesas R-Car System Controller
4  *
5  * Copyright (C) 2016 Glider bvba
6  */
7 #ifndef __SOC_RENESAS_RCAR_SYSC_H__
8 #define __SOC_RENESAS_RCAR_SYSC_H__
9 
10 #include <linux/types.h>
11 
12 
13 /*
14  * Power Domain flags
15  */
16 #define PD_CPU		BIT(0)	/* Area contains main CPU core */
17 #define PD_SCU		BIT(1)	/* Area contains SCU and L2 cache */
18 #define PD_NO_CR	BIT(2)	/* Area lacks PWR{ON,OFF}CR registers */
19 #define PD_OFF_DELAY	BIT(3)	/* Area is subject to power-off delay quirk */
20 
21 #define PD_CPU_CR	PD_CPU		  /* CPU area has CR (R-Car H1) */
22 #define PD_CPU_NOCR	PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */
23 #define PD_ALWAYS_ON	PD_NO_CR	  /* Always-on area */
24 
25 
26 /*
27  * Description of a Power Area
28  */
29 
30 struct rcar_sysc_area {
31 	const char *name;
32 	u16 chan_offs;		/* Offset of PWRSR register for this area */
33 	u8 chan_bit;		/* Bit in PWR* (except for PWRUP in PWRSR) */
34 	u8 isr_bit;		/* Bit in SYSCI*R */
35 	s8 parent;		/* -1 if none */
36 	u8 flags;		/* See PD_* */
37 };
38 
39 
40 /*
41  * SoC-specific Power Area Description
42  */
43 
44 struct rcar_sysc_info {
45 	int (*init)(void);	/* Optional */
46 	const struct rcar_sysc_area *areas;
47 	unsigned int num_areas;
48 	/* Optional External Request Mask Register */
49 	u32 extmask_offs;	/* SYSCEXTMASK register offset */
50 	u32 extmask_val;	/* SYSCEXTMASK register mask value */
51 };
52 
53 extern const struct rcar_sysc_info r8a7742_sysc_info;
54 extern const struct rcar_sysc_info r8a7743_sysc_info;
55 extern const struct rcar_sysc_info r8a7745_sysc_info;
56 extern const struct rcar_sysc_info r8a77470_sysc_info;
57 extern const struct rcar_sysc_info r8a774a1_sysc_info;
58 extern const struct rcar_sysc_info r8a774b1_sysc_info;
59 extern const struct rcar_sysc_info r8a774c0_sysc_info;
60 extern const struct rcar_sysc_info r8a774e1_sysc_info;
61 extern const struct rcar_sysc_info r8a7779_sysc_info;
62 extern const struct rcar_sysc_info r8a7790_sysc_info;
63 extern const struct rcar_sysc_info r8a7791_sysc_info;
64 extern const struct rcar_sysc_info r8a7792_sysc_info;
65 extern const struct rcar_sysc_info r8a7794_sysc_info;
66 extern struct rcar_sysc_info r8a7795_sysc_info;
67 extern const struct rcar_sysc_info r8a77960_sysc_info;
68 extern const struct rcar_sysc_info r8a77961_sysc_info;
69 extern const struct rcar_sysc_info r8a77965_sysc_info;
70 extern const struct rcar_sysc_info r8a77970_sysc_info;
71 extern const struct rcar_sysc_info r8a77980_sysc_info;
72 extern const struct rcar_sysc_info r8a77990_sysc_info;
73 extern const struct rcar_sysc_info r8a77995_sysc_info;
74 
75 #endif /* __SOC_RENESAS_RCAR_SYSC_H__ */
76