arch/arm/mach-sunxi/mc_smp.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-sunxi/mc_smp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-sunxi/mc_smp.c- Extension
.c- Size
- 25101 bytes
- Lines
- 914
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/arm-cci.hlinux/cpu_pm.hlinux/delay.hlinux/io.hlinux/iopoll.hlinux/irqchip/arm-gic.hlinux/of.hlinux/of_address.hlinux/smp.hasm/cacheflush.hasm/cp15.hasm/cputype.hasm/idmap.hasm/smp_plat.hasm/suspend.h
Detected Declarations
struct sunxi_mc_smp_nodesstruct sunxi_mc_smp_datafunction sunxi_core_is_cortex_a15function sunxi_cpu_power_switch_setfunction sunxi_cpu0_hotplug_support_setfunction sunxi_cpu_powerupfunction sunxi_cluster_powerupfunction sunxi_cluster_cache_disable_without_axifunction sunxi_mc_smp_cluster_is_downfunction sunxi_mc_smp_secondary_initfunction sunxi_mc_smp_boot_secondaryfunction sunxi_cluster_cache_disablefunction sunxi_mc_smp_cpu_diefunction sunxi_cpu_powerdownfunction sunxi_cluster_powerdownfunction sunxi_mc_smp_cpu_killfunction sunxi_mc_smp_cpu_can_disablefunction sunxi_mc_smp_cpu_table_initfunction nocache_trampolinefunction sunxi_mc_smp_loopbackfunction sunxi_mc_smp_put_nodesfunction sun9i_a80_get_smp_nodesfunction sun8i_a83t_get_smp_nodesfunction sunxi_mc_smp_init
Annotated Snippet
struct sunxi_mc_smp_nodes {
struct device_node *prcm_node;
struct device_node *cpucfg_node;
struct device_node *sram_node;
struct device_node *r_cpucfg_node;
};
/* This structure holds SoC-specific bits tied to an enable-method string. */
struct sunxi_mc_smp_data {
const char *enable_method;
int (*get_smp_nodes)(struct sunxi_mc_smp_nodes *nodes);
bool is_a83t;
};
static void __init sunxi_mc_smp_put_nodes(struct sunxi_mc_smp_nodes *nodes)
{
of_node_put(nodes->prcm_node);
of_node_put(nodes->cpucfg_node);
of_node_put(nodes->sram_node);
of_node_put(nodes->r_cpucfg_node);
memset(nodes, 0, sizeof(*nodes));
}
static int __init sun9i_a80_get_smp_nodes(struct sunxi_mc_smp_nodes *nodes)
{
nodes->prcm_node = of_find_compatible_node(NULL, NULL,
"allwinner,sun9i-a80-prcm");
if (!nodes->prcm_node) {
pr_err("%s: PRCM not available\n", __func__);
return -ENODEV;
}
nodes->cpucfg_node = of_find_compatible_node(NULL, NULL,
"allwinner,sun9i-a80-cpucfg");
if (!nodes->cpucfg_node) {
pr_err("%s: CPUCFG not available\n", __func__);
return -ENODEV;
}
nodes->sram_node = of_find_compatible_node(NULL, NULL,
"allwinner,sun9i-a80-smp-sram");
if (!nodes->sram_node) {
pr_err("%s: Secure SRAM not available\n", __func__);
return -ENODEV;
}
return 0;
}
static int __init sun8i_a83t_get_smp_nodes(struct sunxi_mc_smp_nodes *nodes)
{
nodes->prcm_node = of_find_compatible_node(NULL, NULL,
"allwinner,sun8i-a83t-r-ccu");
if (!nodes->prcm_node) {
pr_err("%s: PRCM not available\n", __func__);
return -ENODEV;
}
nodes->cpucfg_node = of_find_compatible_node(NULL, NULL,
"allwinner,sun8i-a83t-cpucfg");
if (!nodes->cpucfg_node) {
pr_err("%s: CPUCFG not available\n", __func__);
return -ENODEV;
}
nodes->r_cpucfg_node = of_find_compatible_node(NULL, NULL,
"allwinner,sun8i-a83t-r-cpucfg");
if (!nodes->r_cpucfg_node) {
pr_err("%s: RCPUCFG not available\n", __func__);
return -ENODEV;
}
return 0;
}
static const struct sunxi_mc_smp_data sunxi_mc_smp_data[] __initconst = {
{
.enable_method = "allwinner,sun9i-a80-smp",
.get_smp_nodes = sun9i_a80_get_smp_nodes,
},
{
.enable_method = "allwinner,sun8i-a83t-smp",
.get_smp_nodes = sun8i_a83t_get_smp_nodes,
.is_a83t = true,
},
};
static int __init sunxi_mc_smp_init(void)
{
struct sunxi_mc_smp_nodes nodes = { 0 };
Annotation
- Immediate include surface: `linux/arm-cci.h`, `linux/cpu_pm.h`, `linux/delay.h`, `linux/io.h`, `linux/iopoll.h`, `linux/irqchip/arm-gic.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `struct sunxi_mc_smp_nodes`, `struct sunxi_mc_smp_data`, `function sunxi_core_is_cortex_a15`, `function sunxi_cpu_power_switch_set`, `function sunxi_cpu0_hotplug_support_set`, `function sunxi_cpu_powerup`, `function sunxi_cluster_powerup`, `function sunxi_cluster_cache_disable_without_axi`, `function sunxi_mc_smp_cluster_is_down`, `function sunxi_mc_smp_secondary_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.