I would like to contribute support for Jetson TK1 to ArchLinux ARM. On my board, I have ArchLinux ARM already running. There are several steps which now need to be automated/prebuilt or documented. This thread is now a mix of question to ArchLinux ARM developers and a preliminary documentation.
Bootloader
U-Boot need to be flashed along with a BCT (boot configuration table). The mainline developers created scripts on GitHub which compile U-Boot, then this BCT and allow to flash the whole package. Should I document all these steps or make shortcuts by providing prebuilt binaries? Currently these steps look like this:
Requirements:
From AUR:
- cbootimage-git
- tegrarcm-git
- dtc
- uboot-mkimage
From Arch Linux ARM:
Next clone the following repositories (all the repositories need to be in the same directory):
- git://git.denx.de/u-boot.git
- https://github.com/NVIDIA/cbootimage-configs.git
- https://github.com/NVIDIA/tegra-uboot-f ... cripts.git
Now use the script to build U-Boot along with BCT and generate an image:
$this->bbcode_second_pass_code('', '
$ cd tegra-uboot-flasher-scripts
$ export CROSS_COMPILE=~/x-tools7h/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-
$ ./build --socs tegra124 --boards jetson-tk1 build
')
Put the Board into Recovery Mode by pressing the Recovery Mode and Reset button. You should see a USB device. In order to have access to the device, you need to be root:
$this->bbcode_second_pass_code('', '
$ lsusb
...
Bus 002 Device 026: ID 0955:7140 NVidia Corp.
...
# ./tegra-uboot-flasher flash jetson-tk1
')
Kernel
NVIDIA Jetson TK1 gets mainline support in 3.16, hence I tried to use the linux-armv7-rc package. However, the configuration file misses some configs. I now build a Kernel which makes use of the tegra_defconfig, which works flawless. Should I create a new package (linux-jetson) or submit a patch to alter the config in linux-armv7-rc? The header states "Automatically generated file;" I think this comes from the kernel build system itself.... Should I just send a patch/pull request with a modified config?
Root filesystem
This is quite easy since Jetson TK1 supports USB Client and "User Mass Storage". Enter U-Boot (on serial console) and type this command:
$this->bbcode_second_pass_code('', '
Tegra124 (Jetson TK1) # ums 0 mmc 0
')
You should get a mass storage device on your computer now.
$this->bbcode_second_pass_code('', '
# fdisk /dev/sd[x]
')
Use g to create a new GPT partition table, then n for a new partition. Format the partition with ext4 (btrfs is not supported by the boot loader which needs to read the kernel from the partition).
$this->bbcode_second_pass_code('', '
mkfs.ext4 /dev/sd[x]1
')
Now you can mount this directory and unpack the root filesystem.
A boot script can be created using https://github.com/NVIDIA/tegra-uboot-scripts.git. Altough it needs a small modification since it expects the dtbs directly in /boot (rather than /boot/dtbs). I guess it would be the easiest way to just include a premade boot.scr in the root filesystem. I will post a patch to extend the script to choose where to get the dtb file from.
Any advice welcome!
Update 23-07-2014: Make use of ArchLinuxARM toolchain
--
Stefan