Modify device tree for VF61

I need to modify the device tree for the VF61 to add an additional chip select to the SPI interface. First I need to obtain the device tree files and device tree compiler. I believe that to do this I need to clone the Linux Kernel code from branch toradex_vf_4.4 of git://git.toradex/com/linux-toradex.git. Is this correct?

Since my development Ubuntu Linux system is running under VM Virtualbox on my Windows 10 computer, I thought it would be best to simply install Git for Windows and clone the Linux source code onto my Windows 10 machine. I could the transfer the files I needed to the virtual Linux machine. This did not do well. Git reported the following problems when I attempted to clone the Linux Kernel to my Windows 10 machine:

git clone -b toradex_vf_4.4 git://git.toradex.com/linux-toradex.git
Cloning into ‘linux-toradex’…
remote: Counting objects: 7569386, done.
remote: Compressing objects: 100% (1121755/1121755), done.
remote: Total 7569386 (delta 6402404), reused 7562323 (delta 6395548)
Receiving objects: 100% (7569386/7569386), 1.54 GiB | 180.00 KiB/s, done.
Resolving deltas: 100% (6402404/6402404), done.
error: unable to create file drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c: No such file or directory
error: unable to create file drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h: No such file or directory
Checking out files: 100% (52298/52298), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

‘include/uapi/linux/netfilter/xt_CONNMARK.h’
‘include/uapi/linux/netfilter/xt_connmark.h’
‘include/uapi/linux/netfilter/xt_DSCP.h’
‘include/uapi/linux/netfilter/xt_dscp.h’
‘include/uapi/linux/netfilter/xt_MARK.h’
‘include/uapi/linux/netfilter/xt_mark.h’
‘include/uapi/linux/netfilter/xt_RATEEST.h’
‘include/uapi/linux/netfilter/xt_rateest.h’
‘include/uapi/linux/netfilter/xt_TCPMSS.h’
‘include/uapi/linux/netfilter/xt_tcpmss.h’
‘include/uapi/linux/netfilter_ipv4/ipt_ECN.h’
‘include/uapi/linux/netfilter_ipv4/ipt_ecn.h’
‘include/uapi/linux/netfilter_ipv4/ipt_TTL.h’
‘include/uapi/linux/netfilter_ipv4/ipt_ttl.h’
‘include/uapi/linux/netfilter_ipv6/ip6t_HL.h’
‘include/uapi/linux/netfilter_ipv6/ip6t_hl.h’
‘net/netfilter/xt_DSCP.c’
‘net/netfilter/xt_dscp.c’
‘net/netfilter/xt_HL.c’
‘net/netfilter/xt_hl.c’
‘net/netfilter/xt_RATEEST.c’
‘net/netfilter/xt_rateest.c’
‘net/netfilter/xt_TCPMSS.c’
‘net/netfilter/xt_tcpmss.c’
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with ‘git status’
and retry the checkout with ‘git checkout -f HEAD’

I don’t understand why I got these errors. Does the Git repository actually have files with names duplicated in upper and lower case? Also, why couldn’t the aux.c and aux.h files be created?

This download took all night to do on my very slow internet connection. Do I have to attempt it again directly on my virtual Linux machine?

One more question. Assuming I can modify the device tree and compile it to a dtb file, I am unclear as to how I get the dtb file onto my VF61 module, or where I am supposed to put it. Perhaps you could point me in the right direction here.

Please check this article - https://developer.toradex.com/knowledge-base/build-u-boot-and-linux-kernel-from-source-code

Yes, I have already looked at the article “Build U-Boot and Linux Kernel from Source Code” and determined that I need to do a get clone of the toradex_vf_4.4 Kernel git branch. But when i attempted to do a git clone of that branch onto my Windows 10 machine (just a convenient place to put this massive collection of files), I get a bunch of errors. The git clone operation fails on my Windows 10 computer. I get these errors:

error: unable to create file drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c: No such file or directory
error: unable to create file drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h: No such file or directory
warning: the following paths have collided (e.g. case-sensitive paths on a case-insensitive filesystem) and only one from the same colliding group is in the working tree:
‘include/uapi/linux/netfilter/xt_CONNMARK.h’
‘include/uapi/linux/netfilter/xt_connmark.h’
‘include/uapi/linux/netfilter/xt_DSCP.h’
‘include/uapi/linux/netfilter/xt_dscp.h’
‘include/uapi/linux/netfilter/xt_MARK.h’
‘include/uapi/linux/netfilter/xt_mark.h’
‘include/uapi/linux/netfilter/xt_RATEEST.h’
‘include/uapi/linux/netfilter/xt_rateest.h’
‘include/uapi/linux/netfilter/xt_TCPMSS.h’
‘include/uapi/linux/netfilter/xt_tcpmss.h’
‘include/uapi/linux/netfilter_ipv4/ipt_ECN.h’
‘include/uapi/linux/netfilter_ipv4/ipt_ecn.h’
‘include/uapi/linux/netfilter_ipv4/ipt_TTL.h’
‘include/uapi/linux/netfilter_ipv4/ipt_ttl.h’
‘include/uapi/linux/netfilter_ipv6/ip6t_HL.h’
‘include/uapi/linux/netfilter_ipv6/ip6t_hl.h’
‘net/netfilter/xt_DSCP.c’
‘net/netfilter/xt_dscp.c’
‘net/netfilter/xt_HL.c’
‘net/netfilter/xt_hl.c’
‘net/netfilter/xt_RATEEST.c’
‘net/netfilter/xt_rateest.c’
‘net/netfilter/xt_TCPMSS.c’
‘net/netfilter/xt_tcpmss.c’
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.

Have you ever tried to do a git clone of that branch using a Windows computer? It does not work!

So I gave up and spent another entire day doing the git clone on my virtual Linux machine using my very slow internet connection

Now I have a more serious problem. Before I modify any device tree files I want to compile the existing vf610-colibri-eval-v3.dts device tree file. Following the instructions in “Device Tree Customization” I did the following: “make vf610-colibri-evel-v3.dtb”, but I got the following error:

make: *** No rule to make target ‘vf610-colibri-eval-v3.dtb’. Stop.

So I looked at the “Webinar: Demystifying Device Tree for NXP® i.MX Processors” video on that same page. I gave DIFFERENT instructions for compiling the device tree file, so I followed those instructions and did the following: “make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vf610-colibri-eval-v3.dtb”, but this didn’t work either. I got the following error:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vf610-colibri-eval-v3.dtb

So I don’t know how to compile a device tree file. Please tell me the secret. When I ran the make commands my current directory was “~/linux-toradex/arch/arm/boot/dts”. Is this correct? Are there any tools I need to install? Are there any environment variables that need to be set? What am I doing wrong?

Of cause it will not work on Windows machine. It’s designed for linux. Did you install tollchain as described here - https://developer.toradex.com/knowledge-base/build-u-boot-and-linux-kernel-from-source-code#Toolchain ?

I have installed the Linaro toolchain by downloading gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz, extracting it, and creating a link using ln -s gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf gcc-linaro.

I have installed the device-tree-compiler. Version reported by dtc -v is 1.4.0.

I tried to compile the vf610-colibri-eval-v3.dts device tree file using the command “make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vf610-colibri-eval-v3.dtb”. I get the error “make: *** No rule to make target ‘vf610-colibri-eval-v3.dtb’. Stop.”

I am trying to follow the instructions from the web page “https://developer.toradex.com/device-tree-customization”, along with some information from the webinar video on that page. It isn’t working. Please tell me what I am doing wrong. Step-by-step instructions for compiling a device tree file would be really helpful.

So I don’t know how to compile a device tree file. Please tell me the secret. When I ran the make commands my current directory was “~/linux-toradex/arch/arm/boot/dts”. Is this correct? Are there any tools I need to install? Are there any environment variables that need to be set? What am I doing wrong?

The directory is wrong, you should be in linux-toradex where the Makefile is located.

Use this command for the compilation, please:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vf610-colibri-eval-v3.dtb

It should work.

I followed your instructions. I went to the linux-toradex folder. I executed the command “make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vf610-colibri-eval-v3.dtb” It should work. It did not work. I got the following:

keith@Ubuntu1604:~/linux-toradex$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vf610-colibri-eval-v3.dtb
make: arm-linux-gnueabihf-gcc: Command not found
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig


*** Configuration file “.config” not found!


*** Please run some configurator (e.g. “make oldconfig” or
*** “make menuconfig” or “make xconfig”).


scripts/kconfig/Makefile:37: recipe for target ‘silentoldconfig’ failed
make[2]: *** [silentoldconfig] Error 1
Makefile:540: recipe for target ‘silentoldconfig’ failed
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target ‘include/config/auto.conf’, needed by ‘scripts’
. Stop.

I find the following things to be interesting:

  1. You tell me to run the command “make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vf610-colibri-eval-v3.dtb”, which is different that the command documented in the Device Tree Customization page on the toradex.com website (which is also different from the command documented in the webinar video on that same page).

  2. That you say I should be in the “linux-toradex” directory “where the Makefile is located”. You do realize, of course, that there are 2110 files called “Makefile” is the linux-toradex folder and all subfolders, including a file called “Makefile” located in linux-toradex/arch/arm/boot/dts where all the device tree files are located? It seemed reasonable to me that I should be in the linux-toradex/arch/arm/dts folder where the device tree files are when I am compiling a device tree file from that folder. The instructions on the Toradex website gave me no clue what directory I should be in.

So please tell me what I am doing wrong. This should not be so hard. I need accurate instructions.

Hi

make: arm-linux-gnueabihf-gcc: Command not found

The cross compiler is not found, i.e. the PATH variable is not amended with the path to where you installed it.

Configuration file “.config” not found!

Your kernel source tree is not configured.

The after entering the toplevel directory of the kernel source tree the following is the sequence of commands needed.

prepare the environment with the ARCH/CROSS_COMPILE/PATH variables
configure the kernel
compile the device tree

[user@pc linux-toradex]$ export ARCH=arm
[user@pc linux-toradex]$ export CROSS_COMPILE=arm-linux-gnueabihf-
[user@pc linux-toradex]$ PATH=$PATH:~/gcc-linaro/bin

[user@pc linux-toradex]$ make colibri_vf_defconfig
  HOSTCC  scripts/basic/fixdep
...
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#

[user@pc linux-toradex]$ make vf610-colibri-eval-v3.dtb
scripts/kconfig/conf  --silentoldconfig Kconfig
  HOSTCC  scripts/basic/bin2c
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
...
  HOSTCC  scripts/sortextable
  DTC     arch/arm/boot/dts/vf610-colibri-eval-v3.dtb

Instead of exporting ARCH and CROSS_COMPILE one alternatively can pass them to each call to make on the command line, e.g.

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- colibri_vf_defconfig

Max

I was finally able to compile the vf610-colibri-eval-v3.dts device tree file (no changes made to it yet, I’m just trying to learn the basic steps first). Now I need to copy or install the vf610-colibri-eval-v3.dtb file onto my Colibri VF61 module. In the video Demystifying Device Tree for NXP® i.MX Processors I see this was done with the command “cp arch/arm/boot/dts/imx6dl-colibri-labworks.dtb /tftpboot/”, so I used my own filename and tried the command “cp/arch/arm/boot/dts/vf610-colibri-eval-v3.dtb /tftpboot/”. Of course that did not work. I could not find any instructions on how to transfer the compiled “.dtb” file to the Colibri VF61 module. How do I do that?

In the video Demystifying Device Tree for NXP® i.MX Processors I see this was done with the command “cp arch/arm/boot/dts/imx6dl-colibri-labworks.dtb /tftpboot/”, so I used my own filename and tried the command “cp/arch/arm/boot/dts/vf610-colibri-eval-v3.dtb /tftpboot/”. Of course that did not work

You can copy the devicetree to the /tftpboot folder if your module and environment is set for the tftp boot. Usually you flash a demo or custom compiled image to the module following these instructions with a prepared SD Card.

If you want to flash a custom device tree then you can replace this device tree on your prepared SD card and flash this device tree doing the following in U-Boot.

  • run setupdate
  • run prepare_ubi
  • run update_fdt

Please note, the name of the device-tree file is defined in the U-boot as following: ${soc}-colibri-${fdt_board}.dtb. Thus if you want to use a different name, then you have to update the U-Boot Settings too. However in the beginning I recommend you to keep the name of the files as they are predefined in U-Boot default Environment.

Best regards, Jaski