I’m having issues rebuilding the TX2 kernel under Ubuntu 16.04 x86_64
sudo apt-get install gcc-aarch64-linux-gnu
Downloaded R27.1 sources
export CROSS_COMPILE=aarch-linux-gnu-
make kernel tegra21_defconfig
I get :
CC drivers/gpio/gpio-pca953x.o
CC drivers/gpio/gpio-tegra.o
LD drivers/gpio/built-in.o
CC drivers/gpu/…/…/…/nvgpu/drivers/gpu/nvgpu/common/linux/timers.o
drivers/gpu/…/…/…/nvgpu/drivers/gpu/nvgpu/common/linux/timers.c:21:25: fatal error: gk20a/gk20a.h: No such file or directory
compilation terminated.
scripts/Makefile.build:261: recipe for target ‘drivers/gpu/…/…/…/nvgpu/drivers/gpu/nvgpu/common/linux/timers.o’ failed
Anyone else seen this of can see what I’m doing wrong?
If this is a TX2 and not a TX1 then tegra21_defconfig would be incorrect. The TX1 is the Tegra 21x series, the TX2 is the Tegra 18x series. I’d recommend a starting config from a running system’s “/proc/config.gz”, but you might also want to try config target “tegra18_defconfig” prior to building.
This is TX2. I extracted a clean r27.1.0_sources.tbz2 kernel source.
export arch=arm64
export CROSS_COMPILE=aarch-linux-gnu-
make kernel tegra18_defconfig
make
This time I received the following error:
CC drivers/…/…/t18x/drivers/platform/tegra/nvadsp/os-t18x.o
CC drivers/…/…/t18x/drivers/platform/tegra/nvadsp/dev-t18x.o
In file included from drivers/…/…/t18x/drivers/platform/tegra/nvadsp/dev-t18x.c:22:0:
drivers/platform/tegra/nvadsp/dev.h:32:22: fatal error: dev-t18x.h: No such file or directory
compilation terminated.
scripts/Makefile.build:26
Its different but still not building. Missing an include path somewhere…
I compared the tegra18_defconfig generated (.config) with the one taken from my TX2 /proc/config.gz (Jetpack 3.0 flashed image) and they are identical.
I have not yet built the R27 kernels (soon to do but I have other things which require time first), but very likely you also need (this is because of the kernel’s compatibility mode for armhf):
I’ve built the r27.1.0 kernel, the process is noticeably different than building the r24.1 kernel. @newmanross when you updated your kernel source branch did you use the source_sync.sh script?
That script will clone more than just the kernel repo, it also clones a bunch of other repos, here is what the structure of my ‘sources’ directory looks like:
Another thing is the toolchain you are using. I see that you did a apt-get install of the latest aarch64 gcc toolchain. We provide a recommended toolchain to use for building Nvidia kernel source. You can download it from - http://developer.nvidia.com/embedded/dlc/l4t-gcc-toolchain-64-bit-27-1
export arch=arm64
export CROSS_COMPILE=~/install/bin/aarch64-unknown-linux-gnu
export CROSS32CC=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
make mrproper
make tegra18_defconfig
make menuconfig
make O=$TEGRA_KERNEL_OUT
I received the following error:
drivers/…/…/t18x/drivers/crypto/tegra-se-nvhost.c:57:32: fatal error: t186/hardware_t186.h: No such file or directory #include “t186/hardware_t186.h”
^
compilation terminated.
scripts/Makefile.build:261: recipe for target ‘drivers/…/…/t18x/drivers/crypto/tegra-se-nvhost.o’ failed
make[3]: *** [drivers/…/…/t18x/drivers/crypto/tegra-se-nvhost.o] Error 1
scripts/Makefile.build:406: recipe for target ‘drivers/…/…/t18x/drivers/crypto’ failed
make[2]: *** [drivers/…/…/t18x/drivers/crypto] Error 2
scripts/Makefile.build:406: recipe for target ‘drivers/…/…/t18x/drivers’ failed
make[1]: *** [drivers/…/…/t18x/drivers] Error 2
Makefile:958: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2
I tested with tegra18_defconfig (under compiler version 4.8.5…the one that ships with documentation) and did not have an issue. Different config options may result in missing files which this config does not care about. Can you build the entire source using tegra18_defconfig, and then use something like “make nconfig” to edit to your changes one or two at a time? At some point a change should result in finding out which config item is missing something.
i download kernel from nv-tegra.nvidia Code Review - linux-4.4.git/summary
and followed l4t-documentation-27-1 to compile the kernel.
but i have this error
100:55: fatal error: dt-bindings/soc/nvidia,tegra186-powergate.h: No such file or directory #include <dt-bindings/soc/nvidia,tegra186-powergate.h>
It is not enough to fetch only linux-4.4 repo to build kernel after rel-27.1. As you can see in your link, there is a script for download source code and the repo t18x has the file you lost.
UPDATE: If you see fatal error: dev-t18x.h: No such file or directory
You get this error if you don’t use -O
export arch=arm64
export CROSS_COMPILE=/install/bin/aarch64-unknown-linux-gnu-
make O=$TEGRA_KERNEL_OUT tegra18_defconfig
make O=$TEGRA_KERNEL_OUT zImage
A case of following the instructions exactly… Its all working now.