This post is related to the thread here:
Overlay and ExtLinux.Conf post
but focuses on rebuilding the device tree on the host and reflashing rather than using modifying overlays on the target and using extlinux.conf to apply them.
I have tried to rebuild in two ways, first by using the following command inside ~/nvidia/nvidia_sdk/JetPack_6.2_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/source: ./source_sync.sh -k -t jetson_36.4.3. In this case the JetPack_6.2_Linux_Jetson_AGX_ORIN_TARGETS folder is supplied by SDK Manager. Secondly by downloading and extracting the sample root file system, driver package, and driver source packages manually.
Regardless of whether or not I used the folder provided by SDK Manager or Downloaded Manually the results were similar. The rest of this document focuses on the downloaded manually case because I think the fact that the source_sync based method relies on GIT created some additional confusion since some of the folders ended up with the --dirty suffix once I modified them locally. I placed the files in the downloaded manually case at ~/nvidia/jetson_build
I attempt to make the modifications @KevinFFF suggested we make in the previous post at this link: KevinFFF Link for Porting MCP2515
I modified Lines 130-170 of tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi at ~/nvidia/jetson_build/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/nv-platform/
can_clock: can_clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <10000000>;
clock-accuracy = <100>;
};
/* SPI1, 40pin header, Pin 19(MOSI), Pin 21(MISO), Pin 23(CLK), Pin 24(CS) */
spi@3210000{
status = "okay";
spi@0 {
compatible = "microchip,mcp2515";
reg = <0x0>;
spi-max-frequency = <2000000>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA234_MAIN_GPIO(B, 0) IRQ_TYPE_LEVEL_LOW>;
clocks = <&can_clock>;
nvidia,enable-hw-based-cs;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@1 {
compatible = "microchip,mcp2515";
reg = <0x1>;
spi-max-frequency = <2000000>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA234_MAIN_GPIO(E, 3) IRQ_TYPE_LEVEL_LOW>;
clocks = <&can_clock>;
nvidia,enable-hw-based-cs;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};
`
Then I modified defconfig here (I also tried this with tegra_prod_defconfig at the same location):
~/nvidia/jetson_build/ Linux_for_Tegra/source/kernel/kernel-jammy-src/arch/arm64/configs/
By placing these lines at the end of the file :
CONFIG_CAN_MCP251X= m
CONFIG_CAN_MCP251XFD= m
At this point I issued the following commands :
`export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm64
make O=out defconfig
make O=out -j$(nproc) Image dtbs modules
sudo mkdir -p ~/nvidia/jetson_build/Linux_for_Tegra/rootfs/boot/dtb/
sudo cp out/arch/arm64/boot/Image ~/nvidia/jetson_build/Linux_for_Tegra/rootfs/boot/
sudo cp out/arch/arm64/boot/dts/nvidia/*.dtb ~/nvidia/jetson_build/Linux_for_Tegra/rootfs/boot/dtb/
sudo make O=out INSTALL_MOD_PATH=~/nvidia/jetson_build/Linux_for_Tegra/rootfs/ modules_install`
Before the modules_install step the only folder here : ~/nvidia/jetson_build/Linux_for_Tegra/rootfs/lib/modules
is 5.15.136-tegra, a new folder 5.15.136 is created when I use make O=out defconfig , and a new folder is created called 5.15.136-prod if I use make O=out tegra_prod_defconfig. But ultimately my objective is to flash my jetson using the following commands and regardless of whether or not I use tegra_prod_defconfig or defconfig the module files I build do not end up on the target. I am assuming this is because they appear in 5.15.136-prod or 5.15.136 and not 5.15.136-tegra.
cd ~/nvidia/jetson_build/ Linux_for_Tegra/
sudo ./flash.sh jetson-agx-orin-devkit nvme0n1p1
So my questions are as follows:
1. Why is the defconfig file that would place module files in the 5.15.136-tegra folder not included in the sources ?
**2. Is there a way to force the flash.sh script to flash one of my modules builds as opposed to the modules build that is included by default in the sample rootfs? ****
**3. Is there a better way to execute this command that would force the modules into the 5.15.136-tegra folder? **
sudo make O=out INSTALL_MOD_PATH=~/nvidia/jetson_build/Linux_for_Tegra/rootfs/ modules_install`
4. I’m hesitant to just rename the folders produced by my build process to 5.15.136-tegra because it seems like I’m missing something with the defconfig file I’m using, but would that be a reasonable next step to try?
Thank you

