On 2016-Oct-9 23:00 , G 3 wrote:
Thank you very much for your comment. If you have seen my patch, what would you suggest I do in order to access properties from nodes? I was told the patch is required to place its code in drivers/vga.fs.
The problem is that the "add-resolutions" method as it's set up, because it changes device context with find-device, should not be part of the vga fcode. Code in the vga fcode should not change out of the vga vocabulary.
I suspect you can't put the add-resolutions code in the openbios startup code itself, because the vga node won't exist before the fcode runs. That kind of problem is why I originally suggested that the proper location for this property was in /chosen, not in the vga node. The /chosen node should exist at openbios startup, and you should be able to do the add-resolutions stuff there, as long as you don't insist on putting stuff in the vga device node.
If you really want it in the vga node, what I'd suggest trying is:
[ Note, don't know if it will work in openbios, it's the way we did it in Openboot before I retired from Oracle]
" /options" find-package if ( phandle ) " resolutions" rot get-package-property if ( -- ) abort" Did not find resolutions property" else ( prop-addr prop-len ) \ At this point you have the property then else ( -- ) abort" Did not find /options node". then
The above presumes that find-package in openbios will recognize the initial "/", and search for the node in question in the device tree rather than inside the /packages node.