2020-01-18 20:49:00 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
2016-04-20 20:02:38 +08:00
|
|
|
* Renesas R-Car System Controller
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Glider bvba
|
|
|
|
*/
|
|
|
|
#ifndef __SOC_RENESAS_RCAR_SYSC_H__
|
|
|
|
#define __SOC_RENESAS_RCAR_SYSC_H__
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Power Domain flags
|
|
|
|
*/
|
|
|
|
#define PD_CPU BIT(0) /* Area contains main CPU core */
|
|
|
|
#define PD_SCU BIT(1) /* Area contains SCU and L2 cache */
|
|
|
|
#define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */
|
|
|
|
|
|
|
|
#define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */
|
|
|
|
#define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */
|
|
|
|
#define PD_ALWAYS_ON PD_NO_CR /* Always-on area */
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Description of a Power Area
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct rcar_sysc_area {
|
|
|
|
const char *name;
|
|
|
|
u16 chan_offs; /* Offset of PWRSR register for this area */
|
|
|
|
u8 chan_bit; /* Bit in PWR* (except for PWRUP in PWRSR) */
|
|
|
|
u8 isr_bit; /* Bit in SYSCI*R */
|
2022-06-08 23:14:21 +08:00
|
|
|
s8 parent; /* -1 if none */
|
|
|
|
u8 flags; /* See PD_* */
|
2016-04-20 20:02:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SoC-specific Power Area Description
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct rcar_sysc_info {
|
2017-03-31 17:01:55 +08:00
|
|
|
int (*init)(void); /* Optional */
|
2016-04-20 20:02:38 +08:00
|
|
|
const struct rcar_sysc_area *areas;
|
|
|
|
unsigned int num_areas;
|
2019-08-28 19:36:12 +08:00
|
|
|
/* Optional External Request Mask Register */
|
|
|
|
u32 extmask_offs; /* SYSCEXTMASK register offset */
|
|
|
|
u32 extmask_val; /* SYSCEXTMASK register mask value */
|
2016-04-20 20:02:38 +08:00
|
|
|
};
|
|
|
|
|
2020-04-24 05:40:43 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7742_sysc_info;
|
2016-10-06 05:35:01 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7743_sysc_info;
|
2016-11-05 05:46:13 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7745_sysc_info;
|
2018-03-29 03:26:09 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77470_sysc_info;
|
2018-08-02 22:53:19 +08:00
|
|
|
extern const struct rcar_sysc_info r8a774a1_sysc_info;
|
2019-09-23 15:29:40 +08:00
|
|
|
extern const struct rcar_sysc_info r8a774b1_sysc_info;
|
2018-09-10 22:41:27 +08:00
|
|
|
extern const struct rcar_sysc_info r8a774c0_sysc_info;
|
2020-07-08 00:18:05 +08:00
|
|
|
extern const struct rcar_sysc_info r8a774e1_sysc_info;
|
2016-04-20 20:02:41 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7779_sysc_info;
|
2016-04-20 20:02:42 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7790_sysc_info;
|
2016-04-20 20:02:43 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7791_sysc_info;
|
2016-06-13 04:56:50 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7792_sysc_info;
|
2016-04-20 20:02:45 +08:00
|
|
|
extern const struct rcar_sysc_info r8a7794_sysc_info;
|
2019-08-28 19:36:13 +08:00
|
|
|
extern struct rcar_sysc_info r8a7795_sysc_info;
|
2019-10-23 20:33:37 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77960_sysc_info;
|
|
|
|
extern const struct rcar_sysc_info r8a77961_sysc_info;
|
2018-02-20 23:12:06 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77965_sysc_info;
|
2017-09-13 04:37:20 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77970_sysc_info;
|
2018-02-17 02:28:02 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77980_sysc_info;
|
2018-05-15 20:07:38 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77990_sysc_info;
|
2017-07-20 20:34:53 +08:00
|
|
|
extern const struct rcar_sysc_info r8a77995_sysc_info;
|
2017-03-31 17:01:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Helpers for fixing up power area tables depending on SoC revision
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern void rcar_sysc_nullify(struct rcar_sysc_area *areas,
|
|
|
|
unsigned int num_areas, u8 id);
|
|
|
|
|
2016-04-20 20:02:38 +08:00
|
|
|
#endif /* __SOC_RENESAS_RCAR_SYSC_H__ */
|