1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved.
4 * Copyright (C) 2019-2020, Linaro Limited
6 #ifndef _SCMI_PROTOCOLS_H
7 #define _SCMI_PROTOCOLS_H
9 #include <linux/bitops.h>
10 #include <asm/types.h>
13 * Subset the SCMI protocols definition
14 * based on SCMI specification v2.0 (DEN0056B)
15 * https://developer.arm.com/docs/den0056/b
18 enum scmi_std_protocol {
19 SCMI_PROTOCOL_ID_BASE = 0x10,
20 SCMI_PROTOCOL_ID_POWER_DOMAIN = 0x11,
21 SCMI_PROTOCOL_ID_SYSTEM = 0x12,
22 SCMI_PROTOCOL_ID_PERF = 0x13,
23 SCMI_PROTOCOL_ID_CLOCK = 0x14,
24 SCMI_PROTOCOL_ID_SENSOR = 0x15,
25 SCMI_PROTOCOL_ID_RESET_DOMAIN = 0x16,
26 SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN = 0x17,
29 enum scmi_status_code {
31 SCMI_NOT_SUPPORTED = -1,
32 SCMI_INVALID_PARAMETERS = -2,
35 SCMI_OUT_OF_RANGE = -5,
37 SCMI_COMMS_ERROR = -7,
38 SCMI_GENERIC_ERROR = -8,
39 SCMI_HARDWARE_ERROR = -9,
40 SCMI_PROTOCOL_ERROR = -10,
46 enum scmi_discovery_id {
47 SCMI_PROTOCOL_VERSION = 0x0,
48 SCMI_PROTOCOL_ATTRIBUTES = 0x1,
49 SCMI_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2,
55 #define SCMI_BASE_PROTOCOL_VERSION 0x20000
57 enum scmi_base_message_id {
58 SCMI_BASE_DISCOVER_VENDOR = 0x3,
59 SCMI_BASE_DISCOVER_SUB_VENDOR = 0x4,
60 SCMI_BASE_DISCOVER_IMPL_VERSION = 0x5,
61 SCMI_BASE_DISCOVER_LIST_PROTOCOLS = 0x6,
62 SCMI_BASE_DISCOVER_AGENT = 0x7,
63 SCMI_BASE_NOTIFY_ERRORS = 0x8,
64 SCMI_BASE_SET_DEVICE_PERMISSIONS = 0x9,
65 SCMI_BASE_SET_PROTOCOL_PERMISSIONS = 0xa,
66 SCMI_BASE_RESET_AGENT_CONFIGURATION = 0xb,
69 #define SCMI_BASE_NAME_LENGTH_MAX 16
72 * struct scmi_protocol_version_out - Response for SCMI_PROTOCOL_VERSION
74 * @status: SCMI command status
75 * @version: Protocol version
77 struct scmi_protocol_version_out {
83 * struct scmi_protocol_attrs_out - Response for SCMI_PROTOCOL_ATTRIBUTES
85 * @status: SCMI command status
86 * @attributes: Protocol attributes or implementation details
88 struct scmi_protocol_attrs_out {
93 #define SCMI_PROTOCOL_ATTRS_NUM_AGENTS(attributes) \
94 (((attributes) & GENMASK(15, 8)) >> 8)
95 #define SCMI_PROTOCOL_ATTRS_NUM_PROTOCOLS(attributes) \
96 ((attributes) & GENMASK(7, 0))
99 * struct scmi_protocol_msg_attrs_out - Response for
100 * SCMI_PROTOCOL_MESSAGE_ATTRIBUTES command
101 * @status: SCMI command status
102 * @attributes: Message-specific attributes
104 struct scmi_protocol_msg_attrs_out {
110 * struct scmi_base_discover_vendor_out - Response for
111 * SCMI_BASE_DISCOVER_VENDOR or
112 * SCMI_BASE_DISCOVER_SUB_VENDOR command
113 * @status: SCMI command status
114 * @vendor_identifier: Name of vendor or sub-vendor in string
116 struct scmi_base_discover_vendor_out {
118 u8 vendor_identifier[SCMI_BASE_NAME_LENGTH_MAX];
122 * struct scmi_base_discover_impl_version_out - Response for
123 * SCMI_BASE_DISCOVER_IMPL_VERSION command
124 * @status: SCMI command status
125 * @impl_version: Vendor-specific implementation version
127 struct scmi_base_discover_impl_version_out {
133 * struct scmi_base_discover_list_protocols_out - Response for
134 * SCMI_BASE_DISCOVER_LIST_PROTOCOLS command
135 * @status: SCMI command status
136 * @num_protocols: Number of SCMI protocols in @protocol
137 * @protocols: Array of packed SCMI protocol ID's
139 struct scmi_base_discover_list_protocols_out {
146 * struct scmi_base_discover_agent_out - Response for
147 * SCMI_BASE_DISCOVER_AGENT command
148 * @status: SCMI command status
149 * @agent_id: SCMI agent ID
150 * @name: Name of agent in string
152 struct scmi_base_discover_agent_out {
155 u8 name[SCMI_BASE_NAME_LENGTH_MAX];
158 #define SCMI_BASE_NOTIFY_ERRORS_ENABLE BIT(0)
161 * struct scmi_base_set_device_permissions_in - Parameters for
162 * SCMI_BASE_SET_DEVICE_PERMISSIONS command
163 * @agent_id: SCMI agent ID
164 * @device_id: device ID
165 * @flags: A set of flags
167 struct scmi_base_set_device_permissions_in {
173 #define SCMI_BASE_SET_DEVICE_PERMISSIONS_ACCESS BIT(0)
176 * struct scmi_base_set_protocol_permissions_in - Parameters for
177 * SCMI_BASE_SET_PROTOCOL_PERMISSIONS command
178 * @agent_id: SCMI agent ID
179 * @device_id: device ID
180 * @command_id: command ID
181 * @flags: A set of flags
183 struct scmi_base_set_protocol_permissions_in {
190 #define SCMI_BASE_SET_PROTOCOL_PERMISSIONS_COMMAND GENMASK(7, 0)
191 #define SCMI_BASE_SET_PROTOCOL_PERMISSIONS_ACCESS BIT(0)
194 * struct scmi_base_reset_agent_configuration_in - Parameters for
195 * SCMI_BASE_RESET_AGENT_CONFIGURATION command
196 * @agent_id: SCMI agent ID
197 * @flags: A set of flags
199 struct scmi_base_reset_agent_configuration_in {
204 #define SCMI_BASE_RESET_ALL_ACCESS_PERMISSIONS BIT(0)
207 * struct scmi_base_ops - SCMI base protocol interfaces
209 struct scmi_base_ops {
211 * protocol_version - get Base protocol version
212 * @dev: SCMI protocol device
213 * @version: Pointer to SCMI protocol version
215 * Obtain the protocol version number in @version for Base protocol.
217 * Return: 0 on success, error code on failure
219 int (*protocol_version)(struct udevice *dev, u32 *version);
221 * protocol_attrs - get protocol attributes
222 * @dev: SCMI protocol device
223 * @num_agents: Number of SCMI agents
224 * @num_protocols: Number of SCMI protocols
226 * Obtain the protocol attributes, the number of agents and the number
227 * of protocols, in @num_agents and @num_protocols respectively, that
228 * the device provides.
230 * Return: 0 on success, error code on failure
232 int (*protocol_attrs)(struct udevice *dev, u32 *num_agents,
235 * protocol_message_attrs - get message-specific attributes
236 * @dev: SCMI protocol device
237 * @message_id: SCMI message ID
238 * @attributes: Message-specific attributes
240 * Obtain the message-specific attributes in @attributes.
241 * This command succeeds if the message is implemented and available.
243 * Return: 0 on success, error code on failure
245 int (*protocol_message_attrs)(struct udevice *dev, u32 message_id,
248 * base_discover_vendor - get vendor name
249 * @dev: SCMI protocol device
250 * @vendor: Pointer to vendor name
252 * Obtain the vendor's name in @vendor.
253 * It is a caller's responsibility to free @vendor.
255 * Return: 0 on success, error code on failure
257 int (*base_discover_vendor)(struct udevice *dev, u8 **vendor);
259 * base_discover_sub_vendor - get sub-vendor name
260 * @dev: SCMI protocol device
261 * @sub_vendor: Pointer to sub-vendor name
263 * Obtain the sub-vendor's name in @sub_vendor.
264 * It is a caller's responsibility to free @sub_vendor.
266 * Return: 0 on success, error code on failure
268 int (*base_discover_sub_vendor)(struct udevice *dev, u8 **sub_vendor);
270 * base_discover_impl_version - get implementation version
271 * @dev: SCMI protocol device
272 * @impl_version: Pointer to implementation version
274 * Obtain the implementation version number in @impl_version.
276 * Return: 0 on success, error code on failure
278 int (*base_discover_impl_version)(struct udevice *dev,
281 * base_discover_list_protocols - get list of protocols
282 * @dev: SCMI protocol device
283 * @protocols: Pointer to array of SCMI protocols
285 * Obtain the list of protocols provided in @protocols.
286 * The number of elements in @protocols always match to the number of
287 * protocols returned by smci_protocol_attrs() when this function
289 * It is a caller's responsibility to free @protocols.
291 * Return: the number of protocols in @protocols on success,
292 * error code on failure
294 int (*base_discover_list_protocols)(struct udevice *dev,
297 * base_discover_agent - identify agent
298 * @dev: SCMI protocol device
299 * @agent_id: SCMI agent ID
300 * @ret_agent_id: Pointer to SCMI agent ID
301 * @name: Pointer to SCMI agent name
303 * Obtain the agent's name in @name. If @agent_id is equal to
304 * 0xffffffff, * this function returns the caller's agent id in
306 * It is a caller's responsibility to free @name.
308 * Return: 0 on success, error code on failure
310 int (*base_discover_agent)(struct udevice *dev, u32 agent_id,
311 u32 *ret_agent_id, u8 **name);
313 * base_notify_errors - configure error notification
314 * @dev: SCMI protocol device
317 * Enable or disable error notification from SCMI firmware.
319 * Return: 0 on success, error code on failure
321 int (*base_notify_errors)(struct udevice *dev, u32 enable);
323 * base_set_device_permissions - configure access permission to device
324 * @dev: SCMI protocol device
325 * @agent_id: SCMI agent ID
326 * @device_id: ID of device to access
327 * @flags: A set of flags
329 * Ask for allowing or denying access permission to the device,
330 * @device_id. The meaning of @flags is defined in SCMI specification.
332 * Return: 0 on success, error code on failure
334 int (*base_set_device_permissions)(struct udevice *dev, u32 agent_id,
335 u32 device_id, u32 flags);
337 * base_set_protocol_permissions - configure access permission to
339 * @dev: SCMI protocol device
340 * @agent_id: SCMI agent ID
341 * @device_id: ID of device to access
342 * @command_id: command ID
343 * @flags: A set of flags
345 * Ask for allowing or denying access permission to the protocol,
346 * @command_id, on the device, @device_id.
347 * The meaning of @flags is defined in SCMI specification.
349 * Return: 0 on success, error code on failure
351 int (*base_set_protocol_permissions)(struct udevice *dev, u32 agent_id,
352 u32 device_id, u32 command_id,
355 * base_reset_agent_configuration - reset resource settings
356 * @dev: SCMI protocol device
357 * @agent_id: SCMI agent ID
358 * @flags: A set of flags
360 * Reset all the resource settings against @agent_id.
361 * The meaning of @flags is defined in SCMI specification.
363 * Return: 0 on success, error code on failure
365 int (*base_reset_agent_configuration)(struct udevice *dev, u32 agent_id,
370 * scmi_generic_protocol_version - get protocol version
371 * @dev: SCMI protocol device
372 * @id: SCMI protocol ID
373 * @version: Pointer to SCMI protocol version
375 * Obtain the protocol version number in @version.
377 * Return: 0 on success, error code on failure
379 int scmi_generic_protocol_version(struct udevice *dev,
380 enum scmi_std_protocol id, u32 *version);
383 * scmi_base_protocol_version - get Base protocol version
384 * @dev: SCMI protocol device
385 * @version: Pointer to SCMI protocol version
387 * Obtain the protocol version number in @version for Base protocol.
389 * Return: 0 on success, error code on failure
391 int scmi_base_protocol_version(struct udevice *dev, u32 *version);
394 * scmi_protocol_attrs - get protocol attributes
395 * @dev: SCMI protocol device
396 * @num_agents: Number of SCMI agents
397 * @num_protocols: Number of SCMI protocols
399 * Obtain the protocol attributes, the number of agents and the number
400 * of protocols, in @num_agents and @num_protocols respectively, that
401 * the device provides.
403 * Return: 0 on success, error code on failure
405 int scmi_base_protocol_attrs(struct udevice *dev, u32 *num_agents,
409 * scmi_protocol_message_attrs - get message-specific attributes
410 * @dev: SCMI protocol device
411 * @message_id: SCMI message ID
412 * @attributes: Message-specific attributes
414 * Obtain the message-specific attributes in @attributes.
415 * This command succeeds if the message is implemented and available.
417 * Return: 0 on success, error code on failure
419 int scmi_base_protocol_message_attrs(struct udevice *dev, u32 message_id,
423 * scmi_base_discover_vendor - get vendor name
424 * @dev: SCMI protocol device
425 * @vendor: Pointer to vendor name
427 * Obtain the vendor's name in @vendor.
428 * It is a caller's responsibility to free @vendor.
430 * Return: 0 on success, error code on failure
432 int scmi_base_discover_vendor(struct udevice *dev, u8 **vendor);
435 * scmi_base_discover_sub_vendor - get sub-vendor name
436 * @dev: SCMI protocol device
437 * @sub_vendor: Pointer to sub-vendor name
439 * Obtain the sub-vendor's name in @sub_vendor.
440 * It is a caller's responsibility to free @sub_vendor.
442 * Return: 0 on success, error code on failure
444 int scmi_base_discover_sub_vendor(struct udevice *dev, u8 **sub_vendor);
447 * scmi_base_discover_impl_version - get implementation version
448 * @dev: SCMI protocol device
449 * @impl_version: Pointer to implementation version
451 * Obtain the implementation version number in @impl_version.
453 * Return: 0 on success, error code on failure
455 int scmi_base_discover_impl_version(struct udevice *dev, u32 *impl_version);
458 * scmi_base_discover_list_protocols - get list of protocols
459 * @dev: SCMI protocol device
460 * @protocols: Pointer to array of SCMI protocols
462 * Obtain the list of protocols provided in @protocols.
463 * The number of elements in @protocols always match to the number of
464 * protocols returned by smci_protocol_attrs() when this function succeeds.
465 * It is a caller's responsibility to free @protocols.
467 * Return: the number of protocols in @protocols on success, error code on
470 int scmi_base_discover_list_protocols(struct udevice *dev, u8 **protocols);
473 * scmi_base_discover_agent - identify agent
474 * @dev: SCMI protocol device
475 * @agent_id: SCMI agent ID
476 * @ret_agent_id: Pointer to SCMI agent ID
477 * @name: Pointer to SCMI agent name
479 * Obtain the agent's name in @name. If @agent_id is equal to 0xffffffff,
480 * this function returns the caller's agent id in @ret_agent_id.
481 * It is a caller's responsibility to free @name.
483 * Return: 0 on success, error code on failure
485 int scmi_base_discover_agent(struct udevice *dev, u32 agent_id,
486 u32 *ret_agent_id, u8 **name);
489 * scmi_base_notify_errors - configure error notification
490 * @dev: SCMI protocol device
493 * Enable or disable error notification from SCMI firmware.
495 * Return: 0 on success, error code on failure
497 int scmi_base_notify_errors(struct udevice *dev, u32 enable);
500 * scmi_base_set_device_permissions - configure access permission to device
501 * @dev: SCMI protocol device
502 * @agent_id: SCMI agent ID
503 * @device_id: ID of device to access
504 * @flags: A set of flags
506 * Ask for allowing or denying access permission to the device, @device_id.
507 * The meaning of @flags is defined in SCMI specification.
509 * Return: 0 on success, error code on failure
511 int scmi_base_set_device_permissions(struct udevice *dev, u32 agent_id,
512 u32 device_id, u32 flags);
515 * scmi_base_set_protocol_permissions - configure access permission to
517 * @dev: SCMI protocol device
518 * @agent_id: SCMI agent ID
519 * @device_id: ID of device to access
520 * @command_id: SCMI command ID
521 * @flags: A set of flags
523 * Ask for allowing or denying access permission to the protocol, @command_id,
524 * on the device, @device_id.
525 * The meaning of @flags is defined in SCMI specification.
527 * Return: 0 on success, error code on failure
529 int scmi_base_set_protocol_permissions(struct udevice *dev,
530 u32 agent_id, u32 device_id,
531 u32 command_id, u32 flags);
534 * scmi_base_reset_agent_configuration - reset resource settings
535 * @dev: SCMI protocol device
536 * @agent_id: SCMI agent ID
537 * @flags: A set of flags
539 * Reset all the resource settings against @agent_id.
540 * The meaning of @flags is defined in SCMI specification.
542 * Return: 0 on success, error code on failure
544 int scmi_base_reset_agent_configuration(struct udevice *dev, u32 agent_id,
548 * SCMI Power Domain Management Protocol
551 #define SCMI_PWD_PROTOCOL_VERSION 0x30000
552 #define SCMI_PWD_PSTATE_TYPE_LOST BIT(30)
553 #define SCMI_PWD_PSTATE_ID GENMASK(27, 0)
555 enum scmi_power_domain_message_id {
556 SCMI_PWD_ATTRIBUTES = 0x3,
557 SCMI_PWD_STATE_SET = 0x4,
558 SCMI_PWD_STATE_GET = 0x5,
559 SCMI_PWD_STATE_NOTIFY = 0x6,
560 SCMI_PWD_STATE_CHANGE_REQUESTED_NOTIFY = 0x7,
561 SCMI_PWD_NAME_GET = 0x8,
565 * struct scmi_pwd_protocol_attrs_out
566 * @status: SCMI command status
567 * @attributes: Protocol attributes
568 * @stats_addr_low: Lower 32 bits of address of statistics memory region
569 * @stats_addr_high: Higher 32 bits of address of statistics memory region
570 * @stats_len: Length of statistics memory region
572 struct scmi_pwd_protocol_attrs_out {
580 #define SCMI_PWD_PROTO_ATTRS_NUM_PWD(attributes) ((attributes) & GENMASK(15, 0))
583 * struct scmi_pwd_protocol_msg_attrs_out
584 * @status: SCMI command status
585 * @attributes: Message-specific attributes
587 struct scmi_pwd_protocol_msg_attrs_out {
592 #define SCMI_PWD_NAME_LENGTH_MAX 16
595 * struct scmi_pwd_attrs_out
596 * @status: SCMI command status
597 * @attributes: Power domain attributes
598 * @name: Name of power domain
600 struct scmi_pwd_attrs_out {
603 u8 name[SCMI_PWD_NAME_LENGTH_MAX];
606 #define SCMI_PWD_ATTR_PSTATE_CHANGE_NOTIFY BIT(31)
607 #define SCMI_PWD_ATTR_PSTATE_ASYNC BIT(30)
608 #define SCMI_PWD_ATTR_PSTATE_SYNC BIT(29)
609 #define SCMI_PWD_ATTR_PSTATE_CHANGE_RQ_NOTIFY BIT(28)
610 #define SCMI_PWD_ATTR_EXTENDED_NAME BIT(27)
613 * struct scmi_pwd_state_set_in
615 * @domain_id: Identifier of power domain
616 * @pstate: Power state of the domain
618 struct scmi_pwd_state_set_in {
624 #define SCMI_PWD_SET_FLAGS_ASYNC BIT(0)
627 * struct scmi_pwd_state_get_out
628 * @status: SCMI command status
629 * @pstate: Power state of the domain
631 struct scmi_pwd_state_get_out {
636 #define SCMI_PWD_EXTENDED_NAME_MAX 64
638 * struct scmi_pwd_name_get_out
639 * @status: SCMI command status
640 * @flags: Parameter flags
641 * @extended_name: Extended name of power domain
643 struct scmi_pwd_name_get_out {
646 u8 extended_name[SCMI_PWD_EXTENDED_NAME_MAX];
650 * scmi_pwd_protocol_attrs - get protocol attributes
651 * @dev: SCMI protocol device
652 * @num_pwdoms: Number of power domains
653 * @stats_addr: Address of statistics memory region
654 * @stats_len: Length of statistics memory region
656 * Obtain the protocol attributes, the number of power domains and
657 * the information of statistics memory region.
659 * Return: 0 on success, error code on failure
661 int scmi_pwd_protocol_attrs(struct udevice *dev, int *num_pwdoms,
662 u64 *stats_addr, size_t *stats_len);
664 * scmi_pwd_protocol_message_attrs - get message-specific attributes
665 * @dev: SCMI protocol device
666 * @message_id: SCMI message ID
667 * @attributes: Message-specific attributes
669 * Obtain the message-specific attributes in @attributes.
671 * Return: 0 on success, error code on failure
673 int scmi_pwd_protocol_message_attrs(struct udevice *dev, s32 message_id,
676 * scmi_pwd_attrs - get power domain attributes
677 * @dev: SCMI protocol device
678 * @domain_id: Identifier of power domain
679 * @attributes: Power domain attributes
680 * @name: Name of power domain
682 * Obtain the attributes of the given power domain, @domain_id, in @attributes
683 * as well as its name in @name.
685 * Return: 0 on success, error code on failure
687 int scmi_pwd_attrs(struct udevice *dev, u32 message_id, u32 *attributes,
690 * scmi_pwd_state_set - set power state
691 * @dev: SCMI protocol device
692 * @flags: Parameter flags
693 * @domain_id: Identifier of power domain
694 * @pstate: Power state
696 * Change the power state of the given power domain, @domain_id.
698 * Return: 0 on success, error code on failure
700 int scmi_pwd_state_set(struct udevice *dev, u32 flags, u32 domain_id,
703 * scmi_pwd_state_get - get power state
704 * @dev: SCMI protocol device
705 * @domain_id: Identifier of power domain
706 * @pstate: Power state
708 * Obtain the power state of the given power domain, @domain_id.
710 * Return: 0 on success, error code on failure
712 int scmi_pwd_state_get(struct udevice *dev, u32 domain_id, u32 *pstate);
714 * scmi_pwd_name_get - get extended name
715 * @dev: SCMI protocol device
716 * @domain_id: Identifier of power domain
717 * @name: Extended name of the domain
719 * Obtain the extended name of the given power domain, @domain_id, in @name.
721 * Return: 0 on success, error code on failure
723 int scmi_pwd_name_get(struct udevice *dev, u32 domain_id, u8 **name);
726 * SCMI Clock Protocol
729 enum scmi_clock_message_id {
730 SCMI_CLOCK_ATTRIBUTES = 0x3,
731 SCMI_CLOCK_RATE_SET = 0x5,
732 SCMI_CLOCK_RATE_GET = 0x6,
733 SCMI_CLOCK_CONFIG_SET = 0x7,
736 #define SCMI_CLK_PROTO_ATTR_COUNT_MASK GENMASK(15, 0)
737 #define SCMI_CLK_RATE_ASYNC_NOTIFY BIT(0)
738 #define SCMI_CLK_RATE_ASYNC_NORESP (BIT(0) | BIT(1))
739 #define SCMI_CLK_RATE_ROUND_DOWN 0
740 #define SCMI_CLK_RATE_ROUND_UP BIT(2)
741 #define SCMI_CLK_RATE_ROUND_CLOSEST BIT(3)
743 #define SCMI_CLOCK_NAME_LENGTH_MAX 16
746 * struct scmi_clk_get_nb_out - Response for SCMI_PROTOCOL_ATTRIBUTES command
747 * @status: SCMI command status
748 * @attributes: Attributes of the clock protocol, mainly number of clocks exposed
750 struct scmi_clk_protocol_attr_out {
756 * struct scmi_clk_attribute_in - Message payload for SCMI_CLOCK_ATTRIBUTES command
757 * @clock_id: SCMI clock ID
759 struct scmi_clk_attribute_in {
764 * struct scmi_clk_get_nb_out - Response payload for SCMI_CLOCK_ATTRIBUTES command
765 * @status: SCMI command status
766 * @attributes: clock attributes
767 * @clock_name: name of the clock
769 struct scmi_clk_attribute_out {
772 char clock_name[SCMI_CLOCK_NAME_LENGTH_MAX];
776 * struct scmi_clk_state_in - Message payload for CLOCK_CONFIG_SET command
777 * @clock_id: SCMI clock ID
778 * @attributes: Attributes of the targets clock state
780 struct scmi_clk_state_in {
786 * struct scmi_clk_state_out - Response payload for CLOCK_CONFIG_SET command
787 * @status: SCMI command status
789 struct scmi_clk_state_out {
794 * struct scmi_clk_state_in - Message payload for CLOCK_RATE_GET command
795 * @clock_id: SCMI clock ID
796 * @attributes: Attributes of the targets clock state
798 struct scmi_clk_rate_get_in {
803 * struct scmi_clk_rate_get_out - Response payload for CLOCK_RATE_GET command
804 * @status: SCMI command status
805 * @rate_lsb: 32bit LSB of the clock rate in Hertz
806 * @rate_msb: 32bit MSB of the clock rate in Hertz
808 struct scmi_clk_rate_get_out {
815 * struct scmi_clk_state_in - Message payload for CLOCK_RATE_SET command
816 * @flags: Flags for the clock rate set request
817 * @clock_id: SCMI clock ID
818 * @rate_lsb: 32bit LSB of the clock rate in Hertz
819 * @rate_msb: 32bit MSB of the clock rate in Hertz
821 struct scmi_clk_rate_set_in {
829 * struct scmi_clk_rate_set_out - Response payload for CLOCK_RATE_SET command
830 * @status: SCMI command status
832 struct scmi_clk_rate_set_out {
837 * SCMI Reset Domain Protocol
840 enum scmi_reset_domain_message_id {
841 SCMI_RESET_DOMAIN_ATTRIBUTES = 0x3,
842 SCMI_RESET_DOMAIN_RESET = 0x4,
845 #define SCMI_RD_NAME_LEN 16
847 #define SCMI_RD_ATTRIBUTES_FLAG_ASYNC BIT(31)
848 #define SCMI_RD_ATTRIBUTES_FLAG_NOTIF BIT(30)
850 #define SCMI_RD_RESET_FLAG_ASYNC BIT(2)
851 #define SCMI_RD_RESET_FLAG_ASSERT BIT(1)
852 #define SCMI_RD_RESET_FLAG_CYCLE BIT(0)
855 * struct scmi_rd_attr_in - Payload for RESET_DOMAIN_ATTRIBUTES message
856 * @domain_id: SCMI reset domain ID
858 struct scmi_rd_attr_in {
863 * struct scmi_rd_attr_out - Payload for RESET_DOMAIN_ATTRIBUTES response
864 * @status: SCMI command status
865 * @attributes: Retrieved attributes of the reset domain
866 * @latency: Reset cycle max lantency
867 * @name: Reset domain name
869 struct scmi_rd_attr_out {
873 char name[SCMI_RD_NAME_LEN];
877 * struct scmi_rd_reset_in - Message payload for RESET command
878 * @domain_id: SCMI reset domain ID
879 * @flags: Flags for the reset request
880 * @reset_state: Reset target state
882 struct scmi_rd_reset_in {
889 * struct scmi_rd_reset_out - Response payload for RESET command
890 * @status: SCMI command status
892 struct scmi_rd_reset_out {
897 * SCMI Voltage Domain Protocol
900 enum scmi_voltage_domain_message_id {
901 SCMI_VOLTAGE_DOMAIN_ATTRIBUTES = 0x3,
902 SCMI_VOLTAGE_DOMAIN_CONFIG_SET = 0x5,
903 SCMI_VOLTAGE_DOMAIN_CONFIG_GET = 0x6,
904 SCMI_VOLTAGE_DOMAIN_LEVEL_SET = 0x7,
905 SCMI_VOLTAGE_DOMAIN_LEVEL_GET = 0x8,
908 #define SCMI_VOLTD_NAME_LEN 16
910 #define SCMI_VOLTD_CONFIG_MASK GENMASK(3, 0)
911 #define SCMI_VOLTD_CONFIG_OFF 0
912 #define SCMI_VOLTD_CONFIG_ON 0x7
915 * struct scmi_voltd_attr_in - Payload for VOLTAGE_DOMAIN_ATTRIBUTES message
916 * @domain_id: SCMI voltage domain ID
918 struct scmi_voltd_attr_in {
923 * struct scmi_voltd_attr_out - Payload for VOLTAGE_DOMAIN_ATTRIBUTES response
924 * @status: SCMI command status
925 * @attributes: Retrieved attributes of the voltage domain
926 * @name: Voltage domain name
928 struct scmi_voltd_attr_out {
931 char name[SCMI_VOLTD_NAME_LEN];
935 * struct scmi_voltd_config_set_in - Message payload for VOLTAGE_CONFIG_SET cmd
936 * @domain_id: SCMI voltage domain ID
937 * @config: Configuration data of the voltage domain
939 struct scmi_voltd_config_set_in {
945 * struct scmi_voltd_config_set_out - Response for VOLTAGE_CONFIG_SET command
946 * @status: SCMI command status
948 struct scmi_voltd_config_set_out {
953 * struct scmi_voltd_config_get_in - Message payload for VOLTAGE_CONFIG_GET cmd
954 * @domain_id: SCMI voltage domain ID
956 struct scmi_voltd_config_get_in {
961 * struct scmi_voltd_config_get_out - Response for VOLTAGE_CONFIG_GET command
962 * @status: SCMI command status
963 * @config: Configuration data of the voltage domain
965 struct scmi_voltd_config_get_out {
971 * struct scmi_voltd_level_set_in - Message payload for VOLTAGE_LEVEL_SET cmd
972 * @domain_id: SCMI voltage domain ID
973 * @flags: Parameter flags for configuring target level
974 * @voltage_level: Target voltage level in microvolts (uV)
976 struct scmi_voltd_level_set_in {
983 * struct scmi_voltd_level_set_out - Response for VOLTAGE_LEVEL_SET command
984 * @status: SCMI command status
986 struct scmi_voltd_level_set_out {
991 * struct scmi_voltd_level_get_in - Message payload for VOLTAGE_LEVEL_GET cmd
992 * @domain_id: SCMI voltage domain ID
994 struct scmi_voltd_level_get_in {
999 * struct scmi_voltd_level_get_out - Response for VOLTAGE_LEVEL_GET command
1000 * @status: SCMI command status
1001 * @voltage_level: Voltage level in microvolts (uV)
1003 struct scmi_voltd_level_get_out {
1008 #endif /* _SCMI_PROTOCOLS_H */