2024-04-12 10:46:24

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH v3 0/6] firmware: support i.MX95 SCMI BBM/MISC Extenstion

i.MX95 System Manager Firmware source: https://github.com/nxp-imx/imx-sm
To generate html from the repo: make html

i.MX95 System Manager Firmware support vendor extension protocol:
- Battery Backed Module(BBM) Protocol
This protocol is intended provide access to the battery-backed module.
This contains persistent storage (GPR), an RTC, and the ON/OFF button.
The protocol can also provide access to similar functions implemented via
external board components. The BBM protocol provides functions to:

- Describe the protocol version.
- Discover implementation attributes.
- Read/write GPR
- Discover the RTCs available in the system.
- Read/write the RTC time in seconds and ticks
- Set an alarm (per LM) in seconds
- Get notifications on RTC update, alarm, or rollover.
- Get notification on ON/OFF button activity.

- MISC Protocol for misc settings
This includes controls that are misc settings/actions that must be exposed
from the SM to agents. They are device specific and are usually define to
access bit fields in various mix block control modules, IOMUX_GPR, and other
GPR/CSR owned by the SM.
This protocol supports the following functions:

- Describe the protocol version.
- Discover implementation attributes.
- Set/Get a control.
- Initiate an action on a control.
- Obtain platform (i.e. SM) build information.
- Obtain ROM passover data.
- Read boot/shutdown/reset information for the LM or the system.

This patchset is to support the two protocols and users that use the
protocols. The upper protocol infomation is also included in patch 1

Signed-off-by: Peng Fan <[email protected]>
To: Jonathan Corbet <[email protected]>
To: Shawn Guo <[email protected]>
To: Sascha Hauer <[email protected]>
To: Pengutronix Kernel Team <[email protected]>
To: Fabio Estevam <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Sudeep Holla <[email protected]>
To: Cristian Marussi <[email protected]>
To: Peng Fan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Changes in v3:
- Update cover letter and patch commit log to include more information.
- Add documentation for BBM and MISC protocols under
Documentation/firmware-guide/nxp. Not sure if this is a good place.
- Fix the bindings, hope I have addressed the issues.
Drop imx,scmi.yaml.
Add nxp,imx95-scmi.yaml for NXP vendor protocol properties.
Add constraints, add nxp prefix for NXP vendor properties.
Use anyOf in arm,scmi.yaml to ref vendor yaml.
- Use cpu_to_le32 per Cristian
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Sorry for late update since v1.
- Add a new patch 1
- Address imx,scmi.yaml issues
- Address comments for imx-sm-bbm.c and imx-sm-misc.c
- I not add vendor id since related patches not landed in linux-next.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Peng Fan (6):
Documentation: firmware-guide: add NXP i.MX95 SCMI documentation
dt-bindings: firmware: add i.MX95 SCMI Extension protocol
firmware: arm_scmi: add initial support for i.MX BBM protocol
firmware: arm_scmi: add initial support for i.MX MISC protocol
firmware: imx: support BBM module
firmware: imx: add i.MX95 MISC driver

.../devicetree/bindings/firmware/arm,scmi.yaml | 21 +
.../bindings/firmware/nxp,imx95-scmi.yaml | 36 +
Documentation/firmware-guide/index.rst | 10 +
Documentation/firmware-guide/nxp/imx95-scmi.rst | 877 +++++++++++++++++++++
Documentation/firmware-guide/nxp/index.rst | 10 +
drivers/firmware/arm_scmi/Kconfig | 20 +
drivers/firmware/arm_scmi/Makefile | 2 +
drivers/firmware/arm_scmi/imx-sm-bbm.c | 378 +++++++++
drivers/firmware/arm_scmi/imx-sm-misc.c | 305 +++++++
drivers/firmware/imx/Makefile | 2 +
drivers/firmware/imx/sm-bbm.c | 317 ++++++++
drivers/firmware/imx/sm-misc.c | 92 +++
include/linux/firmware/imx/sm.h | 33 +
include/linux/scmi_imx_protocol.h | 62 ++
14 files changed, 2165 insertions(+)
---
base-commit: 9ed46da14b9b9b2ad4edb3b0c545b6dbe5c00d39
change-id: 20240405-imx95-bbm-misc-v2-b5e9d24adc42

Best regards,
--
Peng Fan <[email protected]>



2024-04-12 10:47:25

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH v3 6/6] firmware: imx: add i.MX95 MISC driver

From: Peng Fan <[email protected]>

The i.MX95 System manager exports SCMI MISC protocol for linux to do
various settings, such as set board gpio expander as wakeup source.

The driver is to add the support.

Signed-off-by: Peng Fan <[email protected]>
---
drivers/firmware/imx/Makefile | 1 +
drivers/firmware/imx/sm-misc.c | 92 +++++++++++++++++++++++++++++++++++++++++
include/linux/firmware/imx/sm.h | 33 +++++++++++++++
3 files changed, 126 insertions(+)

diff --git a/drivers/firmware/imx/Makefile b/drivers/firmware/imx/Makefile
index fb20e22074e1..cb9c361d9b81 100644
--- a/drivers/firmware/imx/Makefile
+++ b/drivers/firmware/imx/Makefile
@@ -2,3 +2,4 @@
obj-$(CONFIG_IMX_DSP) += imx-dsp.o
obj-$(CONFIG_IMX_SCU) += imx-scu.o misc.o imx-scu-irq.o rm.o imx-scu-soc.o
obj-${CONFIG_IMX_SCMI_BBM_EXT} += sm-bbm.o
+obj-${CONFIG_IMX_SCMI_MISC_EXT} += sm-misc.o
diff --git a/drivers/firmware/imx/sm-misc.c b/drivers/firmware/imx/sm-misc.c
new file mode 100644
index 000000000000..a5609de426f6
--- /dev/null
+++ b/drivers/firmware/imx/sm-misc.c
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2024 NXP.
+ */
+
+#include <linux/firmware/imx/sm.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/scmi_protocol.h>
+#include <linux/scmi_imx_protocol.h>
+
+static const struct scmi_imx_misc_proto_ops *imx_misc_ctrl_ops;
+static struct scmi_protocol_handle *ph;
+struct notifier_block scmi_imx_misc_ctrl_nb;
+
+int scmi_imx_misc_ctrl_set(u32 id, u32 val)
+{
+ if (!ph)
+ return -EPROBE_DEFER;
+
+ return imx_misc_ctrl_ops->misc_ctrl_set(ph, id, 1, &val);
+};
+EXPORT_SYMBOL(scmi_imx_misc_ctrl_set);
+
+int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
+{
+ if (!ph)
+ return -EPROBE_DEFER;
+
+ return imx_misc_ctrl_ops->misc_ctrl_get(ph, id, num, val);
+}
+EXPORT_SYMBOL(scmi_imx_misc_ctrl_get);
+
+static int scmi_imx_misc_ctrl_notifier(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ return 0;
+}
+
+static int scmi_imx_misc_ctrl_probe(struct scmi_device *sdev)
+{
+ const struct scmi_handle *handle = sdev->handle;
+ struct device_node *np = sdev->dev.of_node;
+ u32 src_id, evt_id, wu_num;
+ int ret, i;
+
+ if (!handle)
+ return -ENODEV;
+
+ imx_misc_ctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_IMX_MISC, &ph);
+ if (IS_ERR(imx_misc_ctrl_ops))
+ return PTR_ERR(imx_misc_ctrl_ops);
+
+ scmi_imx_misc_ctrl_nb.notifier_call = &scmi_imx_misc_ctrl_notifier;
+ wu_num = of_property_count_u32_elems(np, "wakeup-sources");
+ if (wu_num % 2) {
+ dev_err(&sdev->dev, "Invalid wakeup-sources\n");
+ return -EINVAL;
+ }
+
+ for (i = 0; i < wu_num; i += 2) {
+ WARN_ON(of_property_read_u32_index(np, "wakeup-sources", i, &src_id));
+ WARN_ON(of_property_read_u32_index(np, "wakeup-sources", i + 1, &evt_id));
+ ret = handle->notify_ops->devm_event_notifier_register(sdev, SCMI_PROTOCOL_IMX_MISC,
+ evt_id,
+ &src_id,
+ &scmi_imx_misc_ctrl_nb);
+ if (ret)
+ dev_err(&sdev->dev, "Failed to register scmi misc event: %d\n", src_id);
+ }
+
+ return 0;
+
+}
+
+static const struct scmi_device_id scmi_id_table[] = {
+ { SCMI_PROTOCOL_IMX_MISC, "imx-misc-ctrl" },
+ { },
+};
+MODULE_DEVICE_TABLE(scmi, scmi_id_table);
+
+static struct scmi_driver scmi_imx_misc_ctrl_driver = {
+ .name = "scmi-imx-misc-ctrl",
+ .probe = scmi_imx_misc_ctrl_probe,
+ .id_table = scmi_id_table,
+};
+module_scmi_driver(scmi_imx_misc_ctrl_driver);
+
+MODULE_AUTHOR("Peng Fan <[email protected]>");
+MODULE_DESCRIPTION("IMX SM MISC driver");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/firmware/imx/sm.h b/include/linux/firmware/imx/sm.h
new file mode 100644
index 000000000000..daad4bdf7d1c
--- /dev/null
+++ b/include/linux/firmware/imx/sm.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2024 NXP
+ */
+
+#ifndef _SCMI_IMX_H
+#define _SCMI_IMX_H
+
+#include <linux/bitfield.h>
+#include <linux/types.h>
+
+#define SCMI_IMX_CTRL_PDM_CLK_SEL 0 /* AON PDM clock sel */
+#define SCMI_IMX_CTRL_MQS1_SETTINGS 1 /* AON MQS settings */
+#define SCMI_IMX_CTRL_SAI1_MCLK 2 /* AON SAI1 MCLK */
+#define SCMI_IMX_CTRL_SAI3_MCLK 3 /* WAKE SAI3 MCLK */
+#define SCMI_IMX_CTRL_SAI4_MCLK 4 /* WAKE SAI4 MCLK */
+#define SCMI_IMX_CTRL_SAI5_MCLK 5 /* WAKE SAI5 MCLK */
+
+#if IS_ENABLED(CONFIG_IMX_SCMI_MISC_EXT)
+int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val);
+int scmi_imx_misc_ctrl_set(u32 id, u32 val);
+#else
+static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline int scmi_imx_misc_ctrl_set(u32 id, u32 val);
+{
+ return -EOPNOTSUPP;
+}
+#endif
+#endif

--
2.37.1


2024-04-12 10:47:24

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH v3 1/6] Documentation: firmware-guide: add NXP i.MX95 SCMI documentation

From: Peng Fan <[email protected]>

Add NXP i.MX95 System Control Management Interface(SCMI) vendor
extensions protocol documentation.

Signed-off-by: Peng Fan <[email protected]>
---
Documentation/firmware-guide/index.rst | 10 +
Documentation/firmware-guide/nxp/imx95-scmi.rst | 877 ++++++++++++++++++++++++
Documentation/firmware-guide/nxp/index.rst | 10 +
3 files changed, 897 insertions(+)

diff --git a/Documentation/firmware-guide/index.rst b/Documentation/firmware-guide/index.rst
index 5355784ca0a2..8f66ae31337e 100644
--- a/Documentation/firmware-guide/index.rst
+++ b/Documentation/firmware-guide/index.rst
@@ -4,6 +4,9 @@
The Linux kernel firmware guide
===============================

+ACPI subsystem
+==============
+
This section describes the ACPI subsystem in Linux from firmware perspective.

.. toctree::
@@ -11,3 +14,10 @@ This section describes the ACPI subsystem in Linux from firmware perspective.

acpi/index

+NXP firmware
+============
+
+.. toctree::
+ :maxdepth: 1
+
+ nxp/index
diff --git a/Documentation/firmware-guide/nxp/imx95-scmi.rst b/Documentation/firmware-guide/nxp/imx95-scmi.rst
new file mode 100644
index 000000000000..bd87a961e4a5
--- /dev/null
+++ b/Documentation/firmware-guide/nxp/imx95-scmi.rst
@@ -0,0 +1,877 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+===============================================================================
+i.MX95 System Control and Management Interface(SCMI) Vendor Protocols Extension
+===============================================================================
+
+:Copyright: |copy| 2024 NXP
+
+:Author: Peng Fan <[email protected]>
+
+The System Manager (SM) is a low-level system function which runs on a System
+Control Processor (SCP) to support isolation and management of power domains,
+clocks, resets, sensors, pins, etc. on complex application processors. It often
+runs on a Cortex-M processor and provides an abstraction to many of the
+underlying features of the hardware. The primary purpose of the SM is to allow
+isolation between software running on different cores in the SoC. It does this
+by having exclusive access to critical resources such as those controlling
+power, clocks, reset, PMIC, etc. and then providing an RPC interface to those
+clients. This allows the SM to provide access control, arbitration, and
+aggregation policies for those shared critical resources.
+
+This document covers all the information necessary to understand, maintain,
+port, and deploy the SM on supported processors.
+
+The SM implements an interface compliant with the Arm SCMI 3.2 Specification
+with vendor specific extensions.
+
+SCMI_BBM: System Control and Management Interface Driver (BBM)
+==============================================================
+
+This protocol is intended provide access to the battery-backed module. This
+contains persistent storage (GPR), an RTC, and the ON/OFF button. The protocol
+can also provide access to similar functions implemented via external board
+components. The BBM protocol provides functions to:
+
+- Describe the protocol version.
+- Discover implementation attributes.
+- Read/write GPR
+- Discover the RTCs available in the system.
+- Read/write the RTC time in seconds and ticks
+- Set an alarm (per LM) in seconds
+- Get notifications on RTC update, alarm, or rollover.
+- Get notification on ON/OFF button activity.
+
+For most SoC, there is one on-chip RTC (e.g. in BBNSM) and this is RTC ID 0.
+Board code can add additional GPR and RTC.
+
+GPR are not aggregated. The RTC time is also not aggregated. Setting these
+sets for all so normally exclusive access would be granted to one agent for
+each. However, RTC alarms are maintained for each LM and the hardware is
+programmed with the next nearest alarm time. So only one agent in an LM should
+be given access rights to set an RTC alarm.
+
+Commands:
+_________
+
+PROTOCOL_VERSION
+~~~~~~~~~~~~~~~~
+
+message_id: 0x0
+protocol_id: 0x81
+
++---------------+--------------------------------------------------------------+
+|Return values |
++---------------+--------------------------------------------------------------+
+|Name |Description |
++---------------+--------------------------------------------------------------+
+|int32 status | See ARM SCMI Specification v3.2 section 4.1.4 for status |
+| | code definitions. |
++---------------+--------------------------------------------------------------+
+|uint32 version | For this revision of the specification, this value must be |
+| | 0x10000. |
++---------------+--------------------------------------------------------------+
+
+PROTOCOL_ATTRIBUTES
+~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x1
+protocol_id: 0x81
+
++---------------+--------------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status | See ARM SCMI Specification v3.2 section 4.1.4 for status |
+| | code definitions. |
++------------------+-----------------------------------------------------------+
+|uint32 attributes | Bits[31:8] Number of RTCs. |
+| | Bits[15:0] Number of persistent storage (GPR) words. |
++------------------+-----------------------------------------------------------+
+
+PROTOCOL_MESSAGE_ATTRIBUTES
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x2
+protocol_id: 0x81
+
++---------------+--------------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: in case the message is implemented and available |
+| |to use. |
+| |NOT_FOUND: if the message identified by message_id is |
+| |invalid or not implemented |
++------------------+-----------------------------------------------------------+
+|uint32 attributes |Flags that are associated with a specific function in the |
+| |protocol. For all functions in this protocol, this |
+| |parameter has a value of 0 |
++------------------+-----------------------------------------------------------+
+
+BBM_GPR_SET
+~~~~~~~~~~~
+
+message_id: 0x3
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of GPR to write |
++------------------+-----------------------------------------------------------+
+|uint32 value |32-bit value to write to the GPR |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the GPR was successfully written. |
+| |NOT_FOUND: if the index is not valid. |
+| |DENIED: if the agent does not have permission to write |
+| |the specified GPR |
++------------------+-----------------------------------------------------------+
+
+BBM_GPR_GET
+~~~~~~~~~~~
+
+message_id: 0x4
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of GPR to read |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the GPR was successfully written. |
+| |NOT_FOUND: if the index is not valid. |
+| |DENIED: if the agent does not have permission to write |
+| |the specified GPR. |
++------------------+-----------------------------------------------------------+
+|uint32 value |32-bit value read from the GPR |
++------------------+-----------------------------------------------------------+
+
+BBM_RTC_ATTRIBUTES
+~~~~~~~~~~~~~~~~~~
+
+message_id: 0x5
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of RTC |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: returned the attributes. |
+| |NOT_FOUND: Index is invalid. |
++------------------+-----------------------------------------------------------+
+|uint32 attributes |Bit[31:24] Bit width of RTC seconds. |
+| |Bit[23:16] Bit width of RTC ticks. |
+| |Bits[15:0] RTC ticks per second |
++------------------+-----------------------------------------------------------+
+|uint8 name[16] |Null-terminated ASCII string of up to 16 bytes in length |
+| |describing the RTC name |
++------------------+-----------------------------------------------------------+
+
+BBM_RTC_TIME_SET
+~~~~~~~~~~~~~~~~
+
+message_id: 0x6
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of RTC |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Bits[31:1] Reserved, must be zero. |
+| |Bit[0] RTC time format: |
+| |Set to 1 if the time is in ticks. |
+| |Set to 0 if the time is in seconds |
++------------------+-----------------------------------------------------------+
+|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds/ticks. |
+| |Upper word: Upper 32 bits of the time in seconds/ticks. |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: RTC time was successfully set. |
+| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
+| |INVALID_PARAMETERS: time is not valid |
+| |(beyond the range of the RTC). |
+| |DENIED: the agent does not have permission to set the RTC. |
++------------------+-----------------------------------------------------------+
+
+BBM_RTC_TIME_GET
+~~~~~~~~~~~~~~~~
+
+message_id: 0x7
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of RTC |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Bits[31:1] Reserved, must be zero. |
+| |Bit[0] RTC time format: |
+| |Set to 1 if the time is in ticks. |
+| |Set to 0 if the time is in seconds |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: RTC time was successfully set. |
+| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
++------------------+-----------------------------------------------------------+
+|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds/ticks. |
+| |Upper word: Upper 32 bits of the time in seconds/ticks. |
++------------------+-----------------------------------------------------------+
+
+BBM_RTC_ALARM_SET
+~~~~~~~~~~~~~~~~~
+
+message_id: 0x8
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of RTC |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Bits[31:1] Reserved, must be zero. |
+| |Bit[0] RTC enable flag: |
+| |Set to 1 if the RTC alarm should be enabled. |
+| |Set to 0 if the RTC alarm should be disabled |
++------------------+-----------------------------------------------------------+
+|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds. |
+| |Upper word: Upper 32 bits of the time in seconds. |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: RTC time was successfully set. |
+| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
+| |INVALID_PARAMETERS: time is not valid |
+| |(beyond the range of the RTC). |
+| |DENIED: the agent does not have permission to set the RTC |
+| |alarm |
++------------------+-----------------------------------------------------------+
+
+BBM_BUTTON_GET
+~~~~~~~~~~~~~~
+
+message_id: 0x9
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the button status was read. |
+| |Other value: ARM SCMI Specification v3.2 section 4.1.4. |
++------------------+-----------------------------------------------------------+
+|uint32 state |State of the ON/OFF button |
++------------------+-----------------------------------------------------------+
+
+BBM_RTC_NOTIFY
+~~~~~~~~~~~~~~
+
+message_id: 0xA
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of RTC |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Notification flags |
+| |Bits[31:3] Reserved, must be zero. |
+| |Bit[2] Update enable: |
+| |Set to 1 to send notification. |
+| |Set to 0 if no notification. |
+| |Bit[1] Rollover enable: |
+| |Set to 1 to send notification. |
+| |Set to 0 if no notification. |
+| |Bit[0] Alarm enable: |
+| |Set to 1 to send notification. |
+| |Set to 0 if no notification |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: notification configuration was successfully |
+| |updated. |
+| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
+| |DENIED: the agent does not have permission to request RTC |
+| |notifications. |
++------------------+-----------------------------------------------------------+
+
+BBM_BUTTON_NOTIFY
+~~~~~~~~~~~~~~~~~
+
+message_id: 0xB
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Notification flags |
+| |Bits[31:1] Reserved, must be zero. |
+| |Bit[0] Enable button: |
+| |Set to 1 to send notification. |
+| |Set to 0 if no notification |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: notification configuration was successfully |
+| |updated. |
+| |DENIED: the agent does not have permission to request |
+| |button notifications. |
++------------------+-----------------------------------------------------------+
+
+NEGOTIATE_PROTOCOL_VERSION
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x10
+protocol_id: 0x81
+
++--------------------+---------------------------------------------------------+
+|Parameters |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|uint32 version |The negotiated protocol version the agent intends to use |
++--------------------+---------------------------------------------------------+
+|Return values |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|int32 status |SUCCESS: if the negotiated protocol version is supported |
+| |by the platform. All commands, responses, and |
+| |notifications post successful return of this command must|
+| |comply with the negotiated version. |
+| |NOT_SUPPORTED: if the protocol version is not supported. |
++--------------------+---------------------------------------------------------+
+
+Notifications
+_____________
+
+BBM_RTC_EVENT
+~~~~~~~~~~~~~
+
+message_id: 0x0
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 flags |RTC events: |
+| |Bits[31:2] Reserved, must be zero. |
+| |Bit[1] RTC rollover notification: |
+| |1 RTC rollover detected. |
+| |0 no RTC rollover detected. |
+| |Bit[0] RTC alarm notification: |
+| |1 RTC alarm generated. |
+| |0 no RTC alarm generated. |
++------------------+-----------------------------------------------------------+
+
+BBM_BUTTON_EVENT
+~~~~~~~~~~~~~~~~
+
+message_id: 0x1
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 flags |RTC events: |
++------------------+-----------------------------------------------------------+
+| |Button events: |
+| |Bits[31:1] Reserved, must be zero. |
+| |Bit[0] Button notification: |
+| |1 button change detected. |
+| |0 no button change detected. |
++------------------+-----------------------------------------------------------+
+
+SCMI_MISC: System Control and Management Interface Driver (MISC)
+================================================================
+
+Provides misc. functions. This includes controls that are misc. settings/actions
+that must be exposed from the SM to agents. They are device specific and are
+usually define to access bit fields in various mix block control modules,
+IOMUX_GPR, and other GPR/CSR owned by the SM. This protocol supports the
+following functions:
+
+- Describe the protocol version.
+- Discover implementation attributes.
+- Set/Get a control.
+- Initiate an action on a control.
+- Obtain platform (i.e. SM) build information.
+- Obtain ROM passover data.
+- Read boot/shutdown/reset information for the LM or the system.
+
+Commands:
+_________
+
+PROTOCOL_VERSION
+~~~~~~~~~~~~~~~~
+
+message_id: 0x0
+protocol_id: 0x84
+
++---------------+--------------------------------------------------------------+
+|Return values |
++---------------+--------------------------------------------------------------+
+|Name |Description |
++---------------+--------------------------------------------------------------+
+|int32 status | See ARM SCMI Specification v3.2 section 4.1.4 for status |
+| | code definitions. |
++---------------+--------------------------------------------------------------+
+|uint32 version | For this revision of the specification, this value must be |
+| | 0x10000. |
++---------------+--------------------------------------------------------------+
+
+PROTOCOL_ATTRIBUTES
+~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x1
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |See ARM SCMI Specification v3.2 section 4.1.4 for status |
+| |code definitions. |
++------------------+-----------------------------------------------------------+
+|uint32 attributes |Protocol attributes: |
+| |Bits[31:24] Reserved, must be zero. |
+| |Bits[23:16] Number of reasons. |
+| |Bits[15:0] Number of controls |
++------------------+-----------------------------------------------------------+
+
+PROTOCOL_MESSAGE_ATTRIBUTES
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x2
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: in case the message is implemented and available |
+| |to use. |
+| |NOT_FOUND: if the message identified by message_id is |
+| |invalid or not implemented |
++------------------+-----------------------------------------------------------+
+|uint32 attributes |Flags that are associated with a specific function in the |
+| |protocol. For all functions in this protocol, this |
+| |parameter has a value of 0 |
++------------------+-----------------------------------------------------------+
+
+MISC_CONTROL_SET
+~~~~~~~~~~~~~~~~
+
+message_id: 0x3
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of the control |
++------------------+-----------------------------------------------------------+
+|uint32 num |Size of the value data in words |
++------------------+-----------------------------------------------------------+
+|uint32 val[8] |value data array |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the control was set successfully. |
+| |NOT_FOUND: if the index is not valid. |
+| |DENIED: if the agent does not have permission to set the |
+| |control |
++------------------+-----------------------------------------------------------+
+
+MISC_CONTROL_GET
+~~~~~~~~~~~~~~~~
+
+message_id: 0x4
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of the control |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the control was set successfully. |
+| |NOT_FOUND: if the index is not valid. |
+| |DENIED: if the agent does not have permission to get the |
+| |control |
++------------------+-----------------------------------------------------------+
+|uint32 num |Size of the return data in words |
++------------------+-----------------------------------------------------------+
+|uint32 val[8] |value data array |
++------------------+-----------------------------------------------------------+
+
+MISC_CONTROL_ACTION
+~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x5
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of the control |
++------------------+-----------------------------------------------------------+
+|uint32 action |Action for the control |
++------------------+-----------------------------------------------------------+
+|uint32 numarg |Size of the argument data |
++------------------+-----------------------------------------------------------+
+|uint32 arg[8] |Argument data array |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the action was set successfully. |
+| |NOT_FOUND: if the index is not valid. |
+| |DENIED: if the agent does not have permission to get the |
+| |control |
++------------------+-----------------------------------------------------------+
+|uint32 num |Size of the return data in words |
++------------------+-----------------------------------------------------------+
+|uint32 val[8] |value data array |
++------------------+-----------------------------------------------------------+
+
+MISC_DISCOVER_BUILD_INFO
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x6
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the build info was got successfully. |
+| |NOT_SUPPORTED: if the data is not available. |
++------------------+-----------------------------------------------------------+
+|uint32 buildnum |Build number |
++------------------+-----------------------------------------------------------+
+|uint32 buildcommit|Most significant 32 bits of the git commit hash |
++------------------+-----------------------------------------------------------+
+|uint8 date[16] |Date of build. Null terminated ASCII string of up to 16 |
+| |bytes in length |
++------------------+-----------------------------------------------------------+
+|uint8 time[16] |Time of build. Null terminated ASCII string of up to 16 |
+| |bytes in length |
++------------------+-----------------------------------------------------------+
+
+MISC_ROM_PASSOVER_GET
+~~~~~~~~~~~~~~~~~~~~~
+
+This function is used to obtain the ROM passover data. The returned block of
+words is structured as defined in the ROM passover section in the SoC RM.
+
+message_id: 0x7
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if the data was got successfully. |
+| |NOT_SUPPORTED: if the data is not available. |
++------------------+-----------------------------------------------------------+
+|uint32 num |Size of the passover data in words |
++------------------+-----------------------------------------------------------+
+|uint32_t data[8] |Passover data array |
++------------------+-----------------------------------------------------------+
+
+MISC_CONTROL_NOTIFY
+~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x8
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 index |Index of control |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Notification flags, varies by control |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: notification configuration was successfully |
+| |updated. |
+| |NOT_FOUND: control id not exists. |
+| |INVALID_PARAMETERS: if the input attributes flag specifies |
+| |unsupported or invalid configurations.. |
+| |DENIED: if the calling agent is not permitted to request |
+| |the notification. |
++------------------+-----------------------------------------------------------+
+
+MISC_REASON_ATTRIBUTES
+~~~~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x9
+protocol_id: 0x84
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 reasonid |Identifier for the reason |
++------------------+-----------------------------------------------------------+
+|Return values |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|int32 status |SUCCESS: if valid reason attributes are returned |
+| |NOT_FOUND: if reasonId pertains to a non-existent reason. |
++------------------+-----------------------------------------------------------+
+|uint32 attributes |Reason attributes. This parameter has the following |
+| |format: Bits[31:0] Reserved, must be zero |
+| |Bits[15:0] Number of persistent storage (GPR) words. |
++------------------+-----------------------------------------------------------+
+|uint8 name[16] |Null-terminated ASCII string of up to 16 bytes in length |
+| |describing the reason |
++------------------+-----------------------------------------------------------+
+
+MISC_RESET_REASON
+~~~~~~~~~~~~~~~~~
+
+message_id: 0xA
+protocol_id: 0x84
+
++--------------------+---------------------------------------------------------+
+|Parameters |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|uint32 flags |Reason flags. This parameter has the following format: |
+| |Bits[31:1] Reserved, must be zero. |
+| |Bit[0] System: |
+| |Set to 1 to return the system reason. |
+| |Set to 0 to return the LM reason |
++--------------------+---------------------------------------------------------+
+|Return values |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|int32 status |SUCCESS: reset reason return |
++--------------------+---------------------------------------------------------+
+|uint32 bootflags |Boot reason flags. This parameter has the format: |
+| |Bits[31] Valid. |
+| |Set to 1 if the entire reason is valid. |
+| |Set to 0 if the entire reason is not valid. |
+| |Bits[30:29] Reserved, must be zero. |
+| |Bit[28] Valid origin: |
+| |Set to 1 if the origin field is valid. |
+| |Set to 0 if the origin field is not valid. |
+| |Bits[27:24] Origin. |
+| |Bit[23] Valid err ID: |
+| |Set to 1 if the error ID field is valid. |
+| |Set to 0 if the error ID field is not valid. |
+| |Bits[22:8] Error ID. |
+| |Bit[7:0] Reason |
++--------------------+---------------------------------------------------------+
+|uint32 shutdownflags|Shutdown reason flags. This parameter has the format: |
+| |Bits[31] Valid. |
+| |Set to 1 if the entire reason is valid. |
+| |Set to 0 if the entire reason is not valid. |
+| |Bits[30:29] Number of valid extended info words. |
+| |Bit[28] Valid origin: |
+| |Set to 1 if the origin field is valid. |
+| |Set to 0 if the origin field is not valid. |
+| |Bits[27:24] Origin. |
+| |Bit[23] Valid err ID: |
+| |Set to 1 if the error ID field is valid. |
+| |Set to 0 if the error ID field is not valid. |
+| |Bits[22:8] Error ID. |
+| |Bit[7:0] Reason |
++--------------------+---------------------------------------------------------+
+|uint32 extinfo[8] |Array of extended info words |
++--------------------+---------------------------------------------------------+
+
+MISC_SI_INFO
+~~~~~~~~~~~~
+
+message_id: 0xB
+protocol_id: 0x84
+
++--------------------+---------------------------------------------------------+
+|Return values |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|int32 status |SUCCESS: silicon info return |
++--------------------+---------------------------------------------------------+
+|uint32 deviceid |Silicon specific device ID |
++--------------------+---------------------------------------------------------+
+|uint32 sirev |Silicon specific revision |
++--------------------+---------------------------------------------------------+
+|uint32 partnum |Silicon specific part number |
++--------------------+---------------------------------------------------------+
+|uint8 siname[16] |Silicon name/revision. Null terminated ASCII string of up|
+| |to 16 bytes in length |
++--------------------+---------------------------------------------------------+
+
+MISC_CFG_INFO
+~~~~~~~~~~~~~
+
+message_id: 0xC
+protocol_id: 0x84
+
++--------------------+---------------------------------------------------------+
+|Return values |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|int32 status |SUCCESS: config name return |
+| |NOT_SUPPORTED: name not available |
++--------------------+---------------------------------------------------------+
+|uint32 msel |Mode selector value |
++--------------------+---------------------------------------------------------+
+|uint8 cfgname[16] |config file basename. Null terminated ASCII string of up |
+| |to 16 bytes in length |
++--------------------+---------------------------------------------------------+
+
+MISC_SYSLOG
+~~~~~~~~~~~
+
+message_id: 0xD
+protocol_id: 0x84
+
++--------------------+---------------------------------------------------------+
+|Parameters |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|uint32 flags |Device specific flags that might impact the data returned|
+| |or clearing of the data |
++--------------------+---------------------------------------------------------+
+|uint32 logindex |Index to the first log word. Will be the first element in|
+| |the return array |
++--------------------+---------------------------------------------------------+
+|Return values |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|int32 status |SUCCESS: reset reason return |
++--------------------+---------------------------------------------------------+
+|uint32 numLogflags |Descriptor for the log data returned by this call. |
+| |Bits[31:20] Number of remaining log words. |
+| |Bits[15:12] Reserved, must be zero. |
+| |Bits[11:0] Number of log words that are returned by this |
+| |call |
++--------------------+---------------------------------------------------------+
+|uint32 syslog[16] |Log data array |
++--------------------+---------------------------------------------------------+
+
+NEGOTIATE_PROTOCOL_VERSION
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+message_id: 0x10
+protocol_id: 0x84
+
++--------------------+---------------------------------------------------------+
+|Parameters |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|uint32 version |The negotiated protocol version the agent intends to use |
++--------------------+---------------------------------------------------------+
+|Return values |
++--------------------+---------------------------------------------------------+
+|Name |Description |
++--------------------+---------------------------------------------------------+
+|int32 status |SUCCESS: if the negotiated protocol version is supported |
+| |by the platform. All commands, responses, and |
+| |notifications post successful return of this command must|
+| |comply with the negotiated version. |
+| |NOT_SUPPORTED: if the protocol version is not supported. |
++--------------------+---------------------------------------------------------+
+
+Notifications
+_____________
+
+MISC_CONTROL_EVENT
+~~~~~~~~~~~~~~~~~~
+
+message_id: 0x0
+protocol_id: 0x81
+
++------------------+-----------------------------------------------------------+
+|Parameters |
++------------------+-----------------------------------------------------------+
+|Name |Description |
++------------------+-----------------------------------------------------------+
+|uint32 ctrlid |Identifier for the control that caused the event. |
++------------------+-----------------------------------------------------------+
+|uint32 flags |Event flags, varies by control. |
++------------------+-----------------------------------------------------------+
+
diff --git a/Documentation/firmware-guide/nxp/index.rst b/Documentation/firmware-guide/nxp/index.rst
new file mode 100644
index 000000000000..b38c980a50c6
--- /dev/null
+++ b/Documentation/firmware-guide/nxp/index.rst
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+====================
+NXP Firmware Support
+====================
+
+.. toctree::
+ :maxdepth: 1
+
+ imx95-scmi

--
2.37.1


2024-04-12 10:47:57

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH v3 4/6] firmware: arm_scmi: add initial support for i.MX MISC protocol

From: Peng Fan <[email protected]>

i.MX95 System Manager(SM) firmware includes a SCMI vendor protocol, SCMI
MISC protocol which includes controls that are misc settings/actions that
must be exposed from the SM to agents. They are device specific and are
usually define to access bit fields in various mix block control modules,
IOMUX_GPR, and other General Purpose registers, Control Status Registers
owned by the SM.

Signed-off-by: Peng Fan <[email protected]>
---
drivers/firmware/arm_scmi/Kconfig | 10 ++
drivers/firmware/arm_scmi/Makefile | 1 +
drivers/firmware/arm_scmi/imx-sm-misc.c | 305 ++++++++++++++++++++++++++++++++
include/linux/scmi_imx_protocol.h | 17 ++
4 files changed, 333 insertions(+)

diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig
index 56d11c9d9f47..bfeae92f6420 100644
--- a/drivers/firmware/arm_scmi/Kconfig
+++ b/drivers/firmware/arm_scmi/Kconfig
@@ -191,3 +191,13 @@ config IMX_SCMI_BBM_EXT
and BUTTON.

This driver can also be built as a module.
+
+config IMX_SCMI_MISC_EXT
+ tristate "i.MX SCMI MISC EXTENSION"
+ depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
+ default y if ARCH_MXC
+ help
+ This enables i.MX System MISC control logic such as gpio expander
+ wakeup
+
+ This driver can also be built as a module.
diff --git a/drivers/firmware/arm_scmi/Makefile b/drivers/firmware/arm_scmi/Makefile
index 327687acf857..a23fde721222 100644
--- a/drivers/firmware/arm_scmi/Makefile
+++ b/drivers/firmware/arm_scmi/Makefile
@@ -12,6 +12,7 @@ scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_OPTEE) += optee.o
scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o powercap.o
scmi-protocols-$(CONFIG_IMX_SCMI_BBM_EXT) += imx-sm-bbm.o
+scmi-protocols-$(CONFIG_IMX_SCMI_MISC_EXT) += imx-sm-misc.o
scmi-module-objs := $(scmi-driver-y) $(scmi-protocols-y) $(scmi-transport-y)

obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-core.o
diff --git a/drivers/firmware/arm_scmi/imx-sm-misc.c b/drivers/firmware/arm_scmi/imx-sm-misc.c
new file mode 100644
index 000000000000..1b0ec2281518
--- /dev/null
+++ b/drivers/firmware/arm_scmi/imx-sm-misc.c
@@ -0,0 +1,305 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * System control and Management Interface (SCMI) NXP MISC Protocol
+ *
+ * Copyright 2024 NXP
+ */
+
+#define pr_fmt(fmt) "SCMI Notifications MISC - " fmt
+
+#include <linux/bits.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/scmi_protocol.h>
+#include <linux/scmi_imx_protocol.h>
+
+#include "protocols.h"
+#include "notify.h"
+
+#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x10000
+
+enum scmi_imx_misc_protocol_cmd {
+ SCMI_IMX_MISC_CTRL_SET = 0x3,
+ SCMI_IMX_MISC_CTRL_GET = 0x4,
+ SCMI_IMX_MISC_CTRL_NOTIFY = 0x8,
+};
+
+struct scmi_imx_misc_info {
+ u32 version;
+ u32 nr_dev_ctrl;
+ u32 nr_brd_ctrl;
+ u32 nr_reason;
+};
+
+struct scmi_msg_imx_misc_protocol_attributes {
+ __le32 attributes;
+};
+
+#define GET_BRD_CTRLS_NR(x) le32_get_bits((x), GENMASK(31, 24))
+#define GET_REASONS_NR(x) le32_get_bits((x), GENMASK(23, 16))
+#define GET_DEV_CTRLS_NR(x) le32_get_bits((x), GENMASK(15, 0))
+#define BRD_CTRL_START_ID BIT(15)
+
+struct scmi_imx_misc_ctrl_set_in {
+ __le32 id;
+ __le32 num;
+ __le32 value[MISC_MAX_VAL];
+};
+
+struct scmi_imx_misc_ctrl_notify_in {
+ __le32 ctrl_id;
+ __le32 flags;
+};
+
+struct scmi_imx_misc_ctrl_notify_payld {
+ __le32 ctrl_id;
+ __le32 flags;
+};
+
+struct scmi_imx_misc_ctrl_get_out {
+ __le32 num;
+ __le32 *val;
+};
+
+static int scmi_imx_misc_attributes_get(const struct scmi_protocol_handle *ph,
+ struct scmi_imx_misc_info *mi)
+{
+ int ret;
+ struct scmi_xfer *t;
+ struct scmi_msg_imx_misc_protocol_attributes *attr;
+
+ ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0,
+ sizeof(*attr), &t);
+ if (ret)
+ return ret;
+
+ attr = t->rx.buf;
+
+ ret = ph->xops->do_xfer(ph, t);
+ if (!ret) {
+ mi->nr_dev_ctrl = GET_DEV_CTRLS_NR(attr->attributes);
+ mi->nr_brd_ctrl = GET_BRD_CTRLS_NR(attr->attributes);
+ mi->nr_reason = GET_REASONS_NR(attr->attributes);
+ dev_info(ph->dev, "i.MX MISC NUM DEV CTRL: %d, NUM BRD CTRL: %d,NUM Reason: %d\n",
+ mi->nr_dev_ctrl, mi->nr_brd_ctrl, mi->nr_reason);
+ }
+
+ ph->xops->xfer_put(ph, t);
+
+ return ret;
+}
+
+static int scmi_imx_misc_ctrl_validate_id(const struct scmi_protocol_handle *ph,
+ u32 ctrl_id)
+{
+ struct scmi_imx_misc_info *mi = ph->get_priv(ph);
+
+ if ((ctrl_id < BRD_CTRL_START_ID) && (ctrl_id > mi->nr_dev_ctrl))
+ return -EINVAL;
+ if (ctrl_id >= BRD_CTRL_START_ID + mi->nr_brd_ctrl)
+ return -EINVAL;
+
+ return 0;
+}
+
+static int scmi_imx_misc_ctrl_notify(const struct scmi_protocol_handle *ph,
+ u32 ctrl_id, u32 flags)
+{
+ struct scmi_imx_misc_ctrl_notify_in *in;
+ struct scmi_xfer *t;
+ int ret;
+
+ ret = scmi_imx_misc_ctrl_validate_id(ph, ctrl_id);
+ if (ret)
+ return ret;
+
+ ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_NOTIFY,
+ sizeof(*in), 0, &t);
+ if (ret)
+ return ret;
+
+ in = t->tx.buf;
+ in->ctrl_id = cpu_to_le32(ctrl_id);
+ in->flags = cpu_to_le32(flags);
+
+ ret = ph->xops->do_xfer(ph, t);
+
+ ph->xops->xfer_put(ph, t);
+
+ return ret;
+}
+
+static int
+scmi_imx_misc_ctrl_set_notify_enabled(const struct scmi_protocol_handle *ph,
+ u8 evt_id, u32 src_id, bool enable)
+{
+ int ret;
+
+ ret = scmi_imx_misc_ctrl_notify(ph, src_id, enable ? evt_id : 0);
+ if (ret)
+ dev_err(ph->dev, "FAIL_ENABLED - evt[%X] src[%d] - ret:%d\n",
+ evt_id, src_id, ret);
+
+ return ret;
+}
+
+static int scmi_imx_misc_ctrl_get_num_sources(const struct scmi_protocol_handle *ph)
+{
+ return GENMASK(15, 0);
+}
+
+static void *
+scmi_imx_misc_ctrl_fill_custom_report(const struct scmi_protocol_handle *ph,
+ u8 evt_id, ktime_t timestamp,
+ const void *payld, size_t payld_sz,
+ void *report, u32 *src_id)
+{
+ const struct scmi_imx_misc_ctrl_notify_payld *p = payld;
+ struct scmi_imx_misc_ctrl_notify_report *r = report;
+
+ if (sizeof(*p) != payld_sz)
+ return NULL;
+
+ r->timestamp = timestamp;
+ r->ctrl_id = p->ctrl_id;
+ r->flags = p->flags;
+ *src_id = r->ctrl_id;
+ dev_dbg(ph->dev, "%s: ctrl_id: %d flags: %d\n", __func__,
+ r->ctrl_id, r->flags);
+
+ return r;
+}
+
+static const struct scmi_event_ops scmi_imx_misc_event_ops = {
+ .get_num_sources = scmi_imx_misc_ctrl_get_num_sources,
+ .set_notify_enabled = scmi_imx_misc_ctrl_set_notify_enabled,
+ .fill_custom_report = scmi_imx_misc_ctrl_fill_custom_report,
+};
+
+static const struct scmi_event scmi_imx_misc_events[] = {
+ {
+ .id = SCMI_EVENT_IMX_MISC_CONTROL_DISABLED,
+ .max_payld_sz = sizeof(struct scmi_imx_misc_ctrl_notify_payld),
+ .max_report_sz = sizeof(struct scmi_imx_misc_ctrl_notify_report),
+ },
+ {
+ .id = SCMI_EVENT_IMX_MISC_CONTROL_FALLING_EDGE,
+ .max_payld_sz = sizeof(struct scmi_imx_misc_ctrl_notify_payld),
+ .max_report_sz = sizeof(struct scmi_imx_misc_ctrl_notify_report),
+ },
+ {
+ .id = SCMI_EVENT_IMX_MISC_CONTROL_RISING_EDGE,
+ .max_payld_sz = sizeof(struct scmi_imx_misc_ctrl_notify_payld),
+ .max_report_sz = sizeof(struct scmi_imx_misc_ctrl_notify_report),
+ }
+};
+
+static struct scmi_protocol_events scmi_imx_misc_protocol_events = {
+ .queue_sz = SCMI_PROTO_QUEUE_SZ,
+ .ops = &scmi_imx_misc_event_ops,
+ .evts = scmi_imx_misc_events,
+ .num_events = ARRAY_SIZE(scmi_imx_misc_events),
+};
+
+static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph)
+{
+ struct scmi_imx_misc_info *minfo;
+ u32 version;
+ int ret;
+
+ ret = ph->xops->version_get(ph, &version);
+ if (ret)
+ return ret;
+
+ dev_info(ph->dev, "NXP SM MISC Version %d.%d\n",
+ PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version));
+
+ minfo = devm_kzalloc(ph->dev, sizeof(*minfo), GFP_KERNEL);
+ if (!minfo)
+ return -ENOMEM;
+
+ ret = scmi_imx_misc_attributes_get(ph, minfo);
+ if (ret)
+ return ret;
+
+ return ph->set_priv(ph, minfo, version);
+}
+
+static int scmi_imx_misc_ctrl_get(const struct scmi_protocol_handle *ph,
+ u32 ctrl_id, u32 *num, u32 *val)
+{
+ struct scmi_imx_misc_ctrl_get_out *out;
+ struct scmi_xfer *t;
+ int ret, i;
+
+ ret = scmi_imx_misc_ctrl_validate_id(ph, ctrl_id);
+ if (ret)
+ return ret;
+
+ ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_GET, sizeof(u32),
+ 0, &t);
+ if (ret)
+ return ret;
+
+ put_unaligned_le32(ctrl_id, t->tx.buf);
+ ret = ph->xops->do_xfer(ph, t);
+ if (!ret) {
+ out = t->rx.buf;
+ *num = le32_to_cpu(out->num);
+ for (i = 0; i < *num && i < MISC_MAX_VAL; i++)
+ val[i] = le32_to_cpu(out->val[i]);
+ }
+
+ ph->xops->xfer_put(ph, t);
+
+ return ret;
+}
+
+static int scmi_imx_misc_ctrl_set(const struct scmi_protocol_handle *ph,
+ u32 ctrl_id, u32 num, u32 *val)
+{
+ struct scmi_imx_misc_ctrl_set_in *in;
+ struct scmi_xfer *t;
+ int ret, i;
+
+ ret = scmi_imx_misc_ctrl_validate_id(ph, ctrl_id);
+ if (ret)
+ return ret;
+
+ if (num > MISC_MAX_VAL)
+ return -EINVAL;
+
+ ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_SET, sizeof(*in),
+ 0, &t);
+ if (ret)
+ return ret;
+
+ in = t->tx.buf;
+ in->id = cpu_to_le32(ctrl_id);
+ in->num = cpu_to_le32(num);
+ for (i = 0; i < num; i++)
+ in->value[i] = cpu_to_le32(val[i]);
+
+ ret = ph->xops->do_xfer(ph, t);
+
+ ph->xops->xfer_put(ph, t);
+
+ return ret;
+}
+
+static const struct scmi_imx_misc_proto_ops scmi_imx_misc_proto_ops = {
+ .misc_ctrl_set = scmi_imx_misc_ctrl_set,
+ .misc_ctrl_get = scmi_imx_misc_ctrl_get,
+};
+
+static const struct scmi_protocol scmi_imx_misc = {
+ .id = SCMI_PROTOCOL_IMX_MISC,
+ .owner = THIS_MODULE,
+ .instance_init = &scmi_imx_misc_protocol_init,
+ .ops = &scmi_imx_misc_proto_ops,
+ .events = &scmi_imx_misc_protocol_events,
+ .supported_version = SCMI_PROTOCOL_SUPPORTED_VERSION,
+};
+module_scmi_protocol(scmi_imx_misc);
diff --git a/include/linux/scmi_imx_protocol.h b/include/linux/scmi_imx_protocol.h
index 90ce011a4429..a69bd4a20f0f 100644
--- a/include/linux/scmi_imx_protocol.h
+++ b/include/linux/scmi_imx_protocol.h
@@ -13,8 +13,14 @@
#include <linux/notifier.h>
#include <linux/types.h>

+#define SCMI_PAYLOAD_LEN 100
+
+#define SCMI_ARRAY(X, Y) ((SCMI_PAYLOAD_LEN - (X)) / sizeof(Y))
+#define MISC_MAX_VAL SCMI_ARRAY(8, uint32_t)
+
enum scmi_nxp_protocol {
SCMI_PROTOCOL_IMX_BBM = 0x81,
+ SCMI_PROTOCOL_IMX_MISC = 0x84,
};

struct scmi_imx_bbm_proto_ops {
@@ -42,4 +48,15 @@ struct scmi_imx_bbm_notif_report {
unsigned int rtc_id;
unsigned int rtc_evt;
};
+
+struct scmi_imx_misc_ctrl_notify_report {
+ ktime_t timestamp;
+ unsigned int ctrl_id;
+ unsigned int flags;
+};
+
+struct scmi_imx_misc_proto_ops {
+ int (*misc_ctrl_set)(const struct scmi_protocol_handle *ph, u32 id, u32 num, u32 *val);
+ int (*misc_ctrl_get)(const struct scmi_protocol_handle *ph, u32 id, u32 *num, u32 *val);
+};
#endif

--
2.37.1


2024-04-24 03:12:13

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH v3 1/6] Documentation: firmware-guide: add NXP i.MX95 SCMI documentation

Hi Sudeep,

> Subject: [PATCH v3 1/6] Documentation: firmware-guide: add NXP i.MX95
> SCMI documentation

Does this documentation looks good to you?

Thanks,
Peng.
>
> From: Peng Fan <[email protected]>
>
> Add NXP i.MX95 System Control Management Interface(SCMI) vendor
> extensions protocol documentation.
>
> Signed-off-by: Peng Fan <[email protected]>
> ---
> Documentation/firmware-guide/index.rst | 10 +
> Documentation/firmware-guide/nxp/imx95-scmi.rst | 877
> ++++++++++++++++++++++++
> Documentation/firmware-guide/nxp/index.rst | 10 +
> 3 files changed, 897 insertions(+)
>
> diff --git a/Documentation/firmware-guide/index.rst
> b/Documentation/firmware-guide/index.rst
> index 5355784ca0a2..8f66ae31337e 100644
> --- a/Documentation/firmware-guide/index.rst
> +++ b/Documentation/firmware-guide/index.rst
> @@ -4,6 +4,9 @@
> The Linux kernel firmware guide
> ===============================
>
> +ACPI subsystem
> +==============
> +
> This section describes the ACPI subsystem in Linux from firmware perspective.
>
> .. toctree::
> @@ -11,3 +14,10 @@ This section describes the ACPI subsystem in Linux
> from firmware perspective.
>
> acpi/index
>
> +NXP firmware
> +============
> +
> +.. toctree::
> + :maxdepth: 1
> +
> + nxp/index
> diff --git a/Documentation/firmware-guide/nxp/imx95-scmi.rst
> b/Documentation/firmware-guide/nxp/imx95-scmi.rst
> new file mode 100644
> index 000000000000..bd87a961e4a5
> --- /dev/null
> +++ b/Documentation/firmware-guide/nxp/imx95-scmi.rst
> @@ -0,0 +1,877 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +.. include:: <isonum.txt>
> +
> +=================================================================
> ==============
> +i.MX95 System Control and Management Interface(SCMI) Vendor Protocols
> Extension
> +=================================================================
> ==============
> +
> +:Copyright: |copy| 2024 NXP
> +
> +:Author: Peng Fan <[email protected]>
> +
> +The System Manager (SM) is a low-level system function which runs on a
> System
> +Control Processor (SCP) to support isolation and management of power
> domains,
> +clocks, resets, sensors, pins, etc. on complex application processors. It often
> +runs on a Cortex-M processor and provides an abstraction to many of the
> +underlying features of the hardware. The primary purpose of the SM is to
> allow
> +isolation between software running on different cores in the SoC. It does this
> +by having exclusive access to critical resources such as those controlling
> +power, clocks, reset, PMIC, etc. and then providing an RPC interface to those
> +clients. This allows the SM to provide access control, arbitration, and
> +aggregation policies for those shared critical resources.
> +
> +This document covers all the information necessary to understand, maintain,
> +port, and deploy the SM on supported processors.
> +
> +The SM implements an interface compliant with the Arm SCMI 3.2
> Specification
> +with vendor specific extensions.
> +
> +SCMI_BBM: System Control and Management Interface Driver (BBM)
> +==============================================================
> +
> +This protocol is intended provide access to the battery-backed module. This
> +contains persistent storage (GPR), an RTC, and the ON/OFF button. The
> protocol
> +can also provide access to similar functions implemented via external board
> +components. The BBM protocol provides functions to:
> +
> +- Describe the protocol version.
> +- Discover implementation attributes.
> +- Read/write GPR
> +- Discover the RTCs available in the system.
> +- Read/write the RTC time in seconds and ticks
> +- Set an alarm (per LM) in seconds
> +- Get notifications on RTC update, alarm, or rollover.
> +- Get notification on ON/OFF button activity.
> +
> +For most SoC, there is one on-chip RTC (e.g. in BBNSM) and this is RTC ID 0.
> +Board code can add additional GPR and RTC.
> +
> +GPR are not aggregated. The RTC time is also not aggregated. Setting these
> +sets for all so normally exclusive access would be granted to one agent for
> +each. However, RTC alarms are maintained for each LM and the hardware is
> +programmed with the next nearest alarm time. So only one agent in an LM
> should
> +be given access rights to set an RTC alarm.
> +
> +Commands:
> +_________
> +
> +PROTOCOL_VERSION
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x0
> +protocol_id: 0x81
> +
> ++---------------+--------------------------------------------------------------+
> +|Return values |
> ++---------------+--------------------------------------------------------------+
> +|Name |Description |
> ++---------------+--------------------------------------------------------------+
> +|int32 status | See ARM SCMI Specification v3.2 section 4.1.4 for status
> |
> +| | code definitions. |
> ++---------------+--------------------------------------------------------------+
> +|uint32 version | For this revision of the specification, this value must be |
> +| | 0x10000. |
> ++---------------+--------------------------------------------------------------+
> +
> +PROTOCOL_ATTRIBUTES
> +~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x1
> +protocol_id: 0x81
> +
> ++---------------+--------------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status | See ARM SCMI Specification v3.2 section 4.1.4 for status
> |
> +| | code definitions. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 attributes | Bits[31:8] Number of RTCs. |
> +| | Bits[15:0] Number of persistent storage (GPR) words. |
> ++------------------+-----------------------------------------------------------+
> +
> +PROTOCOL_MESSAGE_ATTRIBUTES
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x2
> +protocol_id: 0x81
> +
> ++---------------+--------------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: in case the message is implemented and
> available |
> +| |to use. |
> +| |NOT_FOUND: if the message identified by message_id is |
> +| |invalid or not implemented |
> ++------------------+-----------------------------------------------------------+
> +|uint32 attributes |Flags that are associated with a specific function in the |
> +| |protocol. For all functions in this protocol, this |
> +| |parameter has a value of 0 |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_GPR_SET
> +~~~~~~~~~~~
> +
> +message_id: 0x3
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of GPR to write |
> ++------------------+-----------------------------------------------------------+
> +|uint32 value |32-bit value to write to the GPR |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the GPR was successfully written. |
> +| |NOT_FOUND: if the index is not valid. |
> +| |DENIED: if the agent does not have permission to write |
> +| |the specified GPR |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_GPR_GET
> +~~~~~~~~~~~
> +
> +message_id: 0x4
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of GPR to read |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the GPR was successfully written. |
> +| |NOT_FOUND: if the index is not valid. |
> +| |DENIED: if the agent does not have permission to write |
> +| |the specified GPR. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 value |32-bit value read from the GPR |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_RTC_ATTRIBUTES
> +~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x5
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of RTC |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: returned the attributes. |
> +| |NOT_FOUND: Index is invalid. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 attributes |Bit[31:24] Bit width of RTC seconds. |
> +| |Bit[23:16] Bit width of RTC ticks. |
> +| |Bits[15:0] RTC ticks per second |
> ++------------------+-----------------------------------------------------------+
> +|uint8 name[16] |Null-terminated ASCII string of up to 16 bytes in length
> |
> +| |describing the RTC name |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_RTC_TIME_SET
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x6
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of RTC |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Bits[31:1] Reserved, must be zero. |
> +| |Bit[0] RTC time format: |
> +| |Set to 1 if the time is in ticks. |
> +| |Set to 0 if the time is in seconds |
> ++------------------+-----------------------------------------------------------+
> +|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds/ticks.
> |
> +| |Upper word: Upper 32 bits of the time in seconds/ticks. |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: RTC time was successfully set. |
> +| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
> +| |INVALID_PARAMETERS: time is not valid |
> +| |(beyond the range of the RTC). |
> +| |DENIED: the agent does not have permission to set the RTC. |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_RTC_TIME_GET
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x7
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of RTC |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Bits[31:1] Reserved, must be zero. |
> +| |Bit[0] RTC time format: |
> +| |Set to 1 if the time is in ticks. |
> +| |Set to 0 if the time is in seconds |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: RTC time was successfully set. |
> +| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds/ticks.
> |
> +| |Upper word: Upper 32 bits of the time in seconds/ticks. |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_RTC_ALARM_SET
> +~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x8
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of RTC |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Bits[31:1] Reserved, must be zero. |
> +| |Bit[0] RTC enable flag: |
> +| |Set to 1 if the RTC alarm should be enabled. |
> +| |Set to 0 if the RTC alarm should be disabled |
> ++------------------+-----------------------------------------------------------+
> +|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds. |
> +| |Upper word: Upper 32 bits of the time in seconds. |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: RTC time was successfully set. |
> +| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
> +| |INVALID_PARAMETERS: time is not valid |
> +| |(beyond the range of the RTC). |
> +| |DENIED: the agent does not have permission to set the RTC |
> +| |alarm |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_BUTTON_GET
> +~~~~~~~~~~~~~~
> +
> +message_id: 0x9
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the button status was read. |
> +| |Other value: ARM SCMI Specification v3.2 section 4.1.4. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 state |State of the ON/OFF button |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_RTC_NOTIFY
> +~~~~~~~~~~~~~~
> +
> +message_id: 0xA
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of RTC |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Notification flags |
> +| |Bits[31:3] Reserved, must be zero. |
> +| |Bit[2] Update enable: |
> +| |Set to 1 to send notification. |
> +| |Set to 0 if no notification. |
> +| |Bit[1] Rollover enable: |
> +| |Set to 1 to send notification. |
> +| |Set to 0 if no notification. |
> +| |Bit[0] Alarm enable: |
> +| |Set to 1 to send notification. |
> +| |Set to 0 if no notification |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: notification configuration was successfully |
> +| |updated. |
> +| |NOT_FOUND: rtcId pertains to a non-existent RTC. |
> +| |DENIED: the agent does not have permission to request RTC |
> +| |notifications. |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_BUTTON_NOTIFY
> +~~~~~~~~~~~~~~~~~
> +
> +message_id: 0xB
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Notification flags |
> +| |Bits[31:1] Reserved, must be zero. |
> +| |Bit[0] Enable button: |
> +| |Set to 1 to send notification. |
> +| |Set to 0 if no notification |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: notification configuration was successfully |
> +| |updated. |
> +| |DENIED: the agent does not have permission to request |
> +| |button notifications. |
> ++------------------+-----------------------------------------------------------+
> +
> +NEGOTIATE_PROTOCOL_VERSION
> +~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x10
> +protocol_id: 0x81
> +
> ++--------------------+---------------------------------------------------------+
> +|Parameters |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|uint32 version |The negotiated protocol version the agent intends to
> use |
> ++--------------------+---------------------------------------------------------+
> +|Return values |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|int32 status |SUCCESS: if the negotiated protocol version is supported
> |
> +| |by the platform. All commands, responses, and |
> +| |notifications post successful return of this command must|
> +| |comply with the negotiated version. |
> +| |NOT_SUPPORTED: if the protocol version is not supported. |
> ++--------------------+---------------------------------------------------------+
> +
> +Notifications
> +_____________
> +
> +BBM_RTC_EVENT
> +~~~~~~~~~~~~~
> +
> +message_id: 0x0
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |RTC events: |
> +| |Bits[31:2] Reserved, must be zero. |
> +| |Bit[1] RTC rollover notification: |
> +| |1 RTC rollover detected. |
> +| |0 no RTC rollover detected. |
> +| |Bit[0] RTC alarm notification: |
> +| |1 RTC alarm generated. |
> +| |0 no RTC alarm generated. |
> ++------------------+-----------------------------------------------------------+
> +
> +BBM_BUTTON_EVENT
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x1
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |RTC events: |
> ++------------------+-----------------------------------------------------------+
> +| |Button events: |
> +| |Bits[31:1] Reserved, must be zero. |
> +| |Bit[0] Button notification: |
> +| |1 button change detected. |
> +| |0 no button change detected. |
> ++------------------+-----------------------------------------------------------+
> +
> +SCMI_MISC: System Control and Management Interface Driver (MISC)
> +================================================================
> +
> +Provides misc. functions. This includes controls that are misc.
> settings/actions
> +that must be exposed from the SM to agents. They are device specific and
> are
> +usually define to access bit fields in various mix block control modules,
> +IOMUX_GPR, and other GPR/CSR owned by the SM. This protocol supports
> the
> +following functions:
> +
> +- Describe the protocol version.
> +- Discover implementation attributes.
> +- Set/Get a control.
> +- Initiate an action on a control.
> +- Obtain platform (i.e. SM) build information.
> +- Obtain ROM passover data.
> +- Read boot/shutdown/reset information for the LM or the system.
> +
> +Commands:
> +_________
> +
> +PROTOCOL_VERSION
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x0
> +protocol_id: 0x84
> +
> ++---------------+--------------------------------------------------------------+
> +|Return values |
> ++---------------+--------------------------------------------------------------+
> +|Name |Description |
> ++---------------+--------------------------------------------------------------+
> +|int32 status | See ARM SCMI Specification v3.2 section 4.1.4 for status
> |
> +| | code definitions. |
> ++---------------+--------------------------------------------------------------+
> +|uint32 version | For this revision of the specification, this value must be |
> +| | 0x10000. |
> ++---------------+--------------------------------------------------------------+
> +
> +PROTOCOL_ATTRIBUTES
> +~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x1
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |See ARM SCMI Specification v3.2 section 4.1.4 for status
> |
> +| |code definitions. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 attributes |Protocol attributes: |
> +| |Bits[31:24] Reserved, must be zero. |
> +| |Bits[23:16] Number of reasons. |
> +| |Bits[15:0] Number of controls |
> ++------------------+-----------------------------------------------------------+
> +
> +PROTOCOL_MESSAGE_ATTRIBUTES
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x2
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: in case the message is implemented and
> available |
> +| |to use. |
> +| |NOT_FOUND: if the message identified by message_id is |
> +| |invalid or not implemented |
> ++------------------+-----------------------------------------------------------+
> +|uint32 attributes |Flags that are associated with a specific function in the |
> +| |protocol. For all functions in this protocol, this |
> +| |parameter has a value of 0 |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_CONTROL_SET
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x3
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of the control |
> ++------------------+-----------------------------------------------------------+
> +|uint32 num |Size of the value data in words |
> ++------------------+-----------------------------------------------------------+
> +|uint32 val[8] |value data array |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the control was set successfully. |
> +| |NOT_FOUND: if the index is not valid. |
> +| |DENIED: if the agent does not have permission to set the |
> +| |control |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_CONTROL_GET
> +~~~~~~~~~~~~~~~~
> +
> +message_id: 0x4
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of the control |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the control was set successfully. |
> +| |NOT_FOUND: if the index is not valid. |
> +| |DENIED: if the agent does not have permission to get the |
> +| |control |
> ++------------------+-----------------------------------------------------------+
> +|uint32 num |Size of the return data in words |
> ++------------------+-----------------------------------------------------------+
> +|uint32 val[8] |value data array |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_CONTROL_ACTION
> +~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x5
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of the control |
> ++------------------+-----------------------------------------------------------+
> +|uint32 action |Action for the control |
> ++------------------+-----------------------------------------------------------+
> +|uint32 numarg |Size of the argument data |
> ++------------------+-----------------------------------------------------------+
> +|uint32 arg[8] |Argument data array |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the action was set successfully. |
> +| |NOT_FOUND: if the index is not valid. |
> +| |DENIED: if the agent does not have permission to get the |
> +| |control |
> ++------------------+-----------------------------------------------------------+
> +|uint32 num |Size of the return data in words |
> ++------------------+-----------------------------------------------------------+
> +|uint32 val[8] |value data array |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_DISCOVER_BUILD_INFO
> +~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x6
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the build info was got successfully. |
> +| |NOT_SUPPORTED: if the data is not available. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 buildnum |Build number |
> ++------------------+-----------------------------------------------------------+
> +|uint32 buildcommit|Most significant 32 bits of the git commit hash
> |
> ++------------------+-----------------------------------------------------------+
> +|uint8 date[16] |Date of build. Null terminated ASCII string of up to 16 |
> +| |bytes in length |
> ++------------------+-----------------------------------------------------------+
> +|uint8 time[16] |Time of build. Null terminated ASCII string of up to 16 |
> +| |bytes in length |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_ROM_PASSOVER_GET
> +~~~~~~~~~~~~~~~~~~~~~
> +
> +This function is used to obtain the ROM passover data. The returned block of
> +words is structured as defined in the ROM passover section in the SoC RM.
> +
> +message_id: 0x7
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if the data was got successfully. |
> +| |NOT_SUPPORTED: if the data is not available. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 num |Size of the passover data in words |
> ++------------------+-----------------------------------------------------------+
> +|uint32_t data[8] |Passover data array |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_CONTROL_NOTIFY
> +~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x8
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 index |Index of control |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Notification flags, varies by control |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: notification configuration was successfully |
> +| |updated. |
> +| |NOT_FOUND: control id not exists. |
> +| |INVALID_PARAMETERS: if the input attributes flag specifies |
> +| |unsupported or invalid configurations.. |
> +| |DENIED: if the calling agent is not permitted to request |
> +| |the notification. |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_REASON_ATTRIBUTES
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x9
> +protocol_id: 0x84
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 reasonid |Identifier for the reason |
> ++------------------+-----------------------------------------------------------+
> +|Return values |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|int32 status |SUCCESS: if valid reason attributes are returned |
> +| |NOT_FOUND: if reasonId pertains to a non-existent reason. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 attributes |Reason attributes. This parameter has the following
> |
> +| |format: Bits[31:0] Reserved, must be zero |
> +| |Bits[15:0] Number of persistent storage (GPR) words. |
> ++------------------+-----------------------------------------------------------+
> +|uint8 name[16] |Null-terminated ASCII string of up to 16 bytes in length
> |
> +| |describing the reason |
> ++------------------+-----------------------------------------------------------+
> +
> +MISC_RESET_REASON
> +~~~~~~~~~~~~~~~~~
> +
> +message_id: 0xA
> +protocol_id: 0x84
> +
> ++--------------------+---------------------------------------------------------+
> +|Parameters |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|uint32 flags |Reason flags. This parameter has the following format: |
> +| |Bits[31:1] Reserved, must be zero. |
> +| |Bit[0] System: |
> +| |Set to 1 to return the system reason. |
> +| |Set to 0 to return the LM reason |
> ++--------------------+---------------------------------------------------------+
> +|Return values |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|int32 status |SUCCESS: reset reason return |
> ++--------------------+---------------------------------------------------------+
> +|uint32 bootflags |Boot reason flags. This parameter has the format: |
> +| |Bits[31] Valid. |
> +| |Set to 1 if the entire reason is valid. |
> +| |Set to 0 if the entire reason is not valid. |
> +| |Bits[30:29] Reserved, must be zero. |
> +| |Bit[28] Valid origin: |
> +| |Set to 1 if the origin field is valid. |
> +| |Set to 0 if the origin field is not valid. |
> +| |Bits[27:24] Origin. |
> +| |Bit[23] Valid err ID: |
> +| |Set to 1 if the error ID field is valid. |
> +| |Set to 0 if the error ID field is not valid. |
> +| |Bits[22:8] Error ID. |
> +| |Bit[7:0] Reason |
> ++--------------------+---------------------------------------------------------+
> +|uint32 shutdownflags|Shutdown reason flags. This parameter has the
> format: |
> +| |Bits[31] Valid. |
> +| |Set to 1 if the entire reason is valid. |
> +| |Set to 0 if the entire reason is not valid. |
> +| |Bits[30:29] Number of valid extended info words. |
> +| |Bit[28] Valid origin: |
> +| |Set to 1 if the origin field is valid. |
> +| |Set to 0 if the origin field is not valid. |
> +| |Bits[27:24] Origin. |
> +| |Bit[23] Valid err ID: |
> +| |Set to 1 if the error ID field is valid. |
> +| |Set to 0 if the error ID field is not valid. |
> +| |Bits[22:8] Error ID. |
> +| |Bit[7:0] Reason |
> ++--------------------+---------------------------------------------------------+
> +|uint32 extinfo[8] |Array of extended info words |
> ++--------------------+---------------------------------------------------------+
> +
> +MISC_SI_INFO
> +~~~~~~~~~~~~
> +
> +message_id: 0xB
> +protocol_id: 0x84
> +
> ++--------------------+---------------------------------------------------------+
> +|Return values |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|int32 status |SUCCESS: silicon info return |
> ++--------------------+---------------------------------------------------------+
> +|uint32 deviceid |Silicon specific device ID |
> ++--------------------+---------------------------------------------------------+
> +|uint32 sirev |Silicon specific revision |
> ++--------------------+---------------------------------------------------------+
> +|uint32 partnum |Silicon specific part number |
> ++--------------------+---------------------------------------------------------+
> +|uint8 siname[16] |Silicon name/revision. Null terminated ASCII string of
> up|
> +| |to 16 bytes in length |
> ++--------------------+---------------------------------------------------------+
> +
> +MISC_CFG_INFO
> +~~~~~~~~~~~~~
> +
> +message_id: 0xC
> +protocol_id: 0x84
> +
> ++--------------------+---------------------------------------------------------+
> +|Return values |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|int32 status |SUCCESS: config name return |
> +| |NOT_SUPPORTED: name not available |
> ++--------------------+---------------------------------------------------------+
> +|uint32 msel |Mode selector value |
> ++--------------------+---------------------------------------------------------+
> +|uint8 cfgname[16] |config file basename. Null terminated ASCII string of
> up |
> +| |to 16 bytes in length |
> ++--------------------+---------------------------------------------------------+
> +
> +MISC_SYSLOG
> +~~~~~~~~~~~
> +
> +message_id: 0xD
> +protocol_id: 0x84
> +
> ++--------------------+---------------------------------------------------------+
> +|Parameters |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|uint32 flags |Device specific flags that might impact the data returned|
> +| |or clearing of the data |
> ++--------------------+---------------------------------------------------------+
> +|uint32 logindex |Index to the first log word. Will be the first element in|
> +| |the return array |
> ++--------------------+---------------------------------------------------------+
> +|Return values |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|int32 status |SUCCESS: reset reason return |
> ++--------------------+---------------------------------------------------------+
> +|uint32 numLogflags |Descriptor for the log data returned by this call. |
> +| |Bits[31:20] Number of remaining log words. |
> +| |Bits[15:12] Reserved, must be zero. |
> +| |Bits[11:0] Number of log words that are returned by this |
> +| |call |
> ++--------------------+---------------------------------------------------------+
> +|uint32 syslog[16] |Log data array |
> ++--------------------+---------------------------------------------------------+
> +
> +NEGOTIATE_PROTOCOL_VERSION
> +~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x10
> +protocol_id: 0x84
> +
> ++--------------------+---------------------------------------------------------+
> +|Parameters |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|uint32 version |The negotiated protocol version the agent intends to
> use |
> ++--------------------+---------------------------------------------------------+
> +|Return values |
> ++--------------------+---------------------------------------------------------+
> +|Name |Description |
> ++--------------------+---------------------------------------------------------+
> +|int32 status |SUCCESS: if the negotiated protocol version is supported
> |
> +| |by the platform. All commands, responses, and |
> +| |notifications post successful return of this command must|
> +| |comply with the negotiated version. |
> +| |NOT_SUPPORTED: if the protocol version is not supported. |
> ++--------------------+---------------------------------------------------------+
> +
> +Notifications
> +_____________
> +
> +MISC_CONTROL_EVENT
> +~~~~~~~~~~~~~~~~~~
> +
> +message_id: 0x0
> +protocol_id: 0x81
> +
> ++------------------+-----------------------------------------------------------+
> +|Parameters |
> ++------------------+-----------------------------------------------------------+
> +|Name |Description |
> ++------------------+-----------------------------------------------------------+
> +|uint32 ctrlid |Identifier for the control that caused the event. |
> ++------------------+-----------------------------------------------------------+
> +|uint32 flags |Event flags, varies by control. |
> ++------------------+-----------------------------------------------------------+
> +
> diff --git a/Documentation/firmware-guide/nxp/index.rst
> b/Documentation/firmware-guide/nxp/index.rst
> new file mode 100644
> index 000000000000..b38c980a50c6
> --- /dev/null
> +++ b/Documentation/firmware-guide/nxp/index.rst
> @@ -0,0 +1,10 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +====================
> +NXP Firmware Support
> +====================
> +
> +.. toctree::
> + :maxdepth: 1
> +
> + imx95-scmi
>
> --
> 2.37.1