Skip to content

Commit 5efaf92

Browse files
hschauhanPaul Walmsley
authored andcommitted
riscv: Add SBI debug trigger extension and function ids
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>
1 parent f02dd25 commit 5efaf92

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

  • arch/riscv/include/asm

arch/riscv/include/asm/sbi.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ enum sbi_ext_id {
3737
SBI_EXT_NACL = 0x4E41434C,
3838
SBI_EXT_FWFT = 0x46574654,
3939
SBI_EXT_MPXY = 0x4D505859,
40+
SBI_EXT_DBTR = 0x44425452,
4041

4142
/* Experimentals extensions must lie within this range */
4243
SBI_EXT_EXPERIMENTAL_START = 0x08000000,
@@ -505,6 +506,34 @@ enum sbi_mpxy_rpmi_attribute_id {
505506
#define SBI_MPXY_CHAN_CAP_SEND_WITHOUT_RESP BIT(4)
506507
#define SBI_MPXY_CHAN_CAP_GET_NOTIFICATIONS BIT(5)
507508

509+
/* SBI debug triggers function IDs */
510+
enum sbi_ext_dbtr_fid {
511+
SBI_EXT_DBTR_NUM_TRIGGERS = 0,
512+
SBI_EXT_DBTR_SETUP_SHMEM,
513+
SBI_EXT_DBTR_TRIG_READ,
514+
SBI_EXT_DBTR_TRIG_INSTALL,
515+
SBI_EXT_DBTR_TRIG_UPDATE,
516+
SBI_EXT_DBTR_TRIG_UNINSTALL,
517+
SBI_EXT_DBTR_TRIG_ENABLE,
518+
SBI_EXT_DBTR_TRIG_DISABLE,
519+
};
520+
521+
struct sbi_dbtr_data_msg {
522+
unsigned long tstate;
523+
unsigned long tdata1;
524+
unsigned long tdata2;
525+
unsigned long tdata3;
526+
};
527+
528+
struct sbi_dbtr_id_msg {
529+
unsigned long idx;
530+
};
531+
532+
union sbi_dbtr_shmem_entry {
533+
struct sbi_dbtr_data_msg data;
534+
struct sbi_dbtr_id_msg id;
535+
};
536+
508537
/* SBI spec version fields */
509538
#define SBI_SPEC_VERSION_DEFAULT 0x1
510539
#define SBI_SPEC_VERSION_MAJOR_SHIFT 24

0 commit comments

Comments
 (0)