of_dma_get_range(9)
π¦ of_dma_get_range(9) β the of_dma_get_range manual page, bestie edition β¨
okay so this is a page from the Kernel API Manual (that's the manual name, iykyk π), and it's literally about grabbing DMA range info and yeeting it into a map array. no cap. let's go π
πΈ NAME πΈ
of_dma_get_range β get DMA range info and put it into a map array π
β¨ SYNOPSIS β¨
int of_dma_get_range (struct device_node *np , const struct
bus_dma_region **map );
like, that's the whole signature, keep it exactly as-is fr fr π«Ά
π ARGUMENTS π
npβ the device node you want the DMA range info from π«mapβ the dma range structure that gets returned to you π
π DESCRIPTION π
so the vibe here is: it looks bottom up for the first "dma-ranges" property and parses it. then it takes all that info and puts it into a DMA offset map array. iconic behavior honestly π
β¨
the dma-ranges format, laid out cutely:
DMA addr (dma_addr) : naddr cells
CPU addr (phys_addr_t) : pna cells
size : nsize cells
and then β important bestie moment π β
it returns-ENODEVif the"dma-ranges"property was not found for this device in the DT. so if you get that back, that's why. don't come for me π
π SEE ALSO π
- Kernel file
./drivers/of/address.cπΈ of_translate_dma_region(9)of_property_read_reg(9)of_dma_get_max_cpu_address(9)of_dma_is_coherent(9)of_mmio_is_nonposted(9)of_address_to_resource(9)of_iomap(9)
all the sibling pages, we stan a connected friend group π«Άπ
okay bestie that's the whole thing, you ate that read π this little cutie lives in ./drivers/of and the page is dated October 2026 β go forth and parse those ranges, main character π
β¨π
π¦ 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