User: Password:
|
|
Subscribe / Log in / New account

ELCE: Grant Likely on device trees

ELCE: Grant Likely on device trees

Posted Nov 23, 2010 22:35 UTC (Tue) by jgg (guest, #55211)
Parent article: ELCE: Grant Likely on device trees

I recently converted some old PPC code from the 'C' way to the device tree way and for the most part things were about the same.

However, what really made a big difference was how much device tree cleans up the mess of GPIO, MDIO, I2C and other ancillary stuff.

For instance our SOCs have a ethernet MAC driver that needs to speak to the PHY using MDIO over a certain bus. The bus, address and PHY chip changes depending on the platform, and several ethernet MACs often have to share the same MDIO. With device tree we specify all these relationships in the DT and things work great. The proper phy driver is loaded and attached to the MDIO, the proper MAC attaches to that, etc.

Something similar happens with I2C as well, I2C auto probing doesn't work for real embedded systems, DTS cleans that up wonderfully. The C version it replaced was horrid.

Frankly, I'm surprised at the reluctance from the ARM community. Just expressing the existing C code to setup each unique platform as a device tree and hard-wiring the tree into the kernel would clean things up a lot, without really changing how anything functions.

The arguments I've seen for DT seem to think all the world is an eval board. I've never implemented an embedded CPU that matched an eval board exactly - we *always* change things. Generally we've had to #ifdef through the BSP for the eval board to get things working, it is an ugly mess that won't be upstreamed.


(Log in to post comments)

ELCE: Grant Likely on device trees

Posted Nov 23, 2010 22:45 UTC (Tue) by dlang (subscriber, #313) [Link]

I'm confused, the arguments against device trees seem to be that they have C code to document every eval board so they don't need device trees.

the arguments _for_ device trees seems to be that real-world devices largely contain the same types of devices as you find on eval boards, but hooked up in different ways, so the device tree tells the system how they are hooked up without having to have every system be it's own defineition in C.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds