arch/arm/mach-mvebu/pmsu.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-mvebu/pmsu.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-mvebu/pmsu.c- Extension
.c- Size
- 16597 bytes
- Lines
- 608
- 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/clk.hlinux/cpu_pm.hlinux/delay.hlinux/init.hlinux/io.hlinux/kernel.hlinux/mbus.hlinux/mvebu-pmsu.hlinux/of.hlinux/of_address.hlinux/platform_device.hlinux/resource.hlinux/slab.hlinux/smp.hasm/cacheflush.hasm/cp15.hasm/smp_scu.hasm/smp_plat.hasm/suspend.hasm/tlbflush.hcommon.hpmsu.h
Detected Declarations
enum pmsu_idle_prepare_flagsfunction mvebu_pmsu_set_cpu_boot_addrfunction mvebu_setup_boot_addr_wafunction mvebu_v7_pmsu_initfunction mvebu_v7_pmsu_enable_l2_powerdown_onidlefunction mvebu_v7_pmsu_idle_preparefunction armada_370_xp_pmsu_idle_enterfunction armada_370_xp_cpu_suspendfunction armada_38x_do_cpu_suspendfunction armada_38x_cpu_suspendfunction mvebu_v7_pmsu_idle_exitfunction mvebu_v7_cpu_pm_notifyfunction broken_idlefunction armada_370_cpuidle_initfunction armada_38x_cpuidle_initfunction armada_xp_cpuidle_initfunction mvebu_v7_cpu_pm_initfunction mvebu_pmsu_dfs_request_localfunction mvebu_pmsu_dfs_request
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Power Management Service Unit(PMSU) support for Armada 370/XP platforms.
*
* Copyright (C) 2012 Marvell
*
* Yehuda Yitschak <yehuday@marvell.com>
* Gregory Clement <gregory.clement@free-electrons.com>
* Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
*
* The Armada 370 and Armada XP SOCs have a power management service
* unit which is responsible for powering down and waking up CPUs and
* other SOC units
*/
#define pr_fmt(fmt) "mvebu-pmsu: " fmt
#include <linux/clk.h>
#include <linux/cpu_pm.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mbus.h>
#include <linux/mvebu-pmsu.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/resource.h>
#include <linux/slab.h>
#include <linux/smp.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
#include <asm/smp_scu.h>
#include <asm/smp_plat.h>
#include <asm/suspend.h>
#include <asm/tlbflush.h>
#include "common.h"
#include "pmsu.h"
#define PMSU_BASE_OFFSET 0x100
#define PMSU_REG_SIZE 0x1000
/* PMSU MP registers */
#define PMSU_CONTROL_AND_CONFIG(cpu) ((cpu * 0x100) + 0x104)
#define PMSU_CONTROL_AND_CONFIG_DFS_REQ BIT(18)
#define PMSU_CONTROL_AND_CONFIG_PWDDN_REQ BIT(16)
#define PMSU_CONTROL_AND_CONFIG_L2_PWDDN BIT(20)
#define PMSU_CPU_POWER_DOWN_CONTROL(cpu) ((cpu * 0x100) + 0x108)
#define PMSU_CPU_POWER_DOWN_DIS_SNP_Q_SKIP BIT(0)
#define PMSU_STATUS_AND_MASK(cpu) ((cpu * 0x100) + 0x10c)
#define PMSU_STATUS_AND_MASK_CPU_IDLE_WAIT BIT(16)
#define PMSU_STATUS_AND_MASK_SNP_Q_EMPTY_WAIT BIT(17)
#define PMSU_STATUS_AND_MASK_IRQ_WAKEUP BIT(20)
#define PMSU_STATUS_AND_MASK_FIQ_WAKEUP BIT(21)
#define PMSU_STATUS_AND_MASK_DBG_WAKEUP BIT(22)
#define PMSU_STATUS_AND_MASK_IRQ_MASK BIT(24)
#define PMSU_STATUS_AND_MASK_FIQ_MASK BIT(25)
#define PMSU_EVENT_STATUS_AND_MASK(cpu) ((cpu * 0x100) + 0x120)
#define PMSU_EVENT_STATUS_AND_MASK_DFS_DONE BIT(1)
#define PMSU_EVENT_STATUS_AND_MASK_DFS_DONE_MASK BIT(17)
#define PMSU_BOOT_ADDR_REDIRECT_OFFSET(cpu) ((cpu * 0x100) + 0x124)
/* PMSU fabric registers */
#define L2C_NFABRIC_PM_CTL 0x4
#define L2C_NFABRIC_PM_CTL_PWR_DOWN BIT(20)
/* PMSU delay registers */
#define PMSU_POWERDOWN_DELAY 0xF04
#define PMSU_POWERDOWN_DELAY_PMU BIT(1)
#define PMSU_POWERDOWN_DELAY_MASK 0xFFFE
#define PMSU_DFLT_ARMADA38X_DELAY 0x64
/* CA9 MPcore SoC Control registers */
#define MPCORE_RESET_CTL 0x64
#define MPCORE_RESET_CTL_L2 BIT(0)
#define MPCORE_RESET_CTL_DEBUG BIT(16)
#define SRAM_PHYS_BASE 0xFFFF0000
#define BOOTROM_BASE 0xFFF00000
#define BOOTROM_SIZE 0x100000
#define ARMADA_370_CRYPT0_ENG_TARGET 0x9
#define ARMADA_370_CRYPT0_ENG_ATTR 0x1
Annotation
- Immediate include surface: `linux/clk.h`, `linux/cpu_pm.h`, `linux/delay.h`, `linux/init.h`, `linux/io.h`, `linux/kernel.h`, `linux/mbus.h`, `linux/mvebu-pmsu.h`.
- Detected declarations: `enum pmsu_idle_prepare_flags`, `function mvebu_pmsu_set_cpu_boot_addr`, `function mvebu_setup_boot_addr_wa`, `function mvebu_v7_pmsu_init`, `function mvebu_v7_pmsu_enable_l2_powerdown_onidle`, `function mvebu_v7_pmsu_idle_prepare`, `function armada_370_xp_pmsu_idle_enter`, `function armada_370_xp_cpu_suspend`, `function armada_38x_do_cpu_suspend`, `function armada_38x_cpu_suspend`.
- 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.