arch/powerpc/platforms/pasemi/pci.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pasemi/pci.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pasemi/pci.c- Extension
.c- Size
- 6466 bytes
- Lines
- 296
- 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/of_address.hlinux/pci.hasm/pci-bridge.hasm/isa-bridge.hasm/machdep.hasm/ppc-pci.hpasemi.h
Detected Declarations
function Copyrightfunction is_root_portfunction is_5945_regfunction workaround_5945function sb600_set_flagfunction sb600_set_flagfunction pa_pxp_write_configfunction setup_pa_pxpfunction pas_add_bridgefunction pas_pci_initfunction pasemi_pci_getcfgaddr
Annotated Snippet
if (!dn) {
pr_crit("NEMO SB600 missing iob node\n");
return;
}
err = of_address_to_resource(dn, 0, &res);
of_node_put(dn);
if (err) {
pr_crit("NEMO SB600 missing resource\n");
return;
}
pr_info("NEMO SB600 IOB base %08llx\n",res.start);
iob_mapbase = ioremap(res.start + 0x100, 0x94);
}
if (iob_mapbase != NULL) {
if (bus == SB600_BUS) {
/*
* This is the SB600's bus, tell the PCI-e root port
* to allow non-zero devices to enumerate.
*/
out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) | PXP_IGNORE_PCIE_ERRORS);
} else {
/*
* Only scan device 0 on other busses
*/
out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) & ~PXP_IGNORE_PCIE_ERRORS);
}
}
}
#else
static void sb600_set_flag(int bus)
{
}
#endif
static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val)
{
struct pci_controller *hose;
void volatile __iomem *addr;
hose = pci_bus_to_host(bus);
if (!hose)
return PCIBIOS_DEVICE_NOT_FOUND;
if (!pa_pxp_offset_valid(bus->number, devfn, offset))
return PCIBIOS_BAD_REGISTER_NUMBER;
if (workaround_5945(bus, devfn, offset, len, val))
return PCIBIOS_SUCCESSFUL;
addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
sb600_set_flag(bus->number);
/*
* Note: the caller has already checked that offset is
* suitably aligned and that len is 1, 2 or 4.
*/
switch (len) {
case 1:
*val = in_8(addr);
break;
case 2:
*val = in_le16(addr);
break;
default:
*val = in_le32(addr);
break;
}
return PCIBIOS_SUCCESSFUL;
}
static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val)
{
struct pci_controller *hose;
void volatile __iomem *addr;
hose = pci_bus_to_host(bus);
if (!hose)
return PCIBIOS_DEVICE_NOT_FOUND;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/of_address.h`, `linux/pci.h`, `asm/pci-bridge.h`, `asm/isa-bridge.h`, `asm/machdep.h`, `asm/ppc-pci.h`, `pasemi.h`.
- Detected declarations: `function Copyright`, `function is_root_port`, `function is_5945_reg`, `function workaround_5945`, `function sb600_set_flag`, `function sb600_set_flag`, `function pa_pxp_write_config`, `function setup_pa_pxp`, `function pas_add_bridge`, `function pas_pci_init`.
- 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.