arch/powerpc/platforms/amigaone/setup.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/amigaone/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/amigaone/setup.c- Extension
.c- Size
- 4161 bytes
- Lines
- 169
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/irqdomain.hlinux/kernel.hlinux/of.hlinux/of_address.hlinux/seq_file.hgenerated/utsrelease.hasm/machdep.hasm/cputable.hasm/pci-bridge.hasm/i8259.hasm/time.hasm/udbg.hasm/dma.h
Detected Declarations
function amigaone_show_cpuinfofunction amigaone_add_bridgefunction amigaone_setup_archfunction amigaone_discover_phbsfunction amigaone_init_IRQfunction request_isa_regionsfunction amigaone_restartfunction amigaone_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* AmigaOne platform setup
*
* Copyright 2008 Gerhard Pircher (gerhard_pircher@gmx.net)
*
* Based on original amigaone_setup.c source code
* Copyright 2003 by Hans-Joerg Frieden and Thomas Frieden
*/
#include <linux/irqdomain.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/seq_file.h>
#include <generated/utsrelease.h>
#include <asm/machdep.h>
#include <asm/cputable.h>
#include <asm/pci-bridge.h>
#include <asm/i8259.h>
#include <asm/time.h>
#include <asm/udbg.h>
#include <asm/dma.h>
extern void __flush_disable_L1(void);
static void amigaone_show_cpuinfo(struct seq_file *m)
{
seq_printf(m, "vendor\t\t: Eyetech Ltd.\n");
}
static int __init amigaone_add_bridge(struct device_node *dev)
{
const u32 *cfg_addr, *cfg_data;
int len;
const int *bus_range;
struct pci_controller *hose;
printk(KERN_INFO "Adding PCI host bridge %pOF\n", dev);
cfg_addr = of_get_address(dev, 0, NULL, NULL);
cfg_data = of_get_address(dev, 1, NULL, NULL);
if ((cfg_addr == NULL) || (cfg_data == NULL))
return -ENODEV;
bus_range = of_get_property(dev, "bus-range", &len);
if ((bus_range == NULL) || (len < 2 * sizeof(int)))
printk(KERN_WARNING "Can't get bus-range for %pOF, assume"
" bus 0\n", dev);
hose = pcibios_alloc_controller(dev);
if (hose == NULL)
return -ENOMEM;
hose->first_busno = bus_range ? bus_range[0] : 0;
hose->last_busno = bus_range ? bus_range[1] : 0xff;
setup_indirect_pci(hose, cfg_addr[0], cfg_data[0], 0);
/* Interpret the "ranges" property */
/* This also maps the I/O region and sets isa_io/mem_base */
pci_process_bridge_OF_ranges(hose, dev, 1);
return 0;
}
static void __init amigaone_setup_arch(void)
{
if (ppc_md.progress)
ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0);
}
static void __init amigaone_discover_phbs(void)
{
struct device_node *np;
int phb = -ENODEV;
/* Lookup PCI host bridges. */
for_each_compatible_node(np, "pci", "mai-logic,articia-s")
phb = amigaone_add_bridge(np);
BUG_ON(phb != 0);
}
static void __init amigaone_init_IRQ(void)
{
struct device_node *pic, *np = NULL;
const unsigned long *prop = NULL;
unsigned long int_ack = 0;
Annotation
- Immediate include surface: `linux/irqdomain.h`, `linux/kernel.h`, `linux/of.h`, `linux/of_address.h`, `linux/seq_file.h`, `generated/utsrelease.h`, `asm/machdep.h`, `asm/cputable.h`.
- Detected declarations: `function amigaone_show_cpuinfo`, `function amigaone_add_bridge`, `function amigaone_setup_arch`, `function amigaone_discover_phbs`, `function amigaone_init_IRQ`, `function request_isa_regions`, `function amigaone_restart`, `function amigaone_probe`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration 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.