drivers/firmware/arm_scmi/reset.c
Source file repositories/reference/linux-study-clean/drivers/firmware/arm_scmi/reset.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/arm_scmi/reset.c- Extension
.c- Size
- 9594 bytes
- Lines
- 391
- 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.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/scmi_protocol.hprotocols.hnotify.h
Detected Declarations
struct scmi_msg_resp_reset_domain_attributesstruct scmi_msg_reset_domain_resetstruct scmi_msg_reset_notifystruct scmi_reset_issued_notify_payldstruct reset_dom_infostruct scmi_reset_infoenum scmi_reset_protocol_cmdfunction scmi_reset_attributes_getfunction scmi_reset_domain_lookupfunction scmi_reset_domain_attributes_getfunction scmi_reset_num_domains_getfunction scmi_reset_name_getfunction scmi_reset_latency_getfunction scmi_domain_resetfunction scmi_reset_domain_resetfunction scmi_reset_domain_assertfunction scmi_reset_domain_deassertfunction scmi_reset_notify_supportedfunction scmi_reset_notifyfunction scmi_reset_set_notify_enabledfunction scmi_reset_fill_custom_reportfunction scmi_reset_get_num_sourcesfunction scmi_reset_protocol_init
Annotated Snippet
struct scmi_msg_resp_reset_domain_attributes {
__le32 attributes;
#define SUPPORTS_ASYNC_RESET(x) ((x) & BIT(31))
#define SUPPORTS_NOTIFY_RESET(x) ((x) & BIT(30))
#define SUPPORTS_EXTENDED_NAMES(x) ((x) & BIT(29))
__le32 latency;
u8 name[SCMI_SHORT_NAME_MAX_SIZE];
};
struct scmi_msg_reset_domain_reset {
__le32 domain_id;
__le32 flags;
#define AUTONOMOUS_RESET BIT(0)
#define EXPLICIT_RESET_ASSERT BIT(1)
#define ASYNCHRONOUS_RESET BIT(2)
__le32 reset_state;
#define ARCH_COLD_RESET 0
};
struct scmi_msg_reset_notify {
__le32 id;
__le32 event_control;
#define RESET_TP_NOTIFY_ALL BIT(0)
};
struct scmi_reset_issued_notify_payld {
__le32 agent_id;
__le32 domain_id;
__le32 reset_state;
};
struct reset_dom_info {
bool async_reset;
bool reset_notify;
u32 latency_us;
char name[SCMI_MAX_STR_SIZE];
};
struct scmi_reset_info {
int num_domains;
bool notify_reset_cmd;
struct reset_dom_info *dom_info;
};
static int scmi_reset_attributes_get(const struct scmi_protocol_handle *ph,
struct scmi_reset_info *pi)
{
int ret;
struct scmi_xfer *t;
u32 attr;
ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES,
0, sizeof(attr), &t);
if (ret)
return ret;
ret = ph->xops->do_xfer(ph, t);
if (!ret) {
attr = get_unaligned_le32(t->rx.buf);
pi->num_domains = attr & NUM_RESET_DOMAIN_MASK;
}
ph->xops->xfer_put(ph, t);
if (!ret)
if (!ph->hops->protocol_msg_check(ph, RESET_NOTIFY, NULL))
pi->notify_reset_cmd = true;
return ret;
}
static struct reset_dom_info *
scmi_reset_domain_lookup(const struct scmi_protocol_handle *ph, u32 domain)
{
struct scmi_reset_info *pi = ph->get_priv(ph);
if (domain >= pi->num_domains)
return ERR_PTR(-EINVAL);
return pi->dom_info + domain;
}
static int
scmi_reset_domain_attributes_get(const struct scmi_protocol_handle *ph,
struct scmi_reset_info *pinfo, u32 domain)
{
int ret;
u32 attributes;
struct scmi_xfer *t;
struct scmi_msg_resp_reset_domain_attributes *attr;
Annotation
- Immediate include surface: `linux/module.h`, `linux/scmi_protocol.h`, `protocols.h`, `notify.h`.
- Detected declarations: `struct scmi_msg_resp_reset_domain_attributes`, `struct scmi_msg_reset_domain_reset`, `struct scmi_msg_reset_notify`, `struct scmi_reset_issued_notify_payld`, `struct reset_dom_info`, `struct scmi_reset_info`, `enum scmi_reset_protocol_cmd`, `function scmi_reset_attributes_get`, `function scmi_reset_domain_lookup`, `function scmi_reset_domain_attributes_get`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.