drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c

Source file repositories/reference/linux-study-clean/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c

File Facts

System
Linux kernel
Corpus path
drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
Extension
.c
Size
15318 bytes
Lines
594
Domain
Driver Families
Bucket
drivers/firmware
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct scmi_imx_misc_info {
	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[];
};

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[];
};

struct scmi_imx_misc_buildinfo_out {
	__le32 buildnum;
	__le32 buildcommit;
#define MISC_MAX_BUILDDATE	16
	u8 builddate[MISC_MAX_BUILDDATE];
#define MISC_MAX_BUILDTIME	16
	u8 buildtime[MISC_MAX_BUILDTIME];
};

struct scmi_imx_misc_board_info_out {
	__le32 attributes;
#define MISC_MAX_BRDNAME	16
	u8 brdname[MISC_MAX_BRDNAME];
};

struct scmi_imx_misc_cfg_info_out {
	__le32 msel;
#define MISC_MAX_CFGNAME	16
	u8 cfgname[MISC_MAX_CFGNAME];
};

struct scmi_imx_misc_reset_reason_in {
#define MISC_REASON_FLAG_SYSTEM	BIT(0)
	__le32 flags;
};

struct scmi_imx_misc_reset_reason_out {
	/* Boot reason flags */
#define MISC_BOOT_FLAG_VLD		BIT(31)
#define MISC_BOOT_FLAG_ORG_VLD		BIT(28)
#define MISC_BOOT_FLAG_ORIGIN		GENMASK(27, 24)
#define MISC_BOOT_FLAG_O_SHIFT		24
#define MISC_BOOT_FLAG_ERR_VLD		BIT(23)
#define MISC_BOOT_FLAG_ERR_ID		GENMASK(22, 8)
#define MISC_BOOT_FLAG_E_SHIFT		8
#define MISC_BOOT_FLAG_REASON		GENMASK(7, 0)
	__le32 b_flags;
	/* Shutdown reason flags */
#define MISC_SHUTDOWN_FLAG_VLD		BIT(31)
#define MISC_SHUTDOWN_FLAG_EXT_LEN	GENMASK(30, 29)
#define MISC_SHUTDOWN_FLAG_ORG_VLD	BIT(28)
#define MISC_SHUTDOWN_FLAG_ORIGIN	GENMASK(27, 24)
#define MISC_SHUTDOWN_FLAG_O_SHIFT	24
#define MISC_SHUTDOWN_FLAG_ERR_VLD	BIT(23)
#define MISC_SHUTDOWN_FLAG_ERR_ID	GENMASK(22, 8)
#define MISC_SHUTDOWN_FLAG_E_SHIFT	8
#define MISC_SHUTDOWN_FLAG_REASON	GENMASK(7, 0)
	__le32 s_flags;
	/* Array of extended info words */
	__le32 extinfo[MISC_EXT_INFO_LEN_MAX];
};

struct scmi_imx_misc_syslog_in {
	__le32 flags;

Annotation

Implementation Notes