pci_process_...ge_OF_ranges(9)
π pci_process_bridge_OF_ranges β the "read the device tree and set up the bridge" girlie π
okay so real talk, this one lives in the Kernel API Manual (man page pci_process_...ge_OF_ranges(9) β yes the name is truncated, don't come for me, that's just how it's printed π
).
β¨ NAME β¨
pci_process_bridge_OF_ranges β parse PCI bridge resources from the device tree, bestie πΈ
β¨ SYNOPSIS β¨
void pci_process_bridge_OF_ranges (struct pci_controller *hose , struct device_node *dev , int primary );
β¨ ARGUMENTS β¨
hoseβ the freshly allocatedpci_controllerthat's getting set up. new controller, who dis πdevβ the device node of the host bridge. like, the actual bridge we're reading from π¦primaryβ set if this is the primary bus. heads up though: 32 bits only, and it's soon to be deprecated. so, iconic but on the way out π
β¨ DESCRIPTION β¨
okay so this function's whole job is: it parses the "ranges" property of a PCI host bridge device node, and then sets up the resource mapping of a pci_controller based on what's in there. that's it, that's the gig. slay. π
but like, life would be boring if it wasn't for a few issues that we have to deal with here β and we do deal with them, no cap:
- we can only cope with one IO space range and up to 3 Memory space ranges. but some machines (thanks Apple !) tend to split their space into lots of small contiguous ranges. so we have to coalesce. it's giving messy room, we're the ones tidying π§Ήβ¨
- some busses have IO space not starting at 0, which causes trouble with the way we do our IO resource renumbering. the code somewhat deals with it for 64 bits, but likeβ¦ I would expect problems on 32 bits. consider yourself warned fr fr π
- some 32 bits platforms, such as
4xx, can have physical space larger than 32 bits, so we need to use 64 bits values for the parsing. big numbers, big brain energy π₯
π SEE ALSO π
Kernel file ./arch/powerpc/kernel/pci-common.c β go read it, it's right there, iykyk ππ«Ά
lowkey the most important vibe check here: three Memory ranges max, one IO range max, and 32-bit platforms with huge physical space still need 64-bit parsing. remember it. periodt π
and that's the page bestie!! π¦ source/version: ./arch/powerpc/kernel, dated October 2026 β mwah, go forth and map those resources πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms