arch/powerpc/kernel/isa-bridge.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/isa-bridge.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/isa-bridge.c- Extension
.c- Size
- 7317 bytes
- Lines
- 277
- 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.
- 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/string.hlinux/export.hlinux/init.hlinux/mm.hlinux/notifier.hlinux/of_address.hlinux/vmalloc.hasm/processor.hasm/io.hasm/pci-bridge.hasm/machdep.hasm/ppc-pci.hasm/isa-bridge.h
Detected Declarations
function remap_isa_basefunction process_ISA_OF_rangesfunction for_each_of_rangefunction isa_bridge_find_earlyfunction isa_bridge_init_non_pcifunction isa_bridge_find_latefunction isa_bridge_removefunction isa_bridge_notifyfunction isa_bridge_initexport isa_io_baseexport isa_bridge_pcidev
Annotated Snippet
if (range.cpu_addr == OF_BAD_ADDR) {
pr_err("ISA: Bad CPU mapping: %s\n", __func__);
return -EINVAL;
}
/* We need page alignment */
if ((range.bus_addr & ~PAGE_MASK) || (range.cpu_addr & ~PAGE_MASK)) {
pr_warn("ISA: bridge %pOF has non aligned IO range\n", isa_node);
return -EINVAL;
}
/* Align size and make sure it's cropped to 64K */
size = PAGE_ALIGN(range.size);
if (size > 0x10000)
size = 0x10000;
if (!phb_io_base_phys)
phb_io_base_phys = range.cpu_addr;
remap_isa_base(phb_io_base_phys, size);
return 0;
}
inval_range:
if (phb_io_base_phys) {
pr_err("no ISA IO ranges or unexpected isa range, mapping 64k\n");
remap_isa_base(phb_io_base_phys, 0x10000);
return 0;
}
return -EINVAL;
}
/**
* isa_bridge_find_early - Find and map the ISA IO space early before
* main PCI discovery. This is optionally called by
* the arch code when adding PCI PHBs to get early
* access to ISA IO ports
*/
void __init isa_bridge_find_early(struct pci_controller *hose)
{
struct device_node *np, *parent = NULL, *tmp;
/* If we already have an ISA bridge, bail off */
if (isa_bridge_devnode != NULL)
return;
/* For each "isa" node in the system. Note : we do a search by
* type and not by name. It might be better to do by name but that's
* what the code used to do and I don't want to break too much at
* once. We can look into changing that separately
*/
for_each_node_by_type(np, "isa") {
/* Look for our hose being a parent */
for (parent = of_get_parent(np); parent;) {
if (parent == hose->dn) {
of_node_put(parent);
break;
}
tmp = parent;
parent = of_get_parent(parent);
of_node_put(tmp);
}
if (parent != NULL)
break;
}
if (np == NULL)
return;
isa_bridge_devnode = np;
/* Now parse the "ranges" property and setup the ISA mapping */
process_ISA_OF_ranges(np, hose->io_base_phys);
/* Set the global ISA io base to indicate we have an ISA bridge */
isa_io_base = ISA_IO_BASE;
pr_debug("ISA bridge (early) is %pOF\n", np);
}
/**
* isa_bridge_find_early - Find and map the ISA IO space early before
* main PCI discovery. This is optionally called by
* the arch code when adding PCI PHBs to get early
* access to ISA IO ports
*/
void __init isa_bridge_init_non_pci(struct device_node *np)
{
int ret;
/* If we already have an ISA bridge, bail off */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/pci.h`, `linux/string.h`, `linux/export.h`, `linux/init.h`, `linux/mm.h`, `linux/notifier.h`, `linux/of_address.h`.
- Detected declarations: `function remap_isa_base`, `function process_ISA_OF_ranges`, `function for_each_of_range`, `function isa_bridge_find_early`, `function isa_bridge_init_non_pci`, `function isa_bridge_find_late`, `function isa_bridge_remove`, `function isa_bridge_notify`, `function isa_bridge_init`, `export isa_io_base`.
- 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.