arch/powerpc/platforms/chrp/pci.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/chrp/pci.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/chrp/pci.c- Extension
.c- Size
- 10807 bytes
- Lines
- 388
- 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/kernel.hlinux/pci.hlinux/delay.hlinux/string.hlinux/init.hlinux/pgtable.hlinux/of_address.hasm/io.hasm/irq.hasm/hydra.hasm/machdep.hasm/sections.hasm/pci-bridge.hasm/grackle.hasm/rtas.hchrp.hgg2.h
Detected Declarations
function gg2_read_configfunction gg2_write_configfunction rtas_read_configfunction rtas_write_configfunction hydra_initfunction setup_pythonfunction setup_peg2function chrp_find_bridgesfunction chrp_pci_fixup_winbond_atafunction chrp_pci_fixup_vt8231_ata
Annotated Snippet
if (of_address_to_resource(dev, 0, &r) && !is_longtrail) {
printk(KERN_WARNING "Can't use %pOF: no address\n",
dev);
continue;
}
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\n",
dev);
continue;
}
if (bus_range[1] == bus_range[0])
printk(KERN_INFO "PCI bus %d", bus_range[0]);
else
printk(KERN_INFO "PCI buses %d..%d",
bus_range[0], bus_range[1]);
printk(" controlled by %pOF", dev);
if (!is_longtrail)
printk(" at %llx", (unsigned long long)r.start);
printk("\n");
hose = pcibios_alloc_controller(dev);
if (!hose) {
printk("Can't allocate PCI controller structure for %pOF\n",
dev);
continue;
}
hose->first_busno = hose->self_busno = bus_range[0];
hose->last_busno = bus_range[1];
model = of_get_property(dev, "model", NULL);
if (model == NULL)
model = "<none>";
if (strncmp(model, "IBM, Python", 11) == 0) {
setup_python(hose, dev);
} else if (is_mot
|| strncmp(model, "Motorola, Grackle", 17) == 0) {
setup_grackle(hose);
} else if (is_longtrail) {
void __iomem *p = ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
hose->ops = &gg2_pci_ops;
hose->cfg_data = p;
gg2_pci_config_base = p;
} else if (is_pegasos == 1) {
setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc, 0);
} else if (is_pegasos == 2) {
setup_peg2(hose, dev);
} else if (!strncmp(model, "IBM,CPC710", 10)) {
setup_indirect_pci(hose,
r.start + 0x000f8000,
r.start + 0x000f8010,
0);
if (index == 0) {
dma = of_get_property(dev, "system-dma-base",
&len);
if (dma && len >= sizeof(*dma)) {
dma = (unsigned int *)
(((unsigned long)dma) +
len - sizeof(*dma));
pci_dram_offset = *dma;
}
}
} else {
printk("No methods for %pOF (model %s), using RTAS\n",
dev, model);
hose->ops = &rtas_pci_ops;
}
pci_process_bridge_OF_ranges(hose, dev, index == 0);
/* check the first bridge for a property that we can
use to set pci_dram_offset */
dma = of_get_property(dev, "ibm,dma-ranges", &len);
if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
pci_dram_offset = dma[2] - dma[3];
printk("pci_dram_offset = %lx\n", pci_dram_offset);
}
}
of_node_put(root);
/*
* "Temporary" fixes for PCI devices.
* -- Geert
*/
hydra_init(); /* Mac I/O */
pci_create_OF_bus_map();
}
/* SL82C105 IDE Control/Status Register */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/pci.h`, `linux/delay.h`, `linux/string.h`, `linux/init.h`, `linux/pgtable.h`, `linux/of_address.h`, `asm/io.h`.
- Detected declarations: `function gg2_read_config`, `function gg2_write_config`, `function rtas_read_config`, `function rtas_write_config`, `function hydra_init`, `function setup_python`, `function setup_peg2`, `function chrp_find_bridges`, `function chrp_pci_fixup_winbond_ata`, `function chrp_pci_fixup_vt8231_ata`.
- 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.