rcar-sysc.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #include <linux/types.h>
  10. /*
  11. * Power Domain flags
  12. */
  13. #define PD_CPU BIT(0) /* Area contains main CPU core */
  14. #define PD_SCU BIT(1) /* Area contains SCU and L2 cache */
  15. #define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */
  16. #define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */
  17. #define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */
  18. #define PD_ALWAYS_ON PD_NO_CR /* Always-on area */
  19. /*
  20. * Description of a Power Area
  21. */
  22. struct rcar_sysc_area {
  23. const char *name;
  24. u16 chan_offs; /* Offset of PWRSR register for this area */
  25. u8 chan_bit; /* Bit in PWR* (except for PWRUP in PWRSR) */
  26. u8 isr_bit; /* Bit in SYSCI*R */
  27. int parent; /* -1 if none */
  28. unsigned int flags; /* See PD_* */
  29. };
  30. /*
  31. * SoC-specific Power Area Description
  32. */
  33. struct rcar_sysc_info {
  34. int (*init)(void); /* Optional */
  35. const struct rcar_sysc_area *areas;
  36. unsigned int num_areas;
  37. /* Optional External Request Mask Register */
  38. u32 extmask_offs; /* SYSCEXTMASK register offset */
  39. u32 extmask_val; /* SYSCEXTMASK register mask value */
  40. };
  41. extern const struct rcar_sysc_info r8a7742_sysc_info;
  42. extern const struct rcar_sysc_info r8a7743_sysc_info;
  43. extern const struct rcar_sysc_info r8a7745_sysc_info;
  44. extern const struct rcar_sysc_info r8a77470_sysc_info;
  45. extern const struct rcar_sysc_info r8a774a1_sysc_info;
  46. extern const struct rcar_sysc_info r8a774b1_sysc_info;
  47. extern const struct rcar_sysc_info r8a774c0_sysc_info;
  48. extern const struct rcar_sysc_info r8a774e1_sysc_info;
  49. extern const struct rcar_sysc_info r8a7779_sysc_info;
  50. extern const struct rcar_sysc_info r8a7790_sysc_info;
  51. extern const struct rcar_sysc_info r8a7791_sysc_info;
  52. extern const struct rcar_sysc_info r8a7792_sysc_info;
  53. extern const struct rcar_sysc_info r8a7794_sysc_info;
  54. extern struct rcar_sysc_info r8a7795_sysc_info;
  55. extern const struct rcar_sysc_info r8a77960_sysc_info;
  56. extern const struct rcar_sysc_info r8a77961_sysc_info;
  57. extern const struct rcar_sysc_info r8a77965_sysc_info;
  58. extern const struct rcar_sysc_info r8a77970_sysc_info;
  59. extern const struct rcar_sysc_info r8a77980_sysc_info;
  60. extern const struct rcar_sysc_info r8a77990_sysc_info;
  61. extern const struct rcar_sysc_info r8a77995_sysc_info;
  62. /*
  63. * Helpers for fixing up power area tables depending on SoC revision
  64. */
  65. extern void rcar_sysc_nullify(struct rcar_sysc_area *areas,
  66. unsigned int num_areas, u8 id);
  67. #endif /* __SOC_RENESAS_RCAR_SYSC_H__ */