Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Renesas R-Car System Controller
0004  *
0005  * Copyright (C) 2016 Glider bvba
0006  */
0007 #ifndef __SOC_RENESAS_RCAR_SYSC_H__
0008 #define __SOC_RENESAS_RCAR_SYSC_H__
0009 
0010 #include <linux/types.h>
0011 
0012 
0013 /*
0014  * Power Domain flags
0015  */
0016 #define PD_CPU      BIT(0)  /* Area contains main CPU core */
0017 #define PD_SCU      BIT(1)  /* Area contains SCU and L2 cache */
0018 #define PD_NO_CR    BIT(2)  /* Area lacks PWR{ON,OFF}CR registers */
0019 
0020 #define PD_CPU_CR   PD_CPU        /* CPU area has CR (R-Car H1) */
0021 #define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */
0022 #define PD_ALWAYS_ON    PD_NO_CR      /* Always-on area */
0023 
0024 
0025 /*
0026  * Description of a Power Area
0027  */
0028 
0029 struct rcar_sysc_area {
0030     const char *name;
0031     u16 chan_offs;      /* Offset of PWRSR register for this area */
0032     u8 chan_bit;        /* Bit in PWR* (except for PWRUP in PWRSR) */
0033     u8 isr_bit;     /* Bit in SYSCI*R */
0034     s8 parent;      /* -1 if none */
0035     u8 flags;       /* See PD_* */
0036 };
0037 
0038 
0039 /*
0040  * SoC-specific Power Area Description
0041  */
0042 
0043 struct rcar_sysc_info {
0044     int (*init)(void);  /* Optional */
0045     const struct rcar_sysc_area *areas;
0046     unsigned int num_areas;
0047     /* Optional External Request Mask Register */
0048     u32 extmask_offs;   /* SYSCEXTMASK register offset */
0049     u32 extmask_val;    /* SYSCEXTMASK register mask value */
0050 };
0051 
0052 extern const struct rcar_sysc_info r8a7742_sysc_info;
0053 extern const struct rcar_sysc_info r8a7743_sysc_info;
0054 extern const struct rcar_sysc_info r8a7745_sysc_info;
0055 extern const struct rcar_sysc_info r8a77470_sysc_info;
0056 extern const struct rcar_sysc_info r8a774a1_sysc_info;
0057 extern const struct rcar_sysc_info r8a774b1_sysc_info;
0058 extern const struct rcar_sysc_info r8a774c0_sysc_info;
0059 extern const struct rcar_sysc_info r8a774e1_sysc_info;
0060 extern const struct rcar_sysc_info r8a7779_sysc_info;
0061 extern const struct rcar_sysc_info r8a7790_sysc_info;
0062 extern const struct rcar_sysc_info r8a7791_sysc_info;
0063 extern const struct rcar_sysc_info r8a7792_sysc_info;
0064 extern const struct rcar_sysc_info r8a7794_sysc_info;
0065 extern struct rcar_sysc_info r8a7795_sysc_info;
0066 extern const struct rcar_sysc_info r8a77960_sysc_info;
0067 extern const struct rcar_sysc_info r8a77961_sysc_info;
0068 extern const struct rcar_sysc_info r8a77965_sysc_info;
0069 extern const struct rcar_sysc_info r8a77970_sysc_info;
0070 extern const struct rcar_sysc_info r8a77980_sysc_info;
0071 extern const struct rcar_sysc_info r8a77990_sysc_info;
0072 extern const struct rcar_sysc_info r8a77995_sysc_info;
0073 
0074 
0075     /*
0076      * Helpers for fixing up power area tables depending on SoC revision
0077      */
0078 
0079 extern void rcar_sysc_nullify(struct rcar_sysc_area *areas,
0080                   unsigned int num_areas, u8 id);
0081 
0082 #endif /* __SOC_RENESAS_RCAR_SYSC_H__ */