r8a77990-sysc.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Renesas R-Car E3 System Controller
  4. *
  5. * Copyright (C) 2018 Renesas Electronics Corp.
  6. */
  7. #include <linux/bug.h>
  8. #include <linux/kernel.h>
  9. #include <linux/sys_soc.h>
  10. #include <dt-bindings/power/r8a77990-sysc.h>
  11. #include "rcar-sysc.h"
  12. static struct rcar_sysc_area r8a77990_areas[] __initdata = {
  13. { "always-on", 0, 0, R8A77990_PD_ALWAYS_ON, -1, PD_ALWAYS_ON },
  14. { "ca53-scu", 0x140, 0, R8A77990_PD_CA53_SCU, R8A77990_PD_ALWAYS_ON,
  15. PD_SCU },
  16. { "ca53-cpu0", 0x200, 0, R8A77990_PD_CA53_CPU0, R8A77990_PD_CA53_SCU,
  17. PD_CPU_NOCR },
  18. { "ca53-cpu1", 0x200, 1, R8A77990_PD_CA53_CPU1, R8A77990_PD_CA53_SCU,
  19. PD_CPU_NOCR },
  20. { "cr7", 0x240, 0, R8A77990_PD_CR7, R8A77990_PD_ALWAYS_ON },
  21. { "a3vc", 0x380, 0, R8A77990_PD_A3VC, R8A77990_PD_ALWAYS_ON },
  22. { "a2vc1", 0x3c0, 1, R8A77990_PD_A2VC1, R8A77990_PD_A3VC },
  23. { "3dg-a", 0x100, 0, R8A77990_PD_3DG_A, R8A77990_PD_ALWAYS_ON },
  24. { "3dg-b", 0x100, 1, R8A77990_PD_3DG_B, R8A77990_PD_3DG_A },
  25. };
  26. /* Fixups for R-Car E3 ES1.0 revision */
  27. static const struct soc_device_attribute r8a77990[] __initconst = {
  28. { .soc_id = "r8a77990", .revision = "ES1.0" },
  29. { /* sentinel */ }
  30. };
  31. static int __init r8a77990_sysc_init(void)
  32. {
  33. if (soc_device_match(r8a77990)) {
  34. /* Fix incorrect 3DG hierarchy */
  35. swap(r8a77990_areas[7], r8a77990_areas[8]);
  36. r8a77990_areas[7].parent = R8A77990_PD_ALWAYS_ON;
  37. r8a77990_areas[8].parent = R8A77990_PD_3DG_B;
  38. }
  39. return 0;
  40. }
  41. const struct rcar_sysc_info r8a77990_sysc_info __initconst = {
  42. .init = r8a77990_sysc_init,
  43. .areas = r8a77990_areas,
  44. .num_areas = ARRAY_SIZE(r8a77990_areas),
  45. };