// SPDX-License-Identifier: GPL-2.0
/*
* System Control and Management Interface (SCMI) Raw mode support
*
* Copyright (C) 2022 ARM Ltd.
*/
/**
* DOC: Theory of operation
*
* When enabled the SCMI Raw mode support exposes a userspace API which allows
* to send and receive SCMI commands, replies and notifications from a user
* application through injection and snooping of bare SCMI messages in binary
* little-endian format.
*
* Such injected SCMI transactions will then be routed through the SCMI core
* stack towards the SCMI backend server using whatever SCMI transport is
* currently configured on the system under test.
*
* It is meant to help in running any sort of SCMI backend server testing, no
* matter where the server is placed, as long as it is normally reachable via
* the transport configured on the system.
*
* It is activated by a Kernel configuration option since it is NOT meant to
* be used in production but only during development and in CI deployments.
*
* In order to avoid possible interferences between the SCMI Raw transactions
* originated from a test-suite and the normal operations of the SCMI drivers,
* when Raw mode is enabled, by default, all the regular SCMI drivers are
* inhibited, unless CONFIG_ARM_SCMI_RAW_MODE_SUPPORT_COEX is enabled: in this
* latter case the regular SCMI stack drivers will be loaded as usual and it is
* up to the user of this interface to take care of manually inhibiting the
* regular SCMI drivers in order to avoid interferences during the test runs.
*
* The exposed API is as follows.
*
* All SCMI Raw entries are rooted under a common top /raw debugfs top directory
* which in turn is rooted under the corresponding underlying SCMI instance.
*
* /sys/kernel/debug/scmi/
* `-- 0
* |-- atomic_threshold_us
* |-- instance_name
* |-- raw
* | |-- channels
* | | |-- 0x10
* | | | |-- message
* | | | `-- message_async
* | | `-- 0x13
* | | |-- message
*