Hi, guys.
I’m effectively trying to replicate the following link (http://elinux.org/Jetson/TX1_SPI) when building the kernel sources on the HOST machine. The objective of the link attached is to do the following:
- De-compile the device tree on target(/boot/tegra210-jetson-tx1-p2597-2180-a01-devkit-gpio.dtb)
- Modify it to include SpiDev
- Re-compile the device tree on the target
I want to be able to flash the Jetson with a custom device tree, which for this instance, is a slightly modified version of the existing one. I understand I can do all this on the Target device, but I want to be doing this on the Host machine as part of my build process.
From what I understand, the device tree running on JetsonTX1 (L4T 28.1) is
$TARGET_MACHINE/boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
and comes from
$HOST_MACHINE/Jetpack/64_TX1/Linux_for_Tegra_64_tx1/bootloader/t210ref/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
I modified the file $KERNEL_SOURCES/hardware/nvidia/t210/kernel-dts/tegra210-soc-base.dtsi with the changes from the SPI example above (the changes are from spi0_0 onwards).
spi@7000d400 {
compatible = "nvidia,tegra210-spi";
reg = <0x0 0x7000d400 0x0 0x200>;
interrupts = <0x0 0x3b 0x4>;
nvidia,dma-request-selector = <0x5d 0xf>;
iommus = <0x46 0xe>;
#address-cells = <0x1>;
#size-cells = <0x0>;
dmas = <0x5d 0xf 0x5d 0xf>;
dma-names = "rx", "tx";
nvidia,clk-parents = "pll_p", "clk_m";
status = "okay";
prod-settings {
prod {
prod = <0x4 0xfffff000 0x0>;
};
prod_c_flash {
status = "disabled";
prod = <0x4 0xffffffc0 0x7>;
};
prod_c_loop {
status = "disabled";
prod = <0x4 0xfffff000 0x44b>;
};
};
spi0_0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "spidev";
reg = <0x0>;
spi-max-frequency = <20000000>;
nvidia,enable-hw-based-cs;
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
I also modified the configuration file to be used by the build process CONFIG_SPI_SPIDEV=m as required.
The kernel build process is
- sudo make mrproper
- sudo make O=$KERN_OUT zImage
- sudo make O=$KERN_OUT dtbs
- sudo make O=$KERN_OUT modules
- sudo make O=$KERN_OUT modules_install INSTALL_MOD_PATH[...]
I took the dtb produced from the build
($KERN_OUT/arch/arm64/boot/dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb), decompiled it (on the host), and seen that it has included the additional spi_dev modification.
This file is then copied over to the JetPack path ($HOST_MACHINE/Jetpack/64_TX1/Linux_for_Tegra_64_tx1/bootloader/t210ref/) as instructed in the Kernel Build instructions. My issue is that when I flash the Jetson, de-compile the flashed dtb file ($TARGET_MACHINE/boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb) it doesn’t have the additional spi_dev addition.
My Flash command is as follows:
sudo ./flash.sh -K kernel/zImage jetson-tx1 mmcblk0p1
If it’s relevant, the kernel name is 4.4.38[my_custom_name] and not -tegra
I have also confirmed that the $TARGET/proc/config.gz contains the included CONFIG_SPI_SPIDEV=m
As always, any help or advice is appreciated.