Sorry if these questions are overly simplistic. Trying to get a handle on the big picture
How is the device treey related to the board support package? Is the device tree the same as the board support package? A subset of the board support package? A superset of the board support package?
Is all of the board support package/device tree nailed down at uboot time? The kernel interacts via a driver that is included at uboot by virtue of the device tree?
Do all the images that Toradex supports utilize device trees. E.g. does the Qt builder demo utilize device trees?
Thanks for helping me sort this out.
Regards,
Chip
Let’s see what I can do about helping to clarify your questions here.
How is the device treey related to the
board support package? Is the device
tree the same as the board support
package? A subset of the board support
package? A superset of the board
support package?
The device tree is a part of the board support package. More explicitly the device tree is it’s own separate binary but the source code is part of the Linux Kernel itself. In general the device tree provides a description/abstraction of what hardware interfaces/peripherals are available so that the Linux OS knows how to manage/use them. We provide device trees as part of our BSP. But keep in mind as device trees are heavily dependent on the actual hardware, our default device trees are tailored for the carrier boards we provide. If you make your own carrier board or any other significant hardware modifications you may need to either alter our device trees or make your own.
Is all of the board support
package/device tree nailed down at
uboot time? The kernel interacts via a
driver that is included at uboot by
virtue of the device tree?
Not quite sure I understand this question but let me try and answer what I think you’re asking. So as said above we include default device trees as part of our BSP. The device tree binaries are loaded usually at u-boot time right before the Linux kernel starts. However you can have multiple device tree binaries on a system, but only 1 can be loaded at a time per boot.
Do all the images that Toradex
supports utilize device trees. E.g.
does the Qt builder demo utilize
device trees?
All of our Linux-based images make use of device trees. Without it the system would have no idea of how to use the hardware connected to the physical system.
I hope this helps clarify how device trees work relative to the overall system. Let me know if you have further questions or if anything was unclear.
So looking at Device Tree Customization | Toradex Developer Center I see that the device tree is split between a SoC, module and carrier board layers. Presumably if my modifications would be limited to the carrier board level as that would be my hardware we plug the SOM in on.
Is it safe to say that the SoC layer is completely NXP provided? That should not change unless the silicon changes and presumably NXP would provide something if that happened. Is that the case?
Presuming the carrier boards are a constant then what is most likely to change from Toradex would be the SOM layer? So when we look at the differences between V1.1B and V1.0B that is where we would see the bulk of changes? If I want to make a BSP for a different OS then the device tree dtsi files of the SOM layer are where I need to pay attention to make sure I stay compatible with both V1.1B and V1.0B? Thanks.
Yes ideally all your changes would be on the highest level or carrier board level of the device tree. The SoC level is all NXP as you have guessed and is something we don’t touch really. If you click on each file you can see the type of stuff that is defined in each layer.
Most of Toradex’s regular changes changes will be on the module or carrier board level files depending on what changes. For example default pin assignments are usually set at the module level, which is something you might want to change. Say for example you want more GPIOs then is configured by default or something.
If I want to make a BSP for a
different OS then the device tree dtsi
files of the SOM layer are where I
need to pay attention to make sure I
stay compatible with both V1.1B and
V1.0B?
So I’m a little unclear what you’re asking here. If you want to use a different BSP but with the same hardware then presumably the device tree would stay mostly the same. The device tree should only change if hardware changes, that is not to say software changes don’t also change the device tree but this is less common. The major thing to keep in mind is that say for example you take our device tree source from the V5.4 of the Linux Kernel. If you want to adapt it to another BSP that is still V5.4 or close then there should be little to no change. But if you want to port it to say V4.8 of the Linux Kernel then it should be expected that things probably won’t “just work”. As a device tree is usually only good for the Linux Kernel version it was made for.
I’m not sure if this answers your questions but let me know if it doesn’t.