Can not compile Jetson TX2 latest kernel version (28.1)

Dear all,

After downloading L4T 28.1 source (I think it’s latest version), I tried to compile kernel.
Everything is almost setting like this:

export CROSS_COMPILE=/home/vu/Desktop/Cross-Compilers/NVIDIA/jetson-tx1-toolchain-build/toolchain-build-aarch64/install/bin/aarch64-unknown-linux-gnu-

export CROSS32CC=/home/vu/Desktop/Cross-Compilers/NVIDIA/jetson-tx1-toolchain-build/toolchain-build-armhf/install/bin/arm-unknown-linux-gnueabi-gcc

export ARCH=arm64

export TEGRA_KERNEL_OUT=/home/vu/Desktop/Projects/JetsonTX2/kernel_raw_rgb/sources/kernel/output
	
make O=$TEGRA_KERNEL_OUT tegra18_defconfig
	
make O=$TEGRA_KERNEL_OUT zImage

Several minutes later, I got this error:

/home/vu/Desktop/Projects/JetsonTX2/kernel_raw_rgb/sources/kernel/kernel-4.4/include/linux/platform/tegra/mc.h:28:47: fatal error: linux/platform/tegra/mc-regs-t18x.h: No such file or directory
 #include <linux/platform/tegra/mc-regs-t18x.h>
                                               ^
compilation terminated.
make[4]: *** [drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu/gm20b/acr_gm20b.o] Error 1
make[3]: *** [drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu] Error 2
make[2]: *** [drivers/gpu] Error 2
make[1]: *** [drivers] Error 2

I can not find “mc-regs-t18x.h” file in our kernel folder.
Anybody is facing this problem?

Thanks

The file mc-regs-t18x.h is located in the linux-headers, in the /usr/src folder.

/usr/src/linux-headers-4.4.38-tegra/include/linux/platform/tegra/mc-regs-t18x.h

It seems confused as to where to look for these files. There are a few:

linux/platform/tegra/mc-regs-t18x.h
linux/platform/tegra/ptp-notifier.h
sound/tegra_adma.h

There are also a couple of files that I have not been able to locate:
vi/vi4.h
and
mipi_cal.h

I’m sure there’s a clever solution on how to get it to look in the linux-headers folder, but I haven’t found it yet.

Actually I can not find this path: /usr/src/
I compile in my pc, not target board. One day ago, I built 27.1 source successfully so I think 28.1 source has problem.

All the TX2 related files are missing from the release. Nvidia is supposed to be fixing this soon

How do they announce the fixed release?

I saw notes that some part of it was fixed, not sure which.

Where can I download those parts, because I tried to download on download center again then problem still be here.

Thanks

Isn’t 18x the TX2 series? I think the TX1 series has a different number?
If so, is it a problem that the toolchain selected is TX1, not TX2?

Separately, it’s known that the kernel build source for TX2 in 28.1 isn’t actually working currently, so that has to be solved, too.

Hi snarky,

I remember that tegra21 is for TX1 and 18x for TX2.
I’m trying to compile TX2. And I think toolchain (cross-compiler) should be same for TX1 and TX2.
Is it correct? Please correct me if I’m wrong.

Thanks

If I remember correctly, TX1 is mixed 32-bit/64-bit, and TX2 is fully 64-bit?
Anyway, if you’re compiling for TX2, then the tegra18_defconfig config file is correct.
You still need to wait for NVIDIA to fix the missing source, though.

Hi,

Please try following command. The source_sync script is under Linux_for_Tegra folder downloaded from jetpack.

./source_sync.sh -k tegra-l4t-r28.1

Hi WayneWWW,

The “nvgpu-t18x” and “nvhost-t18x” are failed still.

Directory for kernel/nvgpu-t18x, /home/x/jet_pack/64_TX2/Linux_for_Tegra_tx2/sources/kernel/nvgpu-t18x, already exists!
Couldn't find tag tegra-l4t-r28.1
/home/x/jet_pack/64_TX2/Linux_for_Tegra_tx2/sources/kernel/nvgpu-t18x source sync to tag tegra-l4t-r28.1 failed!

Directory for kernel/nvhost-t18x, /home/x/jet_pack/64_TX2/Linux_for_Tegra_tx2/sources/kernel/nvhost-t18x, already exists!
Couldn't find tag tegra-l4t-r28.1
/home/x/jet_pack/64_TX2/Linux_for_Tegra_tx2/sources/kernel/nvhost-t18x source sync to tag tegra-l4t-r28.1 failed!

Hi ZhangXin,

These two are not needed for kernel Image to be built completed. Please try to use remaining kernel source to build.

Hi WayneWWW,

After

  1. ./source_sync.sh -k tegra-l4t-r28.1
  2. make tegra18_defconfig
  3. make zImage

got some errors:

CC      drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu/common/linux/kmem.o
drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu/common/linux/kmem.c:30:25: fatal error: gk20a/gk20a.h: No such file or directory
 #include "gk20a/gk20a.h"
                         ^
compilation terminated.
scripts/Makefile.build:261: recipe for target 'drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu/common/linux/kmem.o' failed
make[3]: *** [drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu/common/linux/kmem.o] Error 1
scripts/Makefile.build:406: recipe for target 'drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu' failed
make[2]: *** [drivers/gpu/../../../nvgpu/drivers/gpu/nvgpu] Error 2
scripts/Makefile.build:406: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:973: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Besides, I also changed a file a little bit to prevent head file missing problem.

diff --git a/drivers/devfreq/governor_pod_scaling.c b/drivers/devfreq/governor_pod_scaling.c
index 0dcc097..0231a70 100644
--- a/drivers/devfreq/governor_pod_scaling.c
+++ b/drivers/devfreq/governor_pod_scaling.c
@@ -51,7 +51,7 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/nvhost_podgov.h>

-#include <governor.h>
+#include "governor.h"

 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>

The toolchain is “aarch64-unknown-linux-gnu-gcc (GCC) 4.8.5” downloaded from https://developer.nvidia.com/embedded/linux-tegra.

Does anyone successfully build this new kernel?

Thanks.

Hi Zhang,

Check this link : [url]https://devtalk.nvidia.com/default/topic/1019687/jetson-tx2/jetpack-3-1-kernel-source-tag-problem/post/5193793/#5193793[/url]

It seems the source code issues have been fixed by Nvidia. Try downloading and building again. If it’s not too much trouble, let us know if everything is fixed.

Hi,
Please follow the section “Kernel customization” in L4T documentation. The Image should be built.

https://developer.nvidia.com/embedded/dlc/l4t-documentation-28-1