arch/arm/mach-aspeed/platsmp.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-aspeed/platsmp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-aspeed/platsmp.c- Extension
.c- Size
- 1409 bytes
- Lines
- 62
- 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/of_address.hlinux/io.hlinux/of.hlinux/smp.h
Detected Declarations
function aspeed_g6_boot_secondaryfunction aspeed_g6_smp_prepare_cpus
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (C) ASPEED Technology Inc.
// Copyright IBM Corp.
#include <linux/of_address.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/smp.h>
#define BOOT_ADDR 0x00
#define BOOT_SIG 0x04
static struct device_node *secboot_node;
static int aspeed_g6_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
void __iomem *base;
base = of_iomap(secboot_node, 0);
if (!base) {
pr_err("could not map the secondary boot base!");
return -ENODEV;
}
writel_relaxed(0, base + BOOT_ADDR);
writel_relaxed(__pa_symbol(secondary_startup_arm), base + BOOT_ADDR);
writel_relaxed((0xABBAAB00 | (cpu & 0xff)), base + BOOT_SIG);
dsb_sev();
iounmap(base);
return 0;
}
static void __init aspeed_g6_smp_prepare_cpus(unsigned int max_cpus)
{
void __iomem *base;
secboot_node = of_find_compatible_node(NULL, NULL, "aspeed,ast2600-smpmem");
if (!secboot_node) {
pr_err("secboot device node found!!\n");
return;
}
base = of_iomap(secboot_node, 0);
if (!base) {
pr_err("could not map the secondary boot base!");
return;
}
__raw_writel(0xBADABABA, base + BOOT_SIG);
iounmap(base);
}
static const struct smp_operations aspeed_smp_ops __initconst = {
.smp_prepare_cpus = aspeed_g6_smp_prepare_cpus,
.smp_boot_secondary = aspeed_g6_boot_secondary,
};
CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp", &aspeed_smp_ops);
Annotation
- Immediate include surface: `linux/of_address.h`, `linux/io.h`, `linux/of.h`, `linux/smp.h`.
- Detected declarations: `function aspeed_g6_boot_secondary`, `function aspeed_g6_smp_prepare_cpus`.
- 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.