Writing Device Tree Source files for U-Boot and Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Writing Device Tree Source files for U-Boot and Linux

2,015 Views
smiller2
Contributor III

I am at a lost as to what device tree files to modify and which files control what.    There seems to be at least two device tree source files.  

One is in \packages\firmware\u-boot\arch\arm\dts    I am assuming that this one only affects U-Boot itself.     I added my new file there.  However, it was never used until I added it to the defconfig file AND added an entry to the Makefile.

 The second one is in \packages\linux\linux\arch\arm64\boot\dts.      I am assuming that I can put mine in the "freescale" folder and it will get used for Linux only?  

 

My second problem is I do not know the syntax of what the device tree files are supposed to contain.  For the U-Boot device tree,  I need to be able to boot from Ethernet.  So the SFP+  module in the cage has to be available from U-Boot.    I saw an example in the ls1046ardb  device tree for Linux of syntax to identify that SFP+ device.   However, it is not a simple as "copy and paste"  since when I add that to the U-Boot device tree then it will not compile.  

Where can I find documentation as to syntax of adding entries to these device trees?    How do I find out that parameters for each device need to be included?   Is that parameter information in the header of the driver?    

 

Thanks.

0 Kudos
3 Replies

1,994 Views
smiller2
Contributor III

Thank you.    I spent several hours trying to port ethernet code from the Linux device tree to the U-Boot device tree.   It would never compile.  Now I know to remove all that and work on eth.c  

With the Linux device tree,  I have it compiling but Flex-Builder will not complete.   I get an error message of  "

/flexbuild_lsdk2012/build/linux/kernel/arm64/LS/neosem_hp_ibir.dtb": No such file or directory"    

(neosem_hp_ibir is my device file.)   If I look in that directory, there are lots of other DTB files there, but not mine.   If I copy my file into that folder and then re-run flex-builder, it completes and creates the ITB image file.     So there must be some other Makefile that I need to modify to tell it to copy the DTB file into that folder.  

Could anyone tell me the location of this extra file that I need to modify?

Thanks.

0 Kudos

1,970 Views
yipingwang
NXP TechSupport
NXP TechSupport
+++ b/packages/linux/Makefile
@@ -82,6 +82,7 @@ ifeq ($(CONFIG_KERL_LINUX), y)
ls $$opdir/arch/$$locarch/boot/dts/$$dtbstr | xargs -I {} cp {} $(FBOUTDIR)/linux/$(KERNEL_TREE)/$(DESTARCH)/$(SOCFAMILY) && \
+ cp $$opdir/arch/$$locarch/boot/dts/neosem_hp_ibir.dtb $(FBOUTDIR)/linux/$(KERNEL_TREE)/$(DESTARCH)/$(SOCFAMILY) && \
0 Kudos

2,000 Views
yipingwang
NXP TechSupport
NXP TechSupport

In u-boot, please refer to board/freescale/ls1046ardb/eth.c for Ethernet configuration, it is not defined in dts file.

In Linux Kernel dts file, please refer to the following device node definition.

ethernet@f2000 { /* 10GEC2 */
fixed-link = <0 1 1000 0 0>;
phy-connection-type = "xgmii";
};

Please refer to Documentation/devicetree/bindings/net/fsl-enetc.txt for details.