linux-stable/include/linux/scmi_protocol.h
Sudeep Holla b6f20ff8bd firmware: arm_scmi: add common infrastructure and support for base protocol
The base protocol describes the properties of the implementation and
provide generic error management. The base protocol provides commands
to describe protocol version, discover implementation specific
attributes and vendor/sub-vendor identification, list of protocols
implemented and the various agents are in the system including OSPM
and the platform. It also supports registering for notifications of
platform errors.

This protocol is mandatory. This patch adds support for the same along
with some basic infrastructure to add support for other protocols.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2018-02-28 16:37:57 +00:00

53 lines
1.4 KiB
C

// SPDX-License-Identifier: GPL-2.0
/*
* SCMI Message Protocol driver header
*
* Copyright (C) 2018 ARM Ltd.
*/
#include <linux/types.h>
#define SCMI_MAX_STR_SIZE 16
/**
* struct scmi_revision_info - version information structure
*
* @major_ver: Major ABI version. Change here implies risk of backward
* compatibility break.
* @minor_ver: Minor ABI version. Change here implies new feature addition,
* or compatible change in ABI.
* @num_protocols: Number of protocols that are implemented, excluding the
* base protocol.
* @num_agents: Number of agents in the system.
* @impl_ver: A vendor-specific implementation version.
* @vendor_id: A vendor identifier(Null terminated ASCII string)
* @sub_vendor_id: A sub-vendor identifier(Null terminated ASCII string)
*/
struct scmi_revision_info {
u16 major_ver;
u16 minor_ver;
u8 num_protocols;
u8 num_agents;
u32 impl_ver;
char vendor_id[SCMI_MAX_STR_SIZE];
char sub_vendor_id[SCMI_MAX_STR_SIZE];
};
/**
* struct scmi_handle - Handle returned to ARM SCMI clients for usage.
*
* @dev: pointer to the SCMI device
* @version: pointer to the structure containing SCMI version information
*/
struct scmi_handle {
struct device *dev;
struct scmi_revision_info *version;
};
enum scmi_std_protocol {
SCMI_PROTOCOL_BASE = 0x10,
SCMI_PROTOCOL_POWER = 0x11,
SCMI_PROTOCOL_SYSTEM = 0x12,
SCMI_PROTOCOL_PERF = 0x13,
SCMI_PROTOCOL_CLOCK = 0x14,
SCMI_PROTOCOL_SENSOR = 0x15,
};