The following are instructions to get the J120 auvidea board working with latest Jetpack 3 and booting from nvme drive:
OK, I had nice zip file with all the instructions and scripts but the forum antivirus was complaining about it… so here is step by step:
Word of caution, I am not linux expert I learned enough to get the J120 working and be reasonable sure what it does, it works for me. You make your own decisions. If you never compiled kernel before it may be steep learning curve. Some of the following instructions are typed by hand let me know if something is not clear or wrong. Attached are files used in procedure.
- Find instructions for compiling kernel you can use the Nvidia documentation or check the jetson hacks for alternative: Build TX1 Kernel and Modules - NVIDIA Jetson TX1 - JetsonHacks
The following command are executed from kernel source root folder.
- Apply the patches:
- tegra21_clocks.patch.txt and vdsoMakefile.patch.txt are known kernel build problems you will find mention of them in the build instructions
- dts.patch.txt are changes to device tree to enable CAN/SPI on J120 ans fix bug which corrupted file system.
cd <KERNEL_SOURCE_DIR>
patch -p1 < vdsoMakefile.patch.txt
patch -p1 < tegra21_clocks.patch.txt
patch -p1 < dts.patch.txt
- set the output directory:
export AUV_KERNEL_OUT=/path/for/build/kernel
export AUV_KERNEL_PACKAGE=/path where all interesting staff will end up
- Build the default config:
make O=$AUV_KERNEL_OUT tegra21_defconfig
- Merge the required changes, you may want to examine what’s in the config_override.txt file.
./scripts/kconfig/merge_config.sh -n -r -O $AUV_KERNEL_OUT $AUV_KERNEL_OUT/.config ../J120_L4T_r24.2.1_solution/config_override.txt
-
apply any other config changes you may require and continue with the build. I suggest chenging the CONFIG_LOCALVERSION=-J120 or something similar.
-
proceed with the rest of build:
echo "Building zImage"
make O=$AUV_KERNEL_OUT zImage
echo "Building DTBs"
make O=$AUV_KERNEL_OUT dtbs
echo "Building modules"
make O=$AUV_KERNEL_OUT modules
echo "Installing modules to:$AUV_KERNEL_PACKAGE"
make O=$AUV_KERNEL_OUT modules_install INSTALL_MOD_PATH=$AUV_KERNEL_PACKAGE
#Get the kernel name
export AUV_KERNEL_REL=`make O=$AUV_KERNEL_OUT kernelrelease`
#clean links to build and sources
rm $AUV_KERNEL_PACKAGE/lib/modules/$AUV_KERNEL_REL/build
rm $AUV_KERNEL_PACKAGE/lib/modules/$AUV_KERNEL_REL/source
mkdir $AUV_KERNEL_PACKAGE/boot
cp -v $AUV_KERNEL_OUT/arch/arm64/boot/Image $AUV_KERNEL_PACKAGE/boot/Image.auv
cp -v $AUV_KERNEL_OUT/arch/arm64/boot/zImage $AUV_KERNEL_PACKAGE/boot/zImage.auv
cp -v $AUV_KERNEL_OUT/arch/arm64/boot/dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb $AUV_KERNEL_PACKAGE/boot/auvidea.dtb
-
Now you should have in $AUV_KERNEL_PACKAGE/ two folders: boot and lib, if you do not want to boot from nvme drive that all you will need.
-
If you want to boot from nvme drive then you will need to fix the initrd file system. The following can be done on TX1 or a laptop but you will need to copy the initrd over.
#make temporary folder:
mkdir ~/initrd_temp
cd ~/initrd_temp
#extract the content of initrd, if running on laptop replace the /boot/initrd with correct path where you copied the original TX1 file
gzip -cd /boot/initrd | cpio -imd --quiet
# you will need to fix the "init" script, compare the initrd_init_fixed.txt with initrd_init_orig.txt thera 2 changes. see here for more details:
<a target='_blank' rel='noopener noreferrer' href='https://devtalk.nvidia.com/default/topic/1002763/jetson-tx1/auvudea-j120-pcie-nvme-r24-2-1-booting-from-ssd/post/5122567/#5122567'>https://devtalk.nvidia.com/default/topic/1002763/jetson-tx1/auvudea-j120-pcie-nvme-r24-2-1-booting-from-ssd/post/5122567/#5122567</a>
# once done compress it again:
find . | cpio --quiet -H newc -o | gzip -9 -n > $AUV_KERNEL_PACKAGE/boot/initrd.auv
Here is the diff for reference
diff initrd_init_fixed.txt initrd_init_orig.txt
52c52
< rootdev=`cat /proc/cmdline | sed -e 's/.*root=\/dev\/\([abcdefklmnpsv0123456789]*\).*//'`;
---
> rootdev=`cat /proc/cmdline | sed -e 's/.*root=\/dev\/\([abcdefklmnps012]*\).*//'`;
55c55
< if [[ "${rootdev}" == mmcblk0p* || "${rootdev}" == mmcblk1p* || "${rootdev}" == nvme* ]]; then
---
> if [[ "${rootdev}" == mmcblk0p* || "${rootdev}" == mmcblk1p* ]]; then
- compress the content of $AUV_KERNEL_PACKAGE:
cd $AUV_KERNEL_PACKAGE
tar -cjpf kernel_$AUV_KERNEL_REL.tbz2 *
-
scp the compress file to TX1 and extract it. copy content to /boot and /lib folders respectively
-
modify the /boot/extlinux/extlinux.conf to add another configuration point to new Image dtb and initrd. As per above the new kernel elements are: Image.auv initrd.auv auvidea.dtb. Here is example:
TIMEOUT 30
DEFAULT j120_nvme
MENU TITLE p2371-2180 eMMC boot options
LABEL j120_nvme
MENU LABEL j120 kernel from NVMe
LINUX /boot/Image.auv
INITRD /boot/initrd.auv
FDT /boot/auvidea.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/nvme0n1p1 rw rootwait
LABEL j120
MENU LABEL j120 kernel from MMC
LINUX /boot/Image.auv
INITRD /boot/initrd.auv
FDT /boot/auvidea.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
FDT /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
APPEND fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=${lp0_vec} nvdumper_reserved=${nvdumper_reserved} core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait
In the above there are 3 configuration the default is set to j120_nvme which boot the system from nvme device. The j120 configuration boots from original mmc but with new kernel so you can access the device. The last one primary is the original kernel.
Please note if you boot from nvme partition your /boot folder on nvnme partition is ignored. If you want to make any changes you have to modify the /boot on mmc partition (/dev/mmcblk0p1). You will find instructions how to prepare your partition on jetsonhacks: http://www.jetsonhacks.com/2017/01/28/install-samsung-ssd-on-nvidia-jetson-tx1/
Maciej
dts.patch.txt (7.13 KB)
initrd_init_orig.txt (5.02 KB)
initrd_init_fixed.txt (5.05 KB)
tegra21_clocks.patch.txt (541 Bytes)
vdsoMakefile.patch.txt (580 Bytes)
config_override.txt (1.96 KB)