[haiku-development] RFC: API changes to device manager / FDT support

  • From: "Ithamar R. Adema" <ithamar.adema@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 13 Nov 2012 09:49:20 +0100

Hi all,

After seeing Haiku/ARM scan my boot disk (yay!) I'm now looking at Flattened Device Tree[1] support. This code should be generic, usable on any platform, and I would like to make it a "bus" in the device manager, like for example ACPI.

FDT is simply a tree structure describing the different hardware components, so conceptually it matches up real well with the device_manager structure. However, the data contained has a little more complexity then the current device_manager allows. The one thing I miss in the device_manager API is the ability for lists, e.g. multiple IRQs, multiple GPIOs, basically array support.

My idea at the moment is to extend the get_attr_<type> methods with an index, much like the BMessage API has. This would save the FDT code from having to use get_attr_raw() all the time and do lots of typecasting, and I can imagine that the other device_manager users might need the same at some point too.

Does anyone see issues with this? Does anyone feel it would introduce too much complexity into this API?

Any ideas/comments/flames are welcome....



[1]: For lots of details on FDT, see the links in http://cgit.haiku-os.org/haiku/tree/docs/develop/ports/arm/urls.txt

Other related posts: