Commit | Line | Data |
---|---|---|
41c4567c KM |
1 | /* SPDX-License-Identifier: GPL-2.0 |
2 | * | |
dcc09fd1 GU |
3 | * Renesas R-Car System Controller |
4 | * | |
5 | * Copyright (C) 2016 Glider bvba | |
dcc09fd1 GU |
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 | ||
dcc09fd1 GU |
20 | #define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */ |
21 | #define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */ | |
22 | #define PD_ALWAYS_ON PD_NO_CR /* Always-on area */ | |
23 | ||
24 | ||
25 | /* | |
26 | * Description of a Power Area | |
27 | */ | |
28 | ||
29 | struct rcar_sysc_area { | |
30 | const char *name; | |
31 | u16 chan_offs; /* Offset of PWRSR register for this area */ | |
32 | u8 chan_bit; /* Bit in PWR* (except for PWRUP in PWRSR) */ | |
33 | u8 isr_bit; /* Bit in SYSCI*R */ | |
34 | int parent; /* -1 if none */ | |
35 | unsigned int flags; /* See PD_* */ | |
36 | }; | |
37 | ||
38 | ||
39 | /* | |
40 | * SoC-specific Power Area Description | |
41 | */ | |
42 | ||
43 | struct rcar_sysc_info { | |
afa6f53d | 44 | int (*init)(void); /* Optional */ |
dcc09fd1 GU |
45 | const struct rcar_sysc_area *areas; |
46 | unsigned int num_areas; | |
47 | }; | |
48 | ||
603311ba | 49 | extern const struct rcar_sysc_info r8a7743_sysc_info; |
141723e0 | 50 | extern const struct rcar_sysc_info r8a7745_sysc_info; |
964f7c0d | 51 | extern const struct rcar_sysc_info r8a77470_sysc_info; |
7f0e99cc | 52 | extern const struct rcar_sysc_info r8a774a1_sysc_info; |
f37d211c | 53 | extern const struct rcar_sysc_info r8a774c0_sysc_info; |
9b83ea17 | 54 | extern const struct rcar_sysc_info r8a7779_sysc_info; |
ad7c9dbc | 55 | extern const struct rcar_sysc_info r8a7790_sysc_info; |
c5fbb3c0 | 56 | extern const struct rcar_sysc_info r8a7791_sysc_info; |
7e49c845 | 57 | extern const struct rcar_sysc_info r8a7792_sysc_info; |
9af1dbcc | 58 | extern const struct rcar_sysc_info r8a7794_sysc_info; |
23f1e2ec | 59 | extern const struct rcar_sysc_info r8a7795_sysc_info; |
e0c98b91 | 60 | extern const struct rcar_sysc_info r8a7796_sysc_info; |
a527709b | 61 | extern const struct rcar_sysc_info r8a77965_sysc_info; |
bab9b2a7 | 62 | extern const struct rcar_sysc_info r8a77970_sysc_info; |
41d6d8bd | 63 | extern const struct rcar_sysc_info r8a77980_sysc_info; |
44b12d43 | 64 | extern const struct rcar_sysc_info r8a77990_sysc_info; |
eed17c42 | 65 | extern const struct rcar_sysc_info r8a77995_sysc_info; |
afa6f53d GU |
66 | |
67 | ||
68 | /* | |
69 | * Helpers for fixing up power area tables depending on SoC revision | |
70 | */ | |
71 | ||
72 | extern void rcar_sysc_nullify(struct rcar_sysc_area *areas, | |
73 | unsigned int num_areas, u8 id); | |
74 | ||
dcc09fd1 | 75 | #endif /* __SOC_RENESAS_RCAR_SYSC_H__ */ |