arch/arm/mach-zynq/common.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-zynq/common.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-zynq/common.c- Extension
.c- Size
- 4632 bytes
- Lines
- 201
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/io.hlinux/kernel.hlinux/cpumask.hlinux/platform_device.hlinux/clk.hlinux/clk/zynq.hlinux/clocksource.hlinux/of_address.hlinux/of_clk.hlinux/of_irq.hlinux/of_platform.hlinux/of.hlinux/memblock.hlinux/irqchip.hlinux/irqchip/arm-gic.hlinux/slab.hlinux/sys_soc.hlinux/pgtable.hasm/mach/arch.hasm/mach/map.hasm/mach/time.hasm/mach-types.hasm/page.hasm/smp_scu.hasm/system_info.hasm/hardware/cache-l2x0.hcommon.h
Detected Declarations
function zynq_memory_initfunction zynq_get_revisionfunction zynq_init_latefunction zynq_init_machinefunction zynq_timer_initfunction zynq_scu_map_iofunction zynq_map_iofunction zynq_irq_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* This file contains common code that is intended to be used across
* boards so that it's not replicated.
*
* Copyright (C) 2011 Xilinx
*/
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/cpumask.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/clk/zynq.h>
#include <linux/clocksource.h>
#include <linux/of_address.h>
#include <linux/of_clk.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/of.h>
#include <linux/memblock.h>
#include <linux/irqchip.h>
#include <linux/irqchip/arm-gic.h>
#include <linux/slab.h>
#include <linux/sys_soc.h>
#include <linux/pgtable.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/mach-types.h>
#include <asm/page.h>
#include <asm/smp_scu.h>
#include <asm/system_info.h>
#include <asm/hardware/cache-l2x0.h>
#include "common.h"
#define ZYNQ_DEVCFG_MCTRL 0x80
#define ZYNQ_DEVCFG_PS_VERSION_SHIFT 28
#define ZYNQ_DEVCFG_PS_VERSION_MASK 0xF
void __iomem *zynq_scu_base;
/**
* zynq_memory_init - Initialize special memory
*
* We need to stop things allocating the low memory as DMA can't work in
* the 1st 512K of memory.
*/
static void __init zynq_memory_init(void)
{
if (!__pa(PAGE_OFFSET))
memblock_reserve(__pa(PAGE_OFFSET), 0x80000);
}
static struct platform_device zynq_cpuidle_device = {
.name = "cpuidle-zynq",
};
/**
* zynq_get_revision - Get Zynq silicon revision
*
* Return: Silicon version or -1 otherwise
*/
static int __init zynq_get_revision(void)
{
struct device_node *np;
void __iomem *zynq_devcfg_base;
u32 revision;
np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-devcfg-1.0");
if (!np) {
pr_err("%s: no devcfg node found\n", __func__);
return -1;
}
zynq_devcfg_base = of_iomap(np, 0);
of_node_put(np);
if (!zynq_devcfg_base) {
pr_err("%s: Unable to map I/O memory\n", __func__);
return -1;
}
revision = readl(zynq_devcfg_base + ZYNQ_DEVCFG_MCTRL);
revision >>= ZYNQ_DEVCFG_PS_VERSION_SHIFT;
revision &= ZYNQ_DEVCFG_PS_VERSION_MASK;
iounmap(zynq_devcfg_base);
Annotation
- Immediate include surface: `linux/init.h`, `linux/io.h`, `linux/kernel.h`, `linux/cpumask.h`, `linux/platform_device.h`, `linux/clk.h`, `linux/clk/zynq.h`, `linux/clocksource.h`.
- Detected declarations: `function zynq_memory_init`, `function zynq_get_revision`, `function zynq_init_late`, `function zynq_init_machine`, `function zynq_timer_init`, `function zynq_scu_map_io`, `function zynq_map_io`, `function zynq_irq_init`.
- 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.