fpsci.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Copyright : (C) 2023 Phytium Information Technology, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is OPEN SOURCE software: you can redistribute it and/or modify it
  6. * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
  7. * either version 1.0 of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
  10. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. * See the Phytium Public License for more details.
  12. *
  13. *
  14. * FilePath: fpsci.h
  15. * Created Date: 2023-06-21 16:13:14
  16. * Last Modified: 2023-06-27 15:33:23
  17. * Description: This file is for
  18. *
  19. * Modify History:
  20. * Ver Who Date Changes
  21. * ----- ---------- -------- ---------------------------------
  22. * 1.0 huanghe 2023-06-21 first release
  23. */
  24. #ifndef FPSCI_H
  25. #define FPSCI_H
  26. #ifdef __cplusplus
  27. extern "C"
  28. {
  29. #endif
  30. #include "ftypes.h"
  31. /* 版本掩码 */
  32. #define FPSCI_VERSION_MASK 0x0000FFFF
  33. #define FPSCI_MAJOR_VERSION(x) ((x) >> 16)
  34. #define FPSCI_MINOR_VERSION(x) ((x) & 0xFFFF)
  35. /* Power State 参数 */
  36. #define FPSCI_POWER_STATE_ID_MASK 0xFFFF
  37. #define FPSCI_POWER_STATE_ID_SHIFT 0
  38. #define FPSCI_POWER_STATE_TYPE_SHIFT 16
  39. #define FPSCI_POWER_STATE_AFFL_SHIFT 24
  40. /* stateid encoding */
  41. #define FPSCI_STATEID_CORE_RETENTION 0x2
  42. #define FPSCI_STATEID_CORE_POWERDOWN 0x8
  43. /* 版本掩码 */
  44. #define FPSCI_VERSION_MASK 0x0000FFFF
  45. /* 定义复位模式 */
  46. #define FPSCI_SYSTEM_RESET_TYPE_COLD 0
  47. #define FPSCI_SYSTEM_RESET_TYPE_WARM 1
  48. /* 定义PSCI 错误码 */
  49. #define FPSCI_SUCCESS 0
  50. #define FPSCI_NOT_SUPPORTED -1
  51. #define FPSCI_INVALID_PARAMS -2
  52. #define FPSCI_DENIED -3
  53. #define FPSCI_ALREADY_ON -4
  54. #define FPSCI_ON_PENDING -5
  55. #define FPSCI_INTERNAL_FAILURE -6
  56. #define FPSCI_NOT_PRESENT -7
  57. #define FPSCI_DISABLED -8
  58. #define FPSCI_INVALID_ADDRESS -9
  59. int FPsciInit(void) ;
  60. int FPsciVersion(void) ;
  61. int FPsciCpuSuspend(u32 power_state, unsigned long entry_point_address, unsigned long context_id) ;
  62. int FPsciCpuOn(unsigned long target_cpu, unsigned long entry_point_address, unsigned long context_id) ;
  63. int FPsciAffinityInfo(unsigned long target_affinity, u32 lowest_affinity_level) ;
  64. void FPsciSystemReset(u32 reset_type) ;
  65. int FPsciFeatures(u32 psci_fid) ;
  66. int FPsciCpuOff(void) ;
  67. int FPsciCpuMaskOn(s32 cpu_id_mask, uintptr bootaddr) ;
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif /* __ASM_ARM_MACRO_H__ */