drivers/firmware/ti_sci.c
Source file repositories/reference/linux-study-clean/drivers/firmware/ti_sci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/ti_sci.c- Extension
.c- Size
- 121225 bytes
- Lines
- 4256
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/bitmap.hlinux/clk.hlinux/cpu.hlinux/debugfs.hlinux/export.hlinux/hashtable.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/mailbox_client.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/pm_qos.hlinux/property.hlinux/semaphore.hlinux/slab.hlinux/soc/ti/ti-msgmgr.hlinux/soc/ti/ti_sci_protocol.hlinux/suspend.hlinux/sys_soc.hlinux/reboot.hti_sci.h
Detected Declarations
struct ti_sci_xferstruct ti_sci_xfers_infostruct ti_sci_descstruct ti_sci_irqstruct ti_sci_infofunction ti_sci_debug_showfunction ti_sci_debugfs_createfunction ti_sci_debugfs_createfunction ti_sci_debugfs_destroyfunction ti_sci_rx_callbackfunction ti_sci_get_one_xferfunction ti_sci_put_one_xferfunction ti_sci_do_xferfunction ti_sci_cmd_get_revisionfunction ti_sci_is_response_ackfunction ti_sci_set_device_statefunction ti_sci_get_device_statefunction ti_sci_cmd_get_devicefunction ti_sci_cmd_get_device_exclusivefunction ti_sci_cmd_idle_devicefunction ti_sci_cmd_idle_device_exclusivefunction ti_sci_cmd_put_devicefunction ti_sci_cmd_dev_is_validfunction ti_sci_cmd_dev_get_clcntfunction ti_sci_cmd_dev_is_idlefunction ti_sci_cmd_dev_is_stopfunction ti_sci_cmd_dev_is_onfunction ti_sci_cmd_dev_is_transfunction ti_sci_cmd_set_device_resetsfunction ti_sci_cmd_get_device_resetsfunction ti_sci_set_clock_statefunction ti_sci_cmd_get_clock_statefunction ti_sci_cmd_get_clockfunction ti_sci_cmd_idle_clockfunction ti_sci_cmd_put_clockfunction ti_sci_cmd_clk_is_autofunction ti_sci_cmd_clk_is_onfunction ti_sci_cmd_clk_is_offfunction ti_sci_cmd_clk_set_parentfunction ti_sci_cmd_clk_get_parentfunction ti_sci_cmd_clk_get_num_parentsfunction ti_sci_cmd_clk_get_match_freqfunction ti_sci_cmd_clk_set_freqfunction ti_sci_cmd_clk_get_freqfunction ti_sci_cmd_prepare_sleepfunction ti_sci_msg_cmd_query_fw_capsfunction ti_sci_cmd_set_io_isolationfunction ti_sci_msg_cmd_lpm_wake_reason
Annotated Snippet
struct ti_sci_xfer {
struct ti_msgmgr_message tx_message;
u8 rx_len;
u8 *xfer_buf;
struct completion done;
};
/**
* struct ti_sci_xfers_info - Structure to manage transfer information
* @sem_xfer_count: Counting Semaphore for managing max simultaneous
* Messages.
* @xfer_block: Preallocated Message array
* @xfer_alloc_table: Bitmap table for allocated messages.
* Index of this bitmap table is also used for message
* sequence identifier.
* @xfer_lock: Protection for message allocation
*/
struct ti_sci_xfers_info {
struct semaphore sem_xfer_count;
struct ti_sci_xfer *xfer_block;
unsigned long *xfer_alloc_table;
/* protect transfer allocation */
spinlock_t xfer_lock;
};
/**
* struct ti_sci_desc - Description of SoC integration
* @default_host_id: Host identifier representing the compute entity
* @max_rx_timeout_ms: Timeout for communication with SoC (in Milliseconds)
* @max_msgs: Maximum number of messages that can be pending
* simultaneously in the system
* @max_msg_size: Maximum size of data per message that can be handled.
*/
struct ti_sci_desc {
u8 default_host_id;
int max_rx_timeout_ms;
int max_msgs;
int max_msg_size;
};
/**
* struct ti_sci_irq - Description of allocated irqs
* @node: Link to hash table
* @desc: Description of the irq
*/
struct ti_sci_irq {
struct hlist_node node;
struct ti_sci_msg_req_manage_irq desc;
};
/**
* struct ti_sci_info - Structure representing a TI SCI instance
* @dev: Device pointer
* @desc: SoC description for this instance
* @d: Debugfs file entry
* @debug_region: Memory region where the debug message are available
* @debug_region_size: Debug region size
* @debug_buffer: Buffer allocated to copy debug messages.
* @handle: Instance of TI SCI handle to send to clients.
* @cl: Mailbox Client
* @chan_tx: Transmit mailbox channel
* @chan_rx: Receive mailbox channel
* @minfo: Message info
* @node: list head
* @irqs: List of allocated irqs
* @irq_lock: Protection for irq hash list
* @host_id: Host ID
* @fw_caps: FW/SoC low power capabilities
* @users: Number of users of this instance
*/
struct ti_sci_info {
struct device *dev;
const struct ti_sci_desc *desc;
struct dentry *d;
void __iomem *debug_region;
char *debug_buffer;
size_t debug_region_size;
struct ti_sci_handle handle;
struct mbox_client cl;
struct mbox_chan *chan_tx;
struct mbox_chan *chan_rx;
struct ti_sci_xfers_info minfo;
struct list_head node;
DECLARE_HASHTABLE(irqs, 8);
struct mutex irq_lock;
u8 host_id;
u64 fw_caps;
/* protected by ti_sci_list_mutex */
int users;
};
Annotation
- Immediate include surface: `linux/bitmap.h`, `linux/clk.h`, `linux/cpu.h`, `linux/debugfs.h`, `linux/export.h`, `linux/hashtable.h`, `linux/io.h`, `linux/iopoll.h`.
- Detected declarations: `struct ti_sci_xfer`, `struct ti_sci_xfers_info`, `struct ti_sci_desc`, `struct ti_sci_irq`, `struct ti_sci_info`, `function ti_sci_debug_show`, `function ti_sci_debugfs_create`, `function ti_sci_debugfs_create`, `function ti_sci_debugfs_destroy`, `function ti_sci_rx_callback`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: integration 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.