arch/arm/mach-rockchip/platsmp.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-rockchip/platsmp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-rockchip/platsmp.c- Extension
.c- Size
- 9298 bytes
- Lines
- 382
- 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/smp.hlinux/io.hlinux/of.hlinux/of_address.hlinux/regmap.hlinux/mfd/syscon.hlinux/reset.hlinux/cpu.hasm/cacheflush.hasm/cp15.hasm/smp_scu.hasm/smp_plat.hasm/mach/map.hcore.h
Detected Declarations
function pmu_power_domain_is_onfunction pmu_set_power_domainfunction rockchip_boot_secondaryfunction rockchip_smp_prepare_sramfunction rockchip_smp_prepare_pmufunction rockchip_smp_prepare_cpusfunction rk3036_smp_prepare_cpusfunction rockchip_cpu_killfunction rockchip_cpu_die
Annotated Snippet
if (ret < 0) {
pr_err("%s: could not update power domain\n",
__func__);
return ret;
}
ret = -1;
while (ret != on) {
ret = pmu_power_domain_is_on(pd);
if (ret < 0) {
pr_err("%s: could not read power domain state\n",
__func__);
return ret;
}
}
}
if (!IS_ERR(rstc) && on)
reset_control_deassert(rstc);
return 0;
}
/*
* Handling of CPU cores
*/
static int rockchip_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
int ret;
if (!sram_base_addr || (has_pmu && !pmu)) {
pr_err("%s: sram or pmu missing for cpu boot\n", __func__);
return -ENXIO;
}
if (cpu >= ncores) {
pr_err("%s: cpu %d outside maximum number of cpus %d\n",
__func__, cpu, ncores);
return -ENXIO;
}
/* start the core */
ret = pmu_set_power_domain(0 + cpu, true);
if (ret < 0)
return ret;
if (read_cpuid_part() != ARM_CPU_PART_CORTEX_A9) {
/*
* We communicate with the bootrom to active the cpus other
* than cpu0, after a blob of initialize code, they will
* stay at wfe state, once they are activated, they will check
* the mailbox:
* sram_base_addr + 4: 0xdeadbeaf
* sram_base_addr + 8: start address for pc
* The cpu0 need to wait the other cpus other than cpu0 entering
* the wfe state.The wait time is affected by many aspects.
* (e.g: cpu frequency, bootrom frequency, sram frequency, ...)
*/
mdelay(1); /* ensure the cpus other than cpu0 to startup */
writel(__pa_symbol(secondary_startup), sram_base_addr + 8);
writel(0xDEADBEAF, sram_base_addr + 4);
dsb_sev();
}
return 0;
}
/**
* rockchip_smp_prepare_sram - populate necessary sram block
* Starting cores execute the code residing at the start of the on-chip sram
* after power-on. Therefore make sure, this sram region is reserved and
* big enough. After this check, copy the trampoline code that directs the
* core to the real startup code in ram into the sram-region.
* @node: mmio-sram device node
*/
static int __init rockchip_smp_prepare_sram(struct device_node *node)
{
unsigned int trampoline_sz = &rockchip_secondary_trampoline_end -
&rockchip_secondary_trampoline;
struct resource res;
unsigned int rsize;
int ret;
ret = of_address_to_resource(node, 0, &res);
if (ret < 0) {
pr_err("%s: could not get address for node %pOF\n",
__func__, node);
return ret;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/init.h`, `linux/smp.h`, `linux/io.h`, `linux/of.h`, `linux/of_address.h`, `linux/regmap.h`, `linux/mfd/syscon.h`.
- Detected declarations: `function pmu_power_domain_is_on`, `function pmu_set_power_domain`, `function rockchip_boot_secondary`, `function rockchip_smp_prepare_sram`, `function rockchip_smp_prepare_pmu`, `function rockchip_smp_prepare_cpus`, `function rk3036_smp_prepare_cpus`, `function rockchip_cpu_kill`, `function rockchip_cpu_die`.
- 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.