drivers/firmware/trusted_foundations.c
Source file repositories/reference/linux-study-clean/drivers/firmware/trusted_foundations.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/trusted_foundations.c- Extension
.c- Size
- 4069 bytes
- Lines
- 185
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/of.hlinux/firmware/trusted_foundations.hasm/firmware.hasm/hardware/cache-l2x0.hasm/outercache.h
Detected Declarations
function tf_generic_smcfunction tf_set_cpu_boot_addrfunction tf_prepare_idlefunction tf_cache_write_secfunction tf_init_cachefunction register_trusted_foundationsfunction of_register_trusted_foundationsfunction trusted_foundations_registered
Annotated Snippet
switch (tf_idle_mode) {
case TF_PM_MODE_LP2:
enable_op = TF_CACHE_REENABLE;
break;
default:
enable_op = TF_CACHE_ENABLE;
break;
}
if (val == L2X0_CTRL_EN)
tf_generic_smc(TF_CACHE_MAINT, enable_op,
l2x0_saved_regs.aux_ctrl);
else
tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_DISABLE,
l2x0_way_mask);
break;
default:
break;
}
}
static int tf_init_cache(void)
{
outer_cache.write_sec = tf_cache_write_sec;
return 0;
}
#endif /* CONFIG_CACHE_L2X0 */
static const struct firmware_ops trusted_foundations_ops = {
.set_cpu_boot_addr = tf_set_cpu_boot_addr,
.prepare_idle = tf_prepare_idle,
#ifdef CONFIG_CACHE_L2X0
.l2x0_init = tf_init_cache,
#endif
};
void register_trusted_foundations(struct trusted_foundations_platform_data *pd)
{
/*
* we are not using version information for now since currently
* supported SMCs are compatible with all TF releases
*/
register_firmware_ops(&trusted_foundations_ops);
}
void of_register_trusted_foundations(void)
{
struct device_node *node;
struct trusted_foundations_platform_data pdata;
int err;
node = of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations");
if (!node)
return;
err = of_property_read_u32(node, "tlm,version-major",
&pdata.version_major);
if (err != 0)
panic("Trusted Foundation: missing version-major property\n");
err = of_property_read_u32(node, "tlm,version-minor",
&pdata.version_minor);
if (err != 0)
panic("Trusted Foundation: missing version-minor property\n");
register_trusted_foundations(&pdata);
}
bool trusted_foundations_registered(void)
{
return firmware_ops == &trusted_foundations_ops;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/of.h`, `linux/firmware/trusted_foundations.h`, `asm/firmware.h`, `asm/hardware/cache-l2x0.h`, `asm/outercache.h`.
- Detected declarations: `function tf_generic_smc`, `function tf_set_cpu_boot_addr`, `function tf_prepare_idle`, `function tf_cache_write_sec`, `function tf_init_cache`, `function register_trusted_foundations`, `function of_register_trusted_foundations`, `function trusted_foundations_registered`.
- 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.