arch/arm/mach-milbeaut/platsmp.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-milbeaut/platsmp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-milbeaut/platsmp.c- Extension
.c- Size
- 3203 bytes
- Lines
- 148
- 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/cpu_pm.hlinux/irqchip/arm-gic.hlinux/of_address.hlinux/suspend.hasm/cacheflush.hasm/cp15.hasm/idmap.hasm/smp_plat.hasm/suspend.h
Detected Declarations
function m10v_boot_secondaryfunction m10v_smp_initfunction m10v_cpu_diefunction m10v_cpu_killfunction m10v_pm_validfunction m10v_diefunction m10v_pm_enterfunction m10v_pm_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright: (C) 2018 Socionext Inc.
* Copyright: (C) 2015 Linaro Ltd.
*/
#include <linux/cpu_pm.h>
#include <linux/irqchip/arm-gic.h>
#include <linux/of_address.h>
#include <linux/suspend.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
#include <asm/idmap.h>
#include <asm/smp_plat.h>
#include <asm/suspend.h>
#define M10V_MAX_CPU 4
#define KERNEL_UNBOOT_FLAG 0x12345678
static void __iomem *m10v_smp_base;
static int m10v_boot_secondary(unsigned int l_cpu, struct task_struct *idle)
{
unsigned int mpidr, cpu, cluster;
if (!m10v_smp_base)
return -ENXIO;
mpidr = cpu_logical_map(l_cpu);
cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
if (cpu >= M10V_MAX_CPU)
return -EINVAL;
pr_info("%s: cpu %u l_cpu %u cluster %u\n",
__func__, cpu, l_cpu, cluster);
writel(__pa_symbol(secondary_startup), m10v_smp_base + cpu * 4);
arch_send_wakeup_ipi_mask(cpumask_of(l_cpu));
return 0;
}
static void m10v_smp_init(unsigned int max_cpus)
{
unsigned int mpidr, cpu, cluster;
struct device_node *np;
np = of_find_compatible_node(NULL, NULL, "socionext,milbeaut-smp-sram");
if (!np)
return;
m10v_smp_base = of_iomap(np, 0);
if (!m10v_smp_base)
return;
mpidr = read_cpuid_mpidr();
cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
pr_info("MCPM boot on cpu_%u cluster_%u\n", cpu, cluster);
for (cpu = 0; cpu < M10V_MAX_CPU; cpu++)
writel(KERNEL_UNBOOT_FLAG, m10v_smp_base + cpu * 4);
}
#ifdef CONFIG_HOTPLUG_CPU
static void m10v_cpu_die(unsigned int l_cpu)
{
gic_cpu_if_down(0);
v7_exit_coherency_flush(louis);
wfi();
}
static int m10v_cpu_kill(unsigned int l_cpu)
{
unsigned int mpidr, cpu;
mpidr = cpu_logical_map(l_cpu);
cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
writel(KERNEL_UNBOOT_FLAG, m10v_smp_base + cpu * 4);
return 1;
}
#endif
static struct smp_operations m10v_smp_ops __initdata = {
.smp_prepare_cpus = m10v_smp_init,
Annotation
- Immediate include surface: `linux/cpu_pm.h`, `linux/irqchip/arm-gic.h`, `linux/of_address.h`, `linux/suspend.h`, `asm/cacheflush.h`, `asm/cp15.h`, `asm/idmap.h`, `asm/smp_plat.h`.
- Detected declarations: `function m10v_boot_secondary`, `function m10v_smp_init`, `function m10v_cpu_die`, `function m10v_cpu_kill`, `function m10v_pm_valid`, `function m10v_die`, `function m10v_pm_enter`, `function m10v_pm_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.