base.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. /*
  3. * Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved.
  4. * Copyright (c) 2019-2020, Linaro Limited
  5. */
  6. #ifndef SCMI_MSG_BASE_H
  7. #define SCMI_MSG_BASE_H
  8. #include <stdint.h>
  9. #define SCMI_PROTOCOL_VERSION_BASE 0x20000U
  10. #define SCMI_DEFAULT_STRING_LENGTH 16U
  11. enum scmi_base_message_id {
  12. SCMI_BASE_DISCOVER_VENDOR = 0x003,
  13. SCMI_BASE_DISCOVER_SUB_VENDOR = 0x004,
  14. SCMI_BASE_DISCOVER_IMPLEMENTATION_VERSION = 0x005,
  15. SCMI_BASE_DISCOVER_LIST_PROTOCOLS = 0x006,
  16. SCMI_BASE_DISCOVER_AGENT = 0x007,
  17. SCMI_BASE_NOTIFY_ERRORS = 0x008,
  18. };
  19. /*
  20. * PROTOCOL_ATTRIBUTES
  21. */
  22. #define SCMI_BASE_PROTOCOL_ATTRS_NUM_PROTOCOLS_POS 0
  23. #define SCMI_BASE_PROTOCOL_ATTRS_NUM_AGENTS_POS 8
  24. #define SCMI_BASE_PROTOCOL_ATTRS_NUM_PROTOCOLS_MASK 0xFFU
  25. #define SCMI_BASE_PROTOCOL_ATTRS_NUM_AGENTS_MASK 0xFF00U
  26. #define SCMI_BASE_PROTOCOL_ATTRIBUTES(NUM_PROTOCOLS, NUM_AGENTS) \
  27. ((((NUM_PROTOCOLS) << SCMI_BASE_PROTOCOL_ATTRS_NUM_PROTOCOLS_POS) & \
  28. SCMI_BASE_PROTOCOL_ATTRS_NUM_PROTOCOLS_MASK) | \
  29. (((NUM_AGENTS) << SCMI_BASE_PROTOCOL_ATTRS_NUM_AGENTS_POS) & \
  30. SCMI_BASE_PROTOCOL_ATTRS_NUM_AGENTS_MASK))
  31. /*
  32. * BASE_DISCOVER_VENDOR
  33. */
  34. struct scmi_base_discover_vendor_p2a {
  35. int32_t status;
  36. char vendor_identifier[SCMI_DEFAULT_STRING_LENGTH];
  37. };
  38. /*
  39. * BASE_DISCOVER_SUB_VENDOR
  40. */
  41. struct scmi_base_discover_sub_vendor_p2a {
  42. int32_t status;
  43. char sub_vendor_identifier[SCMI_DEFAULT_STRING_LENGTH];
  44. };
  45. /*
  46. * BASE_DISCOVER_IMPLEMENTATION_VERSION
  47. * No special structure right now, see protocol_version.
  48. */
  49. /*
  50. * BASE_DISCOVER_LIST_PROTOCOLS
  51. */
  52. struct scmi_base_discover_list_protocols_a2p {
  53. uint32_t skip;
  54. };
  55. struct scmi_base_discover_list_protocols_p2a {
  56. int32_t status;
  57. uint32_t num_protocols;
  58. uint32_t protocols[];
  59. };
  60. #endif /* SCMI_MSG_BASE_H */