Device tree compilation failed no such file or directory

Hello,
I am trying to compile the device tree for iMX6 colibri eval board from Linux source.
The compilation Fails with the following error message:

  DTC     arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb
arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts:16:37: fatal error: dt-bindings/input/input.h: No such file or directory
compilation terminated.
scripts/Makefile.lib:273: die Regel für Ziel „arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb“ scheiterte
make[1]: *** [arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb] Fehler 1
/home/agmb/Projekte/linux-toradex/arch/arm/Makefile:311: die Regel für Ziel „imx6dl-colibri-eval-v3.dtb“ scheiterte
make: *** [imx6dl-colibri-eval-v3.dtb] Fehler 2

It seems the dtc is unable to find the include Directory “include/”.

I’ve tried also to invoke the dtc through make with include Parameter:

 make DTC_FLAGS+="-i include/" imx6dl-colibri-eval-v3.dtb 

which had no additional effect.

I am using the following Verisons for DTC and make:

Version: DTC 1.4.0    
GNU Make 4.1

I’ve checked out the following branch:

toradex_imx_3.14.52_1.1.0_ga

Building other device trees via make dtbs
works well. The first device tree which cannot be built is the one for imx6dl.

Thank you for your help.

Hi

This works here when going through the following steps (adapt path and cross compiler prefix to your installation):

export ARCH=arm
export PATH=~/gcc-linaro/bin/:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-
${CROSS_COMPILE}gcc --version

make distclean
make colibri_imx6_defconfig
make imx6dl-colibri-eval-v3.dtb

There shouldn’t be any additional parameters to make needed.
Can you post the output of the above commands if that sequence does still exhibit the error?

Regards
Max

Hi

That didn’t work too. Error message is just the same - DTC (or is it GCC?) is unable to find input.h.

The listing is here:

agmb@GERW210:~/Projekte/linux-toradex$ echo $ARCH
arm
agmb@GERW210:~/Projekte/linux-toradex$ echo $CROSS_COMPILE
arm-linux-gnueabihf-
agmb@GERW210:~/Projekte/linux-toradex$ ${CROSS_COMPILE}gcc --version
arm-linux-gnueabihf-gcc (Linaro GCC 5.2-2015.11-2) 5.2.1 20151005
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

agmb@GERW210:~/Projekte/linux-toradex$ make distclean
  CLEAN   scripts/basic
  CLEAN   scripts/dtc
  CLEAN   scripts/genksyms
  CLEAN   scripts/kconfig
  CLEAN   scripts/mod
  CLEAN   scripts
  CLEAN   include/config include/generated arch/arm/include/generated
  CLEAN   .config .config.old
agmb@GERW210:~/Projekte/linux-toradex$ make colibri_imx6_defconfig
  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
#
# configuration written to .config
#
agmb@GERW210:~/Projekte/linux-toradex$ make imx6dl-colibri-eval-v3.dtb 
scripts/kconfig/conf --silentoldconfig Kconfig
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/current.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/exec.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/ipcbuf.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/msgbuf.h
  WRAP    arch/arm/include/generated/asm/param.h
  WRAP    arch/arm/include/generated/asm/parport.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/segment.h
  WRAP    arch/arm/include/generated/asm/sembuf.h
  WRAP    arch/arm/include/generated/asm/serial.h
  WRAP    arch/arm/include/generated/asm/shmbuf.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/simd.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  WRAP    arch/arm/include/generated/asm/socket.h
  WRAP    arch/arm/include/generated/asm/sockios.h
  WRAP    arch/arm/include/generated/asm/termbits.h
  WRAP    arch/arm/include/generated/asm/termios.h
  WRAP    arch/arm/include/generated/asm/timex.h
  WRAP    arch/arm/include/generated/asm/trace_clock.h
  WRAP    arch/arm/include/generated/asm/unaligned.h
  WRAP    arch/arm/include/generated/asm/preempt.h
  WRAP    arch/arm/include/generated/asm/hash.h
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/data.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/util.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/lex.lex.c
  SHIPPED scripts/genksyms/keywords.hash.c
  SHIPPED scripts/genksyms/parse.tab.h
  HOSTCC  scripts/genksyms/lex.lex.o
  SHIPPED scripts/genksyms/parse.tab.c
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  CC      scripts/mod/devicetable-offsets.s
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/bin2c
  HOSTCC  scripts/sortextable
  DTC     arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb
arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts:16:37: fatal error: dt-bindings/input/input.h: No such file or directory
compilation terminated.
scripts/Makefile.lib:273: die Regel für Ziel „arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb“ scheiterte
make[1]: *** [arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb] Fehler 1
/home/agmb/Projekte/linux-toradex/arch/arm/Makefile:311: die Regel für Ziel „imx6dl-colibri-eval-v3.dtb“ scheiterte
make: *** [imx6dl-colibri-eval-v3.dtb] Fehler 2
agmb@GERW210:~/Projekte/linux-toradex$

Are you sure that you checked out the correct branch and the working copy is complete?
e.g. what is the output of:

git branch
git rev-parse --abbrev-ref HEAD
git rev-parse HEAD
git status

Does the file which should get included exist?
e.g. what is the output of:

ls include/dt-bindings/input/input.h

Do you have environment variables set which influence the compilation, e.g. what happens if you unsets most of the environment. Maybe this could be seen with more verbose output:

$ make V=1 imx6dl-colibri-eval-v3.dtb
make -f scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f /home/krm/code/git.toradex.com/linux-toradex/scripts/Makefile.asm-generic \
            src=asm obj=arch/arm/include/generated/asm
make -f /home/krm/code/git.toradex.com/linux-toradex/scripts/Makefile.asm-generic \
            src=uapi/asm obj=arch/arm/include/generated/uapi/asm
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=scripts/dtc
make -f scripts/Makefile.build obj=scripts/genksyms
make -f scripts/Makefile.build obj=scripts/mod
make -f scripts/Makefile.build obj=arch/arm/boot/dts MACHINE= arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb
  arm-linux-gnueabihf-gcc -E -Wp,-MD,arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.pre.tmp -nostdinc -I/home/krm/code/git.toradex.com/linux-toradex/arch/arm/boot/dts -I/home/krm/code/git.toradex.com/linux-toradex/arch/arm/boot/dts/include -I/home/krm/code/git.toradex.com/linux-toradex/drivers/of/testcase-data -undef -D__DTS__ -x assembler-with-cpp -o arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.dts.tmp arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts ; /home/krm/code/git.toradex.com/linux-toradex/scripts/dtc/dtc -O dtb -o arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb -b 0 -i arch/arm/boot/dts/  -d arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.dtc.tmp arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.dts.tmp ; cat arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.pre.tmp arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.dtc.tmp > arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d

Are you sure that you checked out the correct branch and the working copy is complete?
e.g. what is the output of:

git branch
git rev-parse --abbrev-ref HEAD
git rev-parse HEAD
git status

Does the file which should get included exist?
e.g. what is the output of:

ls include/dt-bindings/input/input.h

Do you have environment variables set which influence the compilation. Maybe this could be seen with more verbose output:

$ make V=1 imx6dl-colibri-eval-v3.dtb
make -f scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f /home/krm/code/git.toradex.com/linux-toradex/scripts/Makefile.asm-generic \
            src=asm obj=arch/arm/include/generated/asm
make -f /home/krm/code/git.toradex.com/linux-toradex/scripts/Makefile.asm-generic \
            src=uapi/asm obj=arch/arm/include/generated/uapi/asm
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=scripts/dtc
make -f scripts/Makefile.build obj=scripts/genksyms
make -f scripts/Makefile.build obj=scripts/mod
make -f scripts/Makefile.build obj=arch/arm/boot/dts MACHINE= arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb
  arm-linux-gnueabihf-gcc -E -Wp,-MD,arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.pre.tmp -nostdinc -I/home/krm/code/git.toradex.com/linux-toradex/arch/arm/boot/dts -I/home/krm/code/git.toradex.com/linux-toradex/arch/arm/boot/dts/include -I/home/krm/code/git.toradex.com/linux-toradex/drivers/of/testcase-data -undef -D__DTS__ -x assembler-with-cpp -o arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.dts.tmp arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts ; /home/krm/code/git.toradex.com/linux-toradex/scripts/dtc/dtc -O dtb -o arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb -b 0 -i arch/arm/boot/dts/  -d arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.dtc.tmp arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.dts.tmp ; cat arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.pre.tmp arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d.dtc.tmp > arch/arm/boot/dts/.imx6dl-colibri-eval-v3.dtb.d

I’ve found the solution - it was a broken symbolic link from include/dt-bindings in dts Directory to …/…/…/…/…/include/dt-bindings. Seems the symblink got lost during git checkout.

Recreated the symlink with
ln -s …/…/…/…/…/include/dt-bindings dt-bindings

Afterwards make ran successfully.

Thanks for your help