reset_domain.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. /*
  3. * Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved.
  4. * Copyright (c) 2019, Linaro Limited
  5. */
  6. #ifndef SCMI_MSG_RESET_DOMAIN_H
  7. #define SCMI_MSG_RESET_DOMAIN_H
  8. #include <stdbool.h>
  9. #include <stdint.h>
  10. #include <lib/utils_def.h>
  11. #define SCMI_PROTOCOL_VERSION_RESET_DOMAIN 0x10000U
  12. #define SCMI_RESET_STATE_ARCH BIT(31)
  13. #define SCMI_RESET_STATE_IMPL 0U
  14. /*
  15. * Identifiers of the SCMI Reset Domain Management Protocol commands
  16. */
  17. enum scmi_reset_domain_command_id {
  18. SCMI_RESET_DOMAIN_ATTRIBUTES = 0x03,
  19. SCMI_RESET_DOMAIN_REQUEST = 0x04,
  20. SCMI_RESET_DOMAIN_NOTIFY = 0x05,
  21. };
  22. /*
  23. * Identifiers of the SCMI Reset Domain Management Protocol responses
  24. */
  25. enum scmi_reset_domain_response_id {
  26. SCMI_RESET_ISSUED = 0x00,
  27. SCMI_RESET_COMPLETE = 0x04,
  28. };
  29. /*
  30. * PROTOCOL_ATTRIBUTES
  31. */
  32. #define SCMI_RESET_DOMAIN_COUNT_MASK GENMASK_32(15, 0)
  33. struct scmi_reset_domain_protocol_attributes_p2a {
  34. int32_t status;
  35. uint32_t attributes;
  36. };
  37. /* Value for scmi_reset_domain_attributes_p2a:flags */
  38. #define SCMI_RESET_DOMAIN_ATTR_ASYNC BIT(31)
  39. #define SCMI_RESET_DOMAIN_ATTR_NOTIF BIT(30)
  40. /* Value for scmi_reset_domain_attributes_p2a:latency */
  41. #define SCMI_RESET_DOMAIN_ATTR_UNK_LAT 0x7fffffffU
  42. #define SCMI_RESET_DOMAIN_ATTR_MAX_LAT 0x7ffffffeU
  43. /* Macro for scmi_reset_domain_attributes_p2a:name */
  44. #define SCMI_RESET_DOMAIN_ATTR_NAME_SZ 16U
  45. struct scmi_reset_domain_attributes_a2p {
  46. uint32_t domain_id;
  47. };
  48. struct scmi_reset_domain_attributes_p2a {
  49. int32_t status;
  50. uint32_t flags;
  51. uint32_t latency;
  52. char name[SCMI_RESET_DOMAIN_ATTR_NAME_SZ];
  53. };
  54. /*
  55. * RESET
  56. */
  57. /* Values for scmi_reset_domain_request_a2p:flags */
  58. #define SCMI_RESET_DOMAIN_ASYNC BIT(2)
  59. #define SCMI_RESET_DOMAIN_EXPLICIT BIT(1)
  60. #define SCMI_RESET_DOMAIN_AUTO BIT(0)
  61. struct scmi_reset_domain_request_a2p {
  62. uint32_t domain_id;
  63. uint32_t flags;
  64. uint32_t reset_state;
  65. };
  66. struct scmi_reset_domain_request_p2a {
  67. int32_t status;
  68. };
  69. /*
  70. * RESET_NOTIFY
  71. */
  72. /* Values for scmi_reset_notify_p2a:flags */
  73. #define SCMI_RESET_DOMAIN_DO_NOTIFY BIT(0)
  74. struct scmi_reset_domain_notify_a2p {
  75. uint32_t domain_id;
  76. uint32_t notify_enable;
  77. };
  78. struct scmi_reset_domain_notify_p2a {
  79. int32_t status;
  80. };
  81. /*
  82. * RESET_COMPLETE
  83. */
  84. struct scmi_reset_domain_complete_p2a {
  85. int32_t status;
  86. uint32_t domain_id;
  87. };
  88. /*
  89. * RESET_ISSUED
  90. */
  91. struct scmi_reset_domain_issued_p2a {
  92. uint32_t domain_id;
  93. uint32_t reset_state;
  94. };
  95. #endif /* SCMI_MSG_RESET_DOMAIN_H */