Detect devices by traversing the kernel device tree starting at root and proceed towards leaves
Currently, the sparc64 kernel determines physical addresses of devices by ascending from the OFW device leaf node towards the OFW device tree root and recalculating (mapping) the address as dictated by the child node reg property and the parent node ranges property. This approach works, but has some limitations:
- works in the counter-intuitive way
- depends on the fact that /aliases contains the path to the device of interest so that the algorithm knows in which node to start
- some nodes can be visited repeatedly
- some devices are not noticed by the kernel
- an OFW node "driver" needs to assume that it is attached to a certain type of the parent node (e.g. "if I am not attached to PCI, then I don't know what to do…")
For the sake of the sparc64 kernel, but also the ppc32 kernel (see #63), it would be better if the kernel traversed the tree descending from the root node towards the leaf nodes. The traversal would not follow edges that lead to an unknown/unsupported node. For each visited node, the physical address would be calculated. The same approach can be used for mapping interrupts.
Change History
(6)
Summary: |
Detect devices by traversing the kernel device tree starting at root and proceeed towards leaves → Detect devices by traversing the kernel device tree starting at root and proceed towards leaves
|
Component: |
→ kernel/genarch
|
Resolution: |
→ wontfix
|
Status: |
new → closed
|
Closing as Will Not Fix. Instead, we should focus on removing device knowledge from the kernel altogether.