psci-r8a779a0.c 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * This file implements basic PSCI support for Renesas r8a779a0 SoC
  4. *
  5. * Copyright (C) 2020 Renesas Electronics Corp.
  6. *
  7. */
  8. #include <common.h>
  9. #include <asm/io.h>
  10. #include <asm/psci.h>
  11. #include <asm/secure.h>
  12. int __secure psci_features(u32 function_id, u32 psci_fid)
  13. {
  14. switch (psci_fid) {
  15. case ARM_PSCI_0_2_FN_PSCI_VERSION:
  16. case ARM_PSCI_0_2_FN_SYSTEM_RESET:
  17. return 0x0;
  18. }
  19. /* case ARM_PSCI_0_2_FN_CPU_ON: */
  20. /* case ARM_PSCI_0_2_FN_CPU_OFF: */
  21. /* case ARM_PSCI_0_2_FN_AFFINITY_INFO: */
  22. /* case ARM_PSCI_0_2_FN_MIGRATE_INFO_TYPE: */
  23. /* case ARM_PSCI_0_2_FN_SYSTEM_OFF: */
  24. return ARM_PSCI_RET_NI;
  25. }
  26. u32 __secure psci_version(void)
  27. {
  28. return ARM_PSCI_VER_0_2;
  29. }
  30. #define RST_BASE 0xE6160000 /* Domain0 */
  31. #define RST_SRESCR0 (RST_BASE + 0x18)
  32. #define RST_SPRES 0x5AA58000
  33. void __secure __noreturn psci_system_reset(void)
  34. {
  35. writel(RST_SPRES, RST_SRESCR0);
  36. while (1)
  37. ;
  38. }
  39. int psci_update_dt(void *fdt)
  40. {
  41. return 0;
  42. }