]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: Add SBI debug trigger extension and function ids
authorHimanshu Chauhan <hchauhan@ventanamicro.com>
Thu, 10 Jul 2025 12:52:30 +0000 (18:22 +0530)
committerPaul Walmsley <pjw@kernel.org>
Fri, 19 Dec 2025 07:22:30 +0000 (00:22 -0700)
Debug trigger extension is an SBI extension to support native debugging
in S-mode and VS-mode. This patch adds the extension and the function
IDs defined by the extension.

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Link: https://patch.msgid.link/20250710125231.653967-2-hchauhan@ventanamicro.com
[pjw@kernel.org: updated to apply]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/sbi.h

index ccc77a89b1e2215ab2a832c49c4186914a7f47ee..5725e0ca4dda3e62c29970e00b1415cb928f3592 100644 (file)
@@ -37,6 +37,7 @@ enum sbi_ext_id {
        SBI_EXT_NACL = 0x4E41434C,
        SBI_EXT_FWFT = 0x46574654,
        SBI_EXT_MPXY = 0x4D505859,
+       SBI_EXT_DBTR = 0x44425452,
 
        /* Experimentals extensions must lie within this range */
        SBI_EXT_EXPERIMENTAL_START = 0x08000000,
@@ -505,6 +506,34 @@ enum sbi_mpxy_rpmi_attribute_id {
 #define SBI_MPXY_CHAN_CAP_SEND_WITHOUT_RESP    BIT(4)
 #define SBI_MPXY_CHAN_CAP_GET_NOTIFICATIONS    BIT(5)
 
+/* SBI debug triggers function IDs */
+enum sbi_ext_dbtr_fid {
+       SBI_EXT_DBTR_NUM_TRIGGERS = 0,
+       SBI_EXT_DBTR_SETUP_SHMEM,
+       SBI_EXT_DBTR_TRIG_READ,
+       SBI_EXT_DBTR_TRIG_INSTALL,
+       SBI_EXT_DBTR_TRIG_UPDATE,
+       SBI_EXT_DBTR_TRIG_UNINSTALL,
+       SBI_EXT_DBTR_TRIG_ENABLE,
+       SBI_EXT_DBTR_TRIG_DISABLE,
+};
+
+struct sbi_dbtr_data_msg {
+       unsigned long tstate;
+       unsigned long tdata1;
+       unsigned long tdata2;
+       unsigned long tdata3;
+};
+
+struct sbi_dbtr_id_msg {
+       unsigned long idx;
+};
+
+union sbi_dbtr_shmem_entry {
+       struct sbi_dbtr_data_msg data;
+       struct sbi_dbtr_id_msg id;
+};
+
 /* SBI spec version fields */
 #define SBI_SPEC_VERSION_DEFAULT       0x1
 #define SBI_SPEC_VERSION_MAJOR_SHIFT   24