On Thu, 25 Jul 2019, Mark Cave-Ayland wrote:
This patchset started off with the aim of building the PCI-based machine device trees downwards from the root node to avoid switching either the active package and/or current instance at various points during the tree construction.
The basis for this was to try and remove all named nodes (those which are placed at a given path) and instead build the hierarchy in order by using new-device and finish-device as per the IEEE-1275 specification. This was realised by creating a new BIND_NODE_METHODS() macro which is similar to REGISTER_NAMED_NODE() except that it doesn't alter either the active package or the current instance, and then working through the device tree from the root converting all the devices for the PCI-based machines to use it.
Once this conversion has been completed for all devices beneath the PCI node, it becomes possible to remove both the REGISTER_NAMED_NODE() and REGISTER_NAMED_NODE_PHANDLE() macros to prevent future patches from accidentally changing the tree construction order.
Next the x86, PPC and SPARC64 device tree roots were altered to set the active package and current instance, allowing the remaining places where the PCI code alters either of them to be removed.
At this point instance variables were working correctly, and I noticed that there were several PCI devices which made use of C initialisation functions and/or properties for initial configuration. These can now be replaced with instance variables to keep everything simple and consistent.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
v2:
- Fix up NVRAM initialisation so that -prom-env 'vga-ndrv?=false' works again
I've tried it and the FCode still runs with my patches on top of this and vga-ndrv? setting is also effective now so driver property is not added before FCode adds it. Not sure if this is worth a Tested-by as this wasn't very through testing.
Regards, BALATON Zoltan