You’re correct that the DTB file is kernel version specific. It is usually the XML files that implement those differences. The sopc2dts tool (and the dtc) are, in the main, just tools to create the DTB file from various sources.
The sopc2dts tool takes an “.sopcinfo” file created by QuartusII from your hardware design, combines that information with the XML files supplied, and produces your DTB file. The XML files provide fixup information that the sopc2dts tool can’t derive from information in the “.sopcinfo” file, or that it derives incorrectly or incompletely, for the kernel version that you wish to use.
Here are the two files I use for creating a DTB file for the 3.17 kernel using QuartusII 14.1. I use hps_common3.17.xml file with the DE1-SoC and the SoCKit board, and provide DE1-SoC specific customizations in the de1soc3.17.xml file. I don’t currently use the HPS LEDs and GPIOs, but if I did, they would be defined in the de1soc3.17.xml.
My hardware design, and hence my “.sopcinfo” file, contains a HPS component configured for the board I’m using. Hence the availability of HPS Ethernet / SPI / I2C etc, comes from there. But some additional information also comes from the XML files, which is required to get the Ethernet working.
I use the following command to create the DTB file. You will have to fixup the paths to find the input files:
sopc2dts --input soc_system.sopcinfo\
--output soc_system.dtb --type dtb\
--board hps_common3.17.xml --board de1soc3.17.xml\
--bridge-removal all\
--clocks
This should be sufficient to get you going.
If you want to produce a DTS file, i.e. human-readable DTB file, I use:
sopc2dts --input soc_system.sopcinfo\
--output soc_system.dts --type dts\
--board hps_common3.17.xml --board de1soc3.17.xml\
--bridge-removal all\
--clocks
If you wanted to, you could manually edit the DTS file, then use the dtc tool to convert it to a DTB.
Hope this helps!
Iain