Hello WayneWWW,
Few words on our custom board first :
we started from the devkit design, dropped what we deemed unnecessary (e.g., the EEPROM with version number), and then added:
- an Ethernet bridge on a PCIe interface
- an LTE module on a USB3 interface (with an M.2 connector)
- exported a PCIe x2 and a USB3 on two M.2 connectors
- added an ADV7282A-M IC as analog->MIPI CSI converter (we have to connect an analog camera to the board)
I then did the following steps:
a) Prepared sources and did a first kernel compilation to ensure things were okay
# Unpack archives and get sources
export L4T_RELEASE_PACKAGE=Tegra186_Linux_R32.4.3_aarch64.tbz2
export SAMPLE_FS_PACKAGE=Tegra_Linux_Sample-Root-Filesystem_R32.4.3_aarch64.tbz2
export BOARD=jetson-tx2i
tar xvf ${L4T_RELEASE_PACKAGE}
cd Linux_for_Tegra/rootfs/
sudo tar xvpf ../../${SAMPLE_FS_PACKAGE}
cd ..
sudo ./apply_binaries.sh
./source_sync.sh -t tegra-l4t-r32.4.3
# Compile kernel
export TEGRA_KERNEL_OUT=build
export CROSS_COMPILE=aarch64-linux-gnu-
export KERNEL_SOURCE_DIR=sources/kernel/kernel-4.9
export LOCALVERSION=-tegra
cd sources/kernel/kernel-4.9/
mkdir -p $TEGRA_KERNEL_OUT
make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j16
# Backup old kernel (if any)
mv ../../../kernel/Image ../../../kernel/Image.old
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image ../../../kernel/Image
# Backup old DTBs (if any)
rm -rf ../../../kernel/dtb.old
mv ../../../kernel/dtb ../../../kernel/dtb.old
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts ../../../kernel/dtb -R
# Install kernel modules
sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install \
INSTALL_MOD_PATH=../../../Linux_for_Tegra/rootfs/
b) Filled the spreadsheet as attached, obtained the DTSI files, and applied them using
cd Linux_for_Tegra/kernel/pinmux/t186/
python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt --mandatory_pinmux_file mandatory_pinmux.txt \
tegra18x-jetson-tx2-default-pinmux.dtsi \
tegra18x-jetson-tx2-default-gpio-default.dtsi 1.0 \
> ../../../bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3489-1000-a00.cfg
c) Modified rootfs for automatic user creation (headless setup)
# Prevent OEM setup
cat << EOF | sudo tee -a rootfs/etc/systemd/system/default.target
[Unit]
Requires=multi-user.target
Wants=display-manager.service
EOF
# Generate normal user in rootfs
sudo cp /usr/bin/qemu-aarch64-static rootfs/usr/bin/
sudo chroot rootfs qemu-aarch64-static /bin/bash
adduser rob
# !! Enter user details !!
# Make the user sudo
adduser rob sudo
sed -i 's|^%sudo.*|%sudo\tALL=NOPASSWD: ALL|' /etc/sudoers
exit
sudo rm rootfs/usr/bin/qemu-aarch64-static
d) Modified the DTS files as follows
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/mods-display.dtsi:
disabled all the nvdisplay and sor nodes (no HDMI in our board)
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-hdmi.dtsi:
disabled all the sor* and hdmi-display nodes
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi:
disabled all the nvdisplay and sor nodes
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-power-tree-p3489-1000-a00-00.dtsi:
moved the hdmi power source to battery_reg
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-plugin-manager/tegra186-odm-data-plugin-manager.dtsi:
disabled all the nvdisplay and sor nodes, commented fragment “fragement@10” (*)
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-plugin-manager/tegra186-quill-display-plugin-manager.dtsi:
disabled all the nvdisplay nodes
- sources/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-plugin-manager/tegra186-quill-p3489-1000-a00-plugin-manager.dtsi:
disabled all the nvdisplay and sor nodes
- sources/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-base.dts:
- commented “board-has-eeprom” (to avoid all the error messages due to failed reads)
- added a “usb3-1” node in “xusb_padctl@3520000”
- in “pinctrl@3520000” renamed the usb3-0 node to “usb3-std-A-port1”, then added a “usb3-std-A-port2” node for usb3-1
- set the “pcie-controller@10003000” for the 2-1-1 configuration
- disabled the “sor1” node
- added usb3-1 in “xhci@3530000”
d) Modified the p2771.conf.common board config file at line 123, changing ODMDATA from 0x1090000 to 0x3090000 (when it says “elif [ “${bid}” = “3489” ]; then”)
e) Recompiled the DTS, flashed them on the board with
export LOCALVERSION=-tegra
export TEGRA_KERNEL_OUT=build
export CROSS_COMPILE=aarch64-linux-gnu-
export KERNEL_SOURCE_DIR=sources/kernel/kernel-4.9
cd $KERNEL_SOURCE_DIR
make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs
rm -rf ../../../kernel/dtb.old
mv ../../../kernel/dtb ../../../kernel/dtb.old
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts ../../../kernel/dtb -R
cd ~/Linux_for_Tegra/
sudo ./flash.sh -r -k kernel-dtb jetson-tx2i mmcblk0p1
Please find the files mentioned above, as well as the logs, here. Should you need any other dump or file, please do not hesitate to ask.
Despite having set the configuration of the PCIe to 2-1-1 (with the latter disabled), the system still complains about it:
[ 0.458243] iommu: Adding device 10003000.pcie-controller to group 49
[ 0.458257] arm-smmu: forcing sodev map for 10003000.pcie-controller
[ 0.935228] tegra-pcie 10003000.pcie-controller: wrong configuration updated in DT, switching to default 2x1, 1x1, 1x1 configuration
[ 0.936196] tegra-pcie 10003000.pcie-controller: PCIE: Enable power rails
[ 0.936516] tegra-pcie 10003000.pcie-controller: probing port 0, using 2 lanes
[ 0.938806] tegra-pcie 10003000.pcie-controller: probing port 1, using 1 lanes
[ 1.373998] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[ 1.776440] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[ 2.178432] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[ 2.180443] tegra-pcie 10003000.pcie-controller: link 0 down, ignoring
[ 2.580439] tegra-pcie 10003000.pcie-controller: link 1 down, retrying
[ 2.982431] tegra-pcie 10003000.pcie-controller: link 1 down, retrying
[ 3.384438] tegra-pcie 10003000.pcie-controller: link 1 down, retrying
[ 3.386433] tegra-pcie 10003000.pcie-controller: link 1 down, ignoring
[ 3.590802] tegra-pcie 10003000.pcie-controller: PCIE: no end points detected
[ 3.591060] tegra-pcie 10003000.pcie-controller: PCIE: Disable power rails
Do you spot any mistake in the steps outlined above?
Thanks a lot in advance and have a nice day!
Rob
(*) is it normal that in the tegra186-odm-data-plugin-manager.dtsi file, fragments are mispelled as “fragements”? Doesn’t this prevent them from being correctly loaded?