drivers/firmware/stratix10-rsu.c
Source file repositories/reference/linux-study-clean/drivers/firmware/stratix10-rsu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/stratix10-rsu.c- Extension
.c- Size
- 22321 bytes
- Lines
- 825
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/arm-smccc.hlinux/bitfield.hlinux/completion.hlinux/kobject.hlinux/module.hlinux/mutex.hlinux/of.hlinux/platform_device.hlinux/firmware/intel/stratix10-svc-client.hlinux/string.hlinux/sysfs.hlinux/delay.h
Detected Declarations
struct stratix10_rsu_privfunction rsu_async_status_callbackfunction rsu_command_callbackfunction rsu_max_retry_callbackfunction rsu_dcmf_version_callbackfunction rsu_dcmf_status_callbackfunction rsu_async_get_spt_table_callbackfunction rsu_send_msgfunction soc64_async_callbackfunction rsu_send_async_msgfunction Updatefunction fail_image_showfunction version_showfunction state_showfunction error_location_showfunction error_details_showfunction retry_counter_showfunction max_retry_showfunction dcmf0_showfunction dcmf1_showfunction dcmf2_showfunction dcmf3_showfunction dcmf0_status_showfunction dcmf1_status_showfunction dcmf2_status_showfunction dcmf3_status_showfunction reboot_image_storefunction notify_storefunction spt0_address_showfunction spt1_address_showfunction stratix10_rsu_probefunction stratix10_rsu_remove
Annotated Snippet
struct stratix10_rsu_priv {
struct stratix10_svc_chan *chan;
struct stratix10_svc_client client;
struct completion completion;
struct mutex lock;
struct {
unsigned long current_image;
unsigned long fail_image;
unsigned int version;
unsigned int state;
unsigned int error_details;
unsigned int error_location;
} status;
struct {
unsigned int dcmf0;
unsigned int dcmf1;
unsigned int dcmf2;
unsigned int dcmf3;
} dcmf_version;
struct {
unsigned int dcmf0;
unsigned int dcmf1;
unsigned int dcmf2;
unsigned int dcmf3;
} dcmf_status;
unsigned int retry_counter;
unsigned int max_retry;
unsigned long spt0_address;
unsigned long spt1_address;
};
typedef void (*rsu_async_callback)(struct device *dev,
struct stratix10_rsu_priv *priv, struct stratix10_svc_cb_data *data);
/**
* rsu_async_status_callback() - Status callback from rsu_async_send()
* @dev: pointer to device object
* @priv: pointer to priv object
* @data: pointer to callback data structure
*
* Callback from rsu_async_send() to get the system rsu error status.
*/
static void rsu_async_status_callback(struct device *dev,
struct stratix10_rsu_priv *priv,
struct stratix10_svc_cb_data *data)
{
struct arm_smccc_1_2_regs *res = (struct arm_smccc_1_2_regs *)data->kaddr1;
priv->status.current_image = res->a2;
priv->status.fail_image = res->a3;
priv->status.state = res->a4;
priv->status.version = res->a5;
priv->status.error_location = res->a7;
priv->status.error_details = res->a8;
priv->retry_counter = res->a9;
}
/**
* rsu_command_callback() - Update callback from Intel Service Layer
* @client: pointer to client
* @data: pointer to callback data structure
*
* Callback from Intel service layer for RSU commands.
*/
static void rsu_command_callback(struct stratix10_svc_client *client,
struct stratix10_svc_cb_data *data)
{
struct stratix10_rsu_priv *priv = client->priv;
if (data->status == BIT(SVC_STATUS_NO_SUPPORT))
dev_warn(client->dev, "Secure FW doesn't support notify\n");
else if (data->status == BIT(SVC_STATUS_ERROR))
dev_err(client->dev, "Failure, returned status is %lu\n",
BIT(data->status));
complete(&priv->completion);
}
/**
* rsu_max_retry_callback() - Callback from Intel service layer for getting
* the max retry value from the firmware
* @client: pointer to client
* @data: pointer to callback data structure
*
* Callback from Intel service layer for max retry.
Annotation
- Immediate include surface: `linux/arm-smccc.h`, `linux/bitfield.h`, `linux/completion.h`, `linux/kobject.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `struct stratix10_rsu_priv`, `function rsu_async_status_callback`, `function rsu_command_callback`, `function rsu_max_retry_callback`, `function rsu_dcmf_version_callback`, `function rsu_dcmf_status_callback`, `function rsu_async_get_spt_table_callback`, `function rsu_send_msg`, `function soc64_async_callback`, `function rsu_send_async_msg`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.