Built TX1 u-boot from source

I ran L4T script "sudo ./source_sync -u “tegra-l4t-r23.1"” installed u-boot source.

I was able to build u-boot for TK1 by

sudo apt-get install gcc-arm-linux-gnueabihf
sudo apt-get install device-tree-compiler
export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
make distclean
make jetson-tk1_defconfig
make

I could not find “jetson-tx1_defconfig” so I created one:

CONFIG_ARM64=y
CONFIG_TEGRA=y
CONFIG_TEGRA210=y
# L4T compiler workaround
CONFIG_ARMV8_NONSEC=n
CONFIG_TARGET_JETSON_TX1=y
CONFIG_DEFAULT_DEVICE_TREE="tegra210-jetson-tx1"
CONFIG_CMD_NET=y

and run

sudo apt-get install gcc-aarch64-linux-gnu
export ARCH=arm64
export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-
make distclean
make jetson-tx1_defconfig
make

but I got errors:

HOSTCC  tools/proftool
make: sdl-config: Command not found
  CC      arch/sandbox/cpu/cpu.o
arch/sandbox/cpu/cpu.c: In function ‘sandbox_read_fdt_from_file’:
arch/sandbox/cpu/cpu.c:110:3: warning: implicit declaration of function ‘fdt_create_empty_tree’ [-Wimplicit-function-declaration]
   err = fdt_create_empty_tree(blob, 256);

How can I build u-boot for TX1?

Thanks in advance.

I was able to build TX1 u-boot by:

export ARCH=arm64
export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-
make distclean
make p2371-2180_defconfig
make

I was trying to build L4T 24.1 uboot, I got errors by following L4T 24.1 “Downloading and Building U-Boot” documentation:


. Set the build environment:
$ export ARCH=arm
$ export CROSS_COMPILE=<your_toolchain_location>
4. Build U-Boot by executing:
$ make distclean
$ make <target_board>_defconfig
$ make


I did not get error when using 64 bit configurations:


export ARCH=arm64
export CROSS_COMPILE=./l4t24.1/toolchain/toolchain-build-aarch64/install/bin/aarch64-unknown-linux-gnu-


The instructions in L4T 24.1 could be for TK1.

The instruction in L4T 24.1 is for TX1. That’s correct. We are checking the instruction …

Hello, yahoo2016:
Please check your board name.
For example, my board is p2371-2180, so the configuration command for u-boot should be:
make p2371-2180_defconfig

(you can find the corresponding file in configs)

the u-boot build command:
make -f Makefile ARCH=arm CROSS_COMPILE=xxx USE_PRIVATE_LIBGCC=yes

(note the cross tool chain must use 64-bit target.

If you still meet errors, please paste the log here.

br
ChenJian

I did use p2371-2180_defconfig as I mentioned ealier (#2). The difference is “ARCH”.

I tried “ARCH = arm” according to L4T24.1 instruction, it did not work.

I tried “ARCH = arm64” and it worked.

In your reply above, you used “ARCH=arm”, but mentioned “cross tool chain must use 64-bit target”.

Should “arch” be “arm” or “arm64” for TX1?

Hello, yahoo2016:
What’s version of u-boot you are compiling? is that the u-boot package from 24.1 SDK?
Please paste the full failure log here.

It seems that we are using different u-boot. In u-boot package in R24.1, there’s no arch/arm64 directory, so ARCH=arm64 should result in failure.

br
Chenjian

Hello,jachen:

i got the build error below:

HOSTCC tools/dumpimage.o
HOSTLD tools/dumpimage
HOSTCC tools/mkimage.o
HOSTLD tools/mkimage
CC arch/arm/cpu/armv8/generic_timer.o
cc1: warning: unknown register name: x18
{standard input}: Assembler messages:
{standard input}:33: Error: selected processor does not support requested special purpose register – mrs r0,cntfrq_el0' {standard input}:63: Error: selected processor does not support requested special purpose register -- mrs r0,cntpct_el0’
scripts/Makefile.build:276: recipe for target ‘arch/arm/cpu/armv8/generic_timer.o’ failed
make[1]: *** [arch/arm/cpu/armv8/generic_timer.o] Error 1
Makefile:1159: recipe for target ‘arch/arm/cpu/armv8’ failed
make: *** [arch/arm/cpu/armv8] Error 2

. Set the build environment:
$ export ARCH=arm
$ export CROSS_COMPILE=<your_toolchain_location>
4. Build U-Boot by executing:
$ make distclean
$ make <target_board>_defconfig
$ make

Hello, MarkChen:
Would you please tell me what’s the version of u-boot you’re using, R24.2, R24.2.1, or R23?

br
ChenJian