Back in May 2023, when we were handling versioning changes, I added set of SMC calls between TF-A and EDK2 to share hardware details (instead of parsing DeviceTree in EDK2).
I think that it is time to move forward and drop DeviceTree support from EDK2 completely.
# what for we use DT now?
There are few things we read from DT in EDK2 now:
- cpu count - cpu mpidr value - cpu numa node id - memory nodes (with numa node ids)
# initial code
I took a look at it, created some tickets [1] in Linaro Jira and wrote some initial code for checking cpu count (will send to ML).
1. https://linaro.atlassian.net/browse/SRCPC-156
# ideas for next steps
For mpidr/numa I have some ideas. I was thinking of adding function in sbsa_sip_svc.c which would count cpus (using code I already have) and then malloc() memory for cpu struct { id, mpidr, node_id } for each cpu. And similar for memory nodes: read DT, alloc structures, fill them.
When EDK2 does SMC call to get cpu data like mpidr/node_id code will go through allocated structures and return single data. Again, similar for memory nodes.
The funny part: DT is somewhere in memory during BL3*, we provide it for EDK2 at start of memory but I probably do something wrong when trying to access it during BL3*.
Current data gathering reads DT from BL2 memory before MMU kicks in.
# things for the future
Adding SPM would require additional calls. So far I only created ticket [2] for it without looking into details.
2. https://linaro.atlassian.net/browse/SRCPC-165
# call for opinions
What are your opinions about it? Ideas? Someone maybe already considered it?