[PATCH v2 1/7] firmware: arm_rmm: Add VSMMU commands and fields
From: Nicolin Chen
Date: Mon Nov 02 2026 - 22:54:05 EST
DEN0137 2.0-bet3 adds the RSI_VSMMU_GET_INFO command and replaces the old
RSI_VSMMU_ACTIVATE command with RSI_ARCH_DEV_ACTIVATE.
Add the command IDs, return codes, SMMUv3 device type, and helpers for both
commands.
Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
---
include/linux/arm-rsi-cmds.h | 29 +++++++++++++++++++++++++++++
include/linux/arm-smccc-rsi.h | 20 ++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/include/linux/arm-rsi-cmds.h b/include/linux/arm-rsi-cmds.h
index 3f7a6a833993b..a1836b19c1556 100644
--- a/include/linux/arm-rsi-cmds.h
+++ b/include/linux/arm-rsi-cmds.h
@@ -236,4 +236,33 @@ static inline unsigned long rsi_attestation_token_continue(phys_addr_t granule,
return res.a0;
}
+static inline unsigned long rsi_vsmmu_get_info(phys_addr_t addr,
+ phys_addr_t *top)
+{
+ struct arm_smccc_1_2_regs regs = {
+ .a0 = SMC_RSI_VSMMU_GET_INFO,
+ .a1 = addr,
+ };
+
+ arm_smccc_1_2_smc(®s, ®s);
+ if (regs.a0 == RSI_SUCCESS && top)
+ *top = regs.a1;
+
+ return regs.a0;
+}
+
+static inline unsigned long rsi_arch_dev_activate(phys_addr_t base,
+ unsigned long dev_type)
+{
+ struct arm_smccc_1_2_regs regs = {
+ .a0 = SMC_RSI_ARCH_DEV_ACTIVATE,
+ .a1 = base,
+ .a2 = dev_type,
+ };
+
+ arm_smccc_1_2_smc(®s, ®s);
+
+ return regs.a0;
+}
+
#endif /* __LINUX_ARM_RSI_CMDS_H_ */
diff --git a/include/linux/arm-smccc-rsi.h b/include/linux/arm-smccc-rsi.h
index cca881ddfdbab..fff0073622153 100644
--- a/include/linux/arm-smccc-rsi.h
+++ b/include/linux/arm-smccc-rsi.h
@@ -37,6 +37,7 @@
#define RSI_ERROR_STATE UL(2)
#define RSI_INCOMPLETE UL(3)
#define RSI_ERROR_UNKNOWN UL(4)
+#define RSI_ERROR_DEVICE UL(5)
#define SMC_RSI_FID(n) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
ARM_SMCCC_SMC_64, \
@@ -190,4 +191,23 @@ struct realm_config {
*/
#define SMC_RSI_HOST_CALL SMC_RSI_FID(0x199)
+/*
+ * Get information about a VSMMU.
+ *
+ * arg1 == Base IPA of the VSMMU
+ * ret0 == Status / error
+ * ret1 == Top IPA of the VSMMU
+ */
+#define SMC_RSI_VSMMU_GET_INFO SMC_RSI_FID(0x19A)
+
+#define RSI_ARCH_DEV_SMMUV3 UL(0)
+
+/*
+ * Activate an architectural device.
+ *
+ * arg1 == Base IPA of the architectural device
+ * arg2 == Architectural device type
+ * ret0 == Status / error
+ */
+#define SMC_RSI_ARCH_DEV_ACTIVATE SMC_RSI_FID(0x19B)
#endif /* __LINUX_ARM_SMCCC_RSI_H_ */
--
2.43.0