drivers/firmware/imx/rm.c
Source file repositories/reference/linux-study-clean/drivers/firmware/imx/rm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/imx/rm.c- Extension
.c- Size
- 2127 bytes
- Lines
- 91
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/firmware/imx/svc/rm.h
Detected Declarations
struct imx_sc_msg_rm_rsrc_ownedstruct imx_sc_msg_rm_get_resource_ownerfunction imx_sc_rm_is_resource_ownedfunction imx_sc_rm_get_resource_ownerexport imx_sc_rm_is_resource_ownedexport imx_sc_rm_get_resource_owner
Annotated Snippet
struct imx_sc_msg_rm_rsrc_owned {
struct imx_sc_rpc_msg hdr;
u16 resource;
} __packed __aligned(4);
/*
* This function check @resource is owned by current partition or not
*
* @param[in] ipc IPC handle
* @param[in] resource resource the control is associated with
*
* @return Returns 0 for not owned and 1 for owned.
*/
bool imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource)
{
struct imx_sc_msg_rm_rsrc_owned msg;
struct imx_sc_rpc_msg *hdr = &msg.hdr;
hdr->ver = IMX_SC_RPC_VERSION;
hdr->svc = IMX_SC_RPC_SVC_RM;
hdr->func = IMX_SC_RM_FUNC_IS_RESOURCE_OWNED;
hdr->size = 2;
msg.resource = resource;
/*
* SCU firmware only returns value 0 or 1
* for resource owned check which means not owned or owned.
* So it is always successful.
*/
imx_scu_call_rpc(ipc, &msg, true);
return hdr->func;
}
EXPORT_SYMBOL(imx_sc_rm_is_resource_owned);
struct imx_sc_msg_rm_get_resource_owner {
struct imx_sc_rpc_msg hdr;
union {
struct {
u16 resource;
} req;
struct {
u8 val;
} resp;
} data;
} __packed __aligned(4);
/*
* This function get @resource partition number
*
* @param[in] ipc IPC handle
* @param[in] resource resource the control is associated with
* @param[out] pt pointer to return the partition number
*
* @return Returns 0 for success and < 0 for errors.
*/
int imx_sc_rm_get_resource_owner(struct imx_sc_ipc *ipc, u16 resource, u8 *pt)
{
struct imx_sc_msg_rm_get_resource_owner msg;
struct imx_sc_rpc_msg *hdr = &msg.hdr;
int ret;
hdr->ver = IMX_SC_RPC_VERSION;
hdr->svc = IMX_SC_RPC_SVC_RM;
hdr->func = IMX_SC_RM_FUNC_GET_RESOURCE_OWNER;
hdr->size = 2;
msg.data.req.resource = resource;
ret = imx_scu_call_rpc(ipc, &msg, true);
if (ret)
return ret;
if (pt)
*pt = msg.data.resp.val;
return 0;
}
EXPORT_SYMBOL(imx_sc_rm_get_resource_owner);
Annotation
- Immediate include surface: `linux/firmware/imx/svc/rm.h`.
- Detected declarations: `struct imx_sc_msg_rm_rsrc_owned`, `struct imx_sc_msg_rm_get_resource_owner`, `function imx_sc_rm_is_resource_owned`, `function imx_sc_rm_get_resource_owner`, `export imx_sc_rm_is_resource_owned`, `export imx_sc_rm_get_resource_owner`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: integration 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.