Commit 5efaf92d authored by Himanshu Chauhan's avatar Himanshu Chauhan Committed by Paul Walmsley
Browse files

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: default avatarHimanshu Chauhan <hchauhan@ventanamicro.com>
Link: https://patch.msgid.link/20250710125231.653967-2-hchauhan@ventanamicro.com


[pjw@kernel.org: updated to apply]
Signed-off-by: default avatarPaul Walmsley <pjw@kernel.org>
parent f02dd254
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -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