arch/arm/mach-exynos/firmware.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-exynos/firmware.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-exynos/firmware.c- Extension
.c- Size
- 6327 bytes
- Lines
- 262
- 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/kernel.hlinux/io.hlinux/init.hlinux/of.hlinux/of_address.hasm/cacheflush.hasm/cputype.hasm/firmware.hasm/hardware/cache-l2x0.hasm/suspend.hcommon.hsmc.h
Detected Declarations
function exynos_save_cp15function exynos_do_idlefunction exynos_cpu_bootfunction exynos_set_cpu_boot_addrfunction exynos_get_cpu_boot_addrfunction exynos_cpu_suspendfunction exynos_suspendfunction exynos_resumefunction exynos_l2_write_secfunction exynos_l2_configurefunction exynos_secure_firmware_availablefunction exynos_firmware_initfunction SoCsfunction exynos_set_boot_flagfunction exynos_clear_boot_flag
Annotated Snippet
if (soc_is_exynos3250()) {
flush_cache_all();
exynos_smc(SMC_CMD_SAVE, OP_TYPE_CORE,
SMC_POWERSTATE_IDLE, 0);
exynos_smc(SMC_CMD_SHUTDOWN, OP_TYPE_CLUSTER,
SMC_POWERSTATE_IDLE, 0);
} else
exynos_smc(SMC_CMD_CPU0AFTR, 0, 0, 0);
break;
case FW_DO_IDLE_SLEEP:
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
}
return 0;
}
static int exynos_cpu_boot(int cpu)
{
/*
* Exynos3250 doesn't need to send smc command for secondary CPU boot
* because Exynos3250 removes WFE in secure mode.
*
* On most Exynos5 devices the call is ignored by trustzone firmware.
*/
if (!soc_is_exynos4210() && !soc_is_exynos4212() &&
!soc_is_exynos4412() && !of_machine_is_compatible("google,manta"))
return 0;
/*
* The second parameter of SMC_CMD_CPU1BOOT command means CPU id.
* But, Exynos4212 has only one secondary CPU so second parameter
* isn't used for informing secure firmware about CPU id.
*/
if (soc_is_exynos4212())
cpu = 0;
exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
return 0;
}
static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
{
void __iomem *boot_reg;
if (!sysram_ns_base_addr)
return -ENODEV;
boot_reg = sysram_ns_base_addr + 0x1c;
/*
* Almost all Exynos-series of SoCs that run in secure mode don't need
* additional offset for every CPU, with Exynos4412 being the only
* exception.
*/
if (soc_is_exynos4412())
boot_reg += 4 * cpu;
writel_relaxed(boot_addr, boot_reg);
return 0;
}
static int exynos_get_cpu_boot_addr(int cpu, unsigned long *boot_addr)
{
void __iomem *boot_reg;
if (!sysram_ns_base_addr)
return -ENODEV;
boot_reg = sysram_ns_base_addr + 0x1c;
if (soc_is_exynos4412())
boot_reg += 4 * cpu;
*boot_addr = readl_relaxed(boot_reg);
return 0;
}
static int exynos_cpu_suspend(unsigned long arg)
{
flush_cache_all();
outer_flush_all();
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
pr_info("Failed to suspend the system\n");
writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
return 1;
}
static int exynos_suspend(void)
{
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/io.h`, `linux/init.h`, `linux/of.h`, `linux/of_address.h`, `asm/cacheflush.h`, `asm/cputype.h`, `asm/firmware.h`.
- Detected declarations: `function exynos_save_cp15`, `function exynos_do_idle`, `function exynos_cpu_boot`, `function exynos_set_cpu_boot_addr`, `function exynos_get_cpu_boot_addr`, `function exynos_cpu_suspend`, `function exynos_suspend`, `function exynos_resume`, `function exynos_l2_write_sec`, `function exynos_l2_configure`.
- 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.