arch/arm/mach-orion5x/pci.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/pci.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/pci.c- Extension
.c- Size
- 15048 bytes
- Lines
- 602
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kernel.hlinux/pci.hlinux/slab.hlinux/mbus.hvideo/vga.hasm/irq.hasm/mach/pci.hplat/pcie.hplat/addr-map.hcommon.horion5x.h
Detected Declarations
function orion5x_pcie_idfunction pcie_valid_configfunction pcie_rd_conffunction pcie_rd_conf_wafunction methodfunction pcie_wr_conffunction pcie_setupfunction orion5x_pci_local_bus_nrfunction orion5x_pci_hw_rd_conffunction orion5x_pci_hw_wr_conffunction orion5x_pci_valid_configfunction orion5x_pci_rd_conffunction orion5x_pci_wr_conffunction orion5x_pci_set_bus_nrfunction orion5x_pci_master_slave_enablefunction orion5x_setup_pci_winsfunction pci_setupfunction rc_pci_fixupfunction pci_dev_for_each_resourcefunction orion5x_pci_disablefunction orion5x_pci_set_cardbus_modefunction orion5x_pci_sys_setupfunction orion5x_pci_sys_scan_busfunction orion5x_pci_map_irq
Annotated Snippet
pci_dev_for_each_resource(dev, r) {
r->start = 0;
r->end = 0;
r->flags = 0;
}
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
static int orion5x_pci_disabled __initdata;
void __init orion5x_pci_disable(void)
{
orion5x_pci_disabled = 1;
}
void __init orion5x_pci_set_cardbus_mode(void)
{
orion5x_pci_cardbus_mode = 1;
}
int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
{
vga_base = ORION5X_PCIE_MEM_PHYS_BASE;
if (nr == 0) {
orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
return pcie_setup(sys);
}
if (nr == 1 && !orion5x_pci_disabled) {
orion5x_pci_set_bus_nr(sys->busnr);
return pci_setup(sys);
}
return 0;
}
int __init orion5x_pci_sys_scan_bus(int nr, struct pci_host_bridge *bridge)
{
struct pci_sys_data *sys = pci_host_bridge_priv(bridge);
list_splice_init(&sys->resources, &bridge->windows);
bridge->dev.parent = NULL;
bridge->sysdata = sys;
bridge->busnr = sys->busnr;
if (nr == 0) {
bridge->ops = &pcie_ops;
return pci_scan_root_bus_bridge(bridge);
}
if (nr == 1 && !orion5x_pci_disabled) {
bridge->ops = &pci_ops;
return pci_scan_root_bus_bridge(bridge);
}
BUG();
return -ENODEV;
}
int __init orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int bus = dev->bus->number;
/*
* PCIe endpoint?
*/
if (orion5x_pci_disabled || bus < orion5x_pci_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;
return -1;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/pci.h`, `linux/slab.h`, `linux/mbus.h`, `video/vga.h`, `asm/irq.h`, `asm/mach/pci.h`, `plat/pcie.h`.
- Detected declarations: `function orion5x_pcie_id`, `function pcie_valid_config`, `function pcie_rd_conf`, `function pcie_rd_conf_wa`, `function method`, `function pcie_wr_conf`, `function pcie_setup`, `function orion5x_pci_local_bus_nr`, `function orion5x_pci_hw_rd_conf`, `function orion5x_pci_hw_wr_conf`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.