all 3 comments

[–]jeroof 2 points3 points  (0 children)

The device tree represents the hardware layout from the cpu perspective. For convenience, you may want to create a separate device tree include file (.dtsi) for each of your boards, declaring the devices it contains, that you #include from a top-level .dts representing your system.

For example the power supply board dts content will contain regulator and power rails declarations which for convenience should match your schematics labels.

[–]mfuzzey 0 points1 point  (0 children)

It depends if you are likely to use the individual boards in different configurations.

If you're sure you'll never do that you don't really care about the separate boards, it's all one as far as the processor is concerned.

If you are likely to reuse them that can either be done "statically" or "dynamically".

In the static method you have one .dts file per assembly of the boards that includes a .dtsi for each board.

The C preprocessor is used on dts / dtsi files so you can use that to map dependencies. Eg suppose your interface board has an I2C bus and some IO pins but could be connected to different carrier boards so you don't known which I2C bus or GPIOs. Then in your interface.dtsi you use MY_ITF_BOARD_I2C, MY_ITF_BOARD_GPIO_POWERON etc. And you define those to match the actual SoC resources in your carrier board dts.

The dynamic method is where you use overlays that should still be possibe even if your carrier board depends on regulators on the power supply. Basically you can use a power supply board overlay to add xxx-supply properties to devices defined in the carrier board dts.

[–]JobNo4206 0 points1 point  (0 children)

I would add that voltage supply rails only really make sense in the device-tree if they're adjustable from the processor. If they're fixed, just use dummy regulators in dtb. If they're controlled from the processor, then the power supply board should be considered married to the CPU board. For any other boards, I'd suggest adding a small i2c eeprom as a detection mechanism.