arch/arm/mach-omap2/omap-secure.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/omap-secure.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/omap-secure.c- Extension
.c- Size
- 6076 bytes
- Lines
- 257
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/arm-smccc.hlinux/cpu_pm.hlinux/kernel.hlinux/init.hlinux/io.hlinux/memblock.hlinux/of.hasm/cacheflush.hasm/memblock.hcommon.homap-secure.hsoc.h
Detected Declarations
function omap_optee_init_checkfunction omap_secure_dispatcherfunction omap_smccc_smcfunction omap_smc1function omap_secure_ram_reserve_memblockfunction omap3_save_secure_ramfunction omap_smc3function rx51_secure_update_aux_crfunction rx51_secure_rng_callfunction omap_secure_initfunction cpu_notifierfunction secure_pm_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* OMAP Secure API infrastructure.
*
* Copyright (C) 2011 Texas Instruments, Inc.
* Santosh Shilimkar <santosh.shilimkar@ti.com>
* Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
* Copyright (C) 2013 Pali Rohár <pali@kernel.org>
*/
#include <linux/arm-smccc.h>
#include <linux/cpu_pm.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <asm/cacheflush.h>
#include <asm/memblock.h>
#include "common.h"
#include "omap-secure.h"
#include "soc.h"
static phys_addr_t omap_secure_memblock_base;
bool optee_available;
#define OMAP_SIP_SMC_STD_CALL_VAL(func_num) \
ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL, ARM_SMCCC_SMC_32, \
ARM_SMCCC_OWNER_SIP, (func_num))
static void __init omap_optee_init_check(void)
{
struct device_node *np;
/*
* We only check that the OP-TEE node is present and available. The
* OP-TEE kernel driver is not needed for the type of interaction made
* with OP-TEE here so the driver's status is not checked.
*/
np = of_find_node_by_path("/firmware/optee");
if (np && of_device_is_available(np))
optee_available = true;
of_node_put(np);
}
/**
* omap_secure_dispatcher - Routine to dispatch low power secure
* service routines
* @idx: The HAL API index
* @flag: The flag indicating criticality of operation
* @nargs: Number of valid arguments out of four.
* @arg1, arg2, arg3 args4: Parameters passed to secure API
*
* Return the non-zero error value on failure.
*/
u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2,
u32 arg3, u32 arg4)
{
static u32 buf[NR_CPUS][5];
u32 *param;
int cpu;
u32 ret;
cpu = get_cpu();
param = buf[cpu];
param[0] = nargs;
param[1] = arg1;
param[2] = arg2;
param[3] = arg3;
param[4] = arg4;
/*
* Secure API needs physical address
* pointer for the parameters
*/
flush_cache_all();
outer_clean_range(__pa(param), __pa(param + 5));
ret = omap_smc2(idx, flag, __pa(param));
put_cpu();
return ret;
}
void omap_smccc_smc(u32 fn, u32 arg)
{
Annotation
- Immediate include surface: `linux/arm-smccc.h`, `linux/cpu_pm.h`, `linux/kernel.h`, `linux/init.h`, `linux/io.h`, `linux/memblock.h`, `linux/of.h`, `asm/cacheflush.h`.
- Detected declarations: `function omap_optee_init_check`, `function omap_secure_dispatcher`, `function omap_smccc_smc`, `function omap_smc1`, `function omap_secure_ram_reserve_memblock`, `function omap3_save_secure_ram`, `function omap_smc3`, `function rx51_secure_update_aux_cr`, `function rx51_secure_rng_call`, `function omap_secure_init`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.