arch/arm/mach-meson/platsmp.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-meson/platsmp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-meson/platsmp.c- Extension
.c- Size
- 9883 bytes
- Lines
- 433
- 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/delay.hlinux/init.hlinux/io.hlinux/of.hlinux/of_address.hlinux/regmap.hlinux/reset.hlinux/smp.hlinux/mfd/syscon.hasm/cacheflush.hasm/cp15.hasm/smp_scu.hasm/smp_plat.h
Detected Declarations
function meson_smp_set_cpu_ctrlfunction meson_smp_prepare_cpusfunction meson8b_smp_prepare_cpusfunction meson8_smp_prepare_cpusfunction meson_smp_begin_secondary_bootfunction meson_smp_finalize_secondary_bootfunction meson8_smp_boot_secondaryfunction meson8b_smp_boot_secondaryfunction meson8_smp_cpu_diefunction meson8_smp_cpu_killfunction meson8b_smp_cpu_kill
Annotated Snippet
if (!time_before(jiffies, timeout)) {
pr_err("Timeout while waiting for CPU%d status\n",
cpu);
return -ETIMEDOUT;
}
}
writel(__pa_symbol(secondary_startup),
sram_base + MESON_SMP_SRAM_CPU_CTRL_ADDR_REG(cpu));
meson_smp_set_cpu_ctrl(cpu, true);
return 0;
}
static int meson8_smp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
{
struct reset_control *rstc;
int ret;
rstc = meson_smp_get_core_reset(cpu);
if (IS_ERR(rstc)) {
pr_err("Couldn't get the reset controller for CPU%d\n", cpu);
return PTR_ERR(rstc);
}
meson_smp_begin_secondary_boot(cpu);
/* Reset enable */
ret = reset_control_assert(rstc);
if (ret) {
pr_err("Failed to assert CPU%d reset\n", cpu);
goto out;
}
/* CPU power ON */
ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL1,
MESON_CPU_PWR_A9_CNTL1_M(cpu), 0);
if (ret < 0) {
pr_err("Couldn't wake up CPU%d\n", cpu);
goto out;
}
udelay(10);
/* Isolation disable */
ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0, BIT(cpu),
0);
if (ret < 0) {
pr_err("Error when disabling isolation of CPU%d\n", cpu);
goto out;
}
/* Reset disable */
ret = reset_control_deassert(rstc);
if (ret) {
pr_err("Failed to de-assert CPU%d reset\n", cpu);
goto out;
}
ret = meson_smp_finalize_secondary_boot(cpu);
if (ret)
goto out;
out:
reset_control_put(rstc);
return 0;
}
static int meson8b_smp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
{
struct reset_control *rstc;
int ret;
u32 val;
rstc = meson_smp_get_core_reset(cpu);
if (IS_ERR(rstc)) {
pr_err("Couldn't get the reset controller for CPU%d\n", cpu);
return PTR_ERR(rstc);
}
meson_smp_begin_secondary_boot(cpu);
/* CPU power UP */
ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0,
MESON_CPU_PWR_A9_CNTL0_M(cpu), 0);
if (ret < 0) {
Annotation
- Immediate include surface: `linux/delay.h`, `linux/init.h`, `linux/io.h`, `linux/of.h`, `linux/of_address.h`, `linux/regmap.h`, `linux/reset.h`, `linux/smp.h`.
- Detected declarations: `function meson_smp_set_cpu_ctrl`, `function meson_smp_prepare_cpus`, `function meson8b_smp_prepare_cpus`, `function meson8_smp_prepare_cpus`, `function meson_smp_begin_secondary_boot`, `function meson_smp_finalize_secondary_boot`, `function meson8_smp_boot_secondary`, `function meson8b_smp_boot_secondary`, `function meson8_smp_cpu_die`, `function meson8_smp_cpu_kill`.
- 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.