arch/powerpc/platforms/85xx/p2020.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/85xx/p2020.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/85xx/p2020.c- Extension
.c- Size
- 1702 bytes
- Lines
- 82
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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/stddef.hlinux/kernel.hlinux/of.hasm/machdep.hasm/udbg.hasm/mpic.hasm/swiotlb.hasm/ppc-pci.hsysdev/fsl_pci.hsmp.hmpc85xx.h
Detected Declarations
function p2020_pic_initfunction p2020_setup_archfunction p2020_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Freescale P2020 board Setup
*
* Copyright 2007,2009,2012-2013 Freescale Semiconductor Inc.
* Copyright 2022-2023 Pali Rohár <pali@kernel.org>
*/
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <asm/machdep.h>
#include <asm/udbg.h>
#include <asm/mpic.h>
#include <asm/swiotlb.h>
#include <asm/ppc-pci.h>
#include <sysdev/fsl_pci.h>
#include "smp.h"
#include "mpc85xx.h"
static void __init p2020_pic_init(void)
{
struct mpic *mpic;
int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU;
mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
if (WARN_ON(!mpic))
return;
mpic_init(mpic);
mpc85xx_8259_init();
}
/*
* Setup the architecture
*/
static void __init p2020_setup_arch(void)
{
swiotlb_detect_4g();
fsl_pci_assign_primary();
uli_init();
mpc85xx_smp_init();
mpc85xx_qe_par_io_init();
}
/*
* Called very early, device-tree isn't unflattened
*/
static int __init p2020_probe(void)
{
struct device_node *p2020_cpu;
/*
* There is no common compatible string for all P2020 boards.
* The only common thing is "PowerPC,P2020@0" cpu node.
* So check for P2020 board via this cpu node.
*/
p2020_cpu = of_find_node_by_path("/cpus/PowerPC,P2020@0");
of_node_put(p2020_cpu);
return !!p2020_cpu;
}
machine_arch_initcall(p2020, mpc85xx_common_publish_devices);
define_machine(p2020) {
.name = "Freescale P2020",
.probe = p2020_probe,
.setup_arch = p2020_setup_arch,
.init_IRQ = p2020_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
#endif
.get_irq = mpic_get_irq,
.progress = udbg_progress,
};
Annotation
- Immediate include surface: `linux/stddef.h`, `linux/kernel.h`, `linux/of.h`, `asm/machdep.h`, `asm/udbg.h`, `asm/mpic.h`, `asm/swiotlb.h`, `asm/ppc-pci.h`.
- Detected declarations: `function p2020_pic_init`, `function p2020_setup_arch`, `function p2020_probe`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.