reset.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. *
  5. */
  6. #ifndef __RESET_H
  7. #define __RESET_H
  8. #define GH_RM_VM_EXIT_TYPE_PSCI_SYSTEM_OFF 1
  9. #define GH_RM_VM_EXIT_TYPE_PSCI_SYSTEM_RESET 2
  10. #define GH_RM_VM_EXIT_TYPE_PSCI_SYSTEM_RESET2 3
  11. /* GH_RM_VM_EXIT_TYPE_PSCI_SYSTEM_RESET2 */
  12. struct gh_vm_exit_reason_psci_sys_reset2 {
  13. u16 exit_flags;
  14. /* GH_PSCI_SYS_RESET2_EXIT_FLAG_* are bit representations.
  15. * It follows similar flags model as that of VM_EXIT, but
  16. * only if the vendor_reset field in the struct is set
  17. */
  18. #define GH_PSCI_SYS_RESET2_EXIT_FLAG_TYPE 0x1
  19. #define GH_PSCI_SYS_RESET2_POWEROFF 0 /* Value at bit:0 */
  20. #define GH_PSCI_SYS_RESET2_RESTART 1 /* Value at bit:0 */
  21. #define GH_PSCI_SYS_RESET2_EXIT_FLAG_SYSTEM 0x2
  22. #define GH_PSCI_SYS_RESET2_EXIT_FLAG_WARM 0x4
  23. #define GH_PSCI_SYS_RESET2_EXIT_FLAG_DUMP 0x8
  24. u8 exit_code;
  25. /* Exit codes.
  26. * It follows similar flags model as that of VM_EXIT, but
  27. * only if the vendor_reset field in the struct is set
  28. */
  29. #define GH_PSCI_SYS_RESET2_CODE_NORMAL 0
  30. #define GH_PSCI_SYS_RESET2_SOFTWARE_ERR 1
  31. #define GH_PSCI_SYS_RESET2_BUS_ERR 2
  32. #define GH_PSCI_SYS_RESET2_DEVICE_ERR 3
  33. u8 reserved:7;
  34. /* If the vendor_reset is set, the above flags and codes apply.
  35. * Else, the entire exit_reason struct is 0, which qualifies as
  36. * PSCI_SYSTEM_WARM_RESET. Hence, first check this field before
  37. * checking others.
  38. */
  39. u8 vendor_reset:1;
  40. } __packed;
  41. #endif