lsmod only shows what modules are present. This will give you the exact configuration which was compiled, and then grep for your module:
zcat /proc/config.gz | grep -i spidev
Looks like this is neither built in nor a module. If you start with the existing config.gz you could build CONFIG_SPI_SPIDEV as a module and put it in the right directory (under “/lib/modules/$(uname -r)/”).
I don’t know enough to help with SPI config once the driver is in place. All I can do is offer some notes. Device tree is high on the list of what might need to change for the SPI detect, but someone else will need to comment on what to check on finding the imu. We need to know the version of L4T being used before it is possible to know what must be done for a device tree update…this has been a moving target for the last few releases. See:
head -n 1 /etc/nv_tegra_release
Random notes:
How to update a device tree depends on L4T release. R28.1 allowed dd into the correct partition if the partition was large enough. R28.2 and up sign the device tree, so you can't dd this.
You don't need to build zImage, you can just build Image (it'll be faster and consume less disk space).
After a "make dtbs" target you should find the dtb, you don't need to separately run dtc.
You probably won't want to start with the device tree produced in a "make tegra21_defconfig". When you have a running system you usually want to start with "/proc/config.gz" (new Jetson owner hint: Save an archive copy of this file and the output of "uname -r" when you get a new Jetson, and again after each successful flash or replacement of the kernel). In earlier L4T releases the default target and shipped Jetson would have been the same tree, but there seem to be differences since a few releases back.
If you start with "/proc/config.gz", then the CONFIG_LOCALVERSION is the only part of the device tree which is not an exact match to the running system. You can add this in with an editor.
Modules are found in "/lib/modules/$(uname -r)/". "uname -r" is from the base kernel version plus the CONFIG_LOCALVERSION. If your running system is "4.4.38-tegra", then CONFIG_LOCALVERSION was "-tegra" when that kernel was compiled. Had you replaced your kernel itself without setting this it would have been looking for modules in the wrong place.
You don't need to build the kernel itself for your purposes. You can instead start with "make modules_prepare". On the other hand, it should be considered a sanity check to compile the full kernel at least once, so I would have advised doing so anyway (at least for the first compile of that source with that config).
Correct. The flash.sh script is the only way to update the dtb in R28.2. I know there have been inquiries regarding how to do the signing with open source tools (and thus a way to go back to using dd), but so far that doesn’t exist. Use R28.2.1 if you do…R28.2 is deprecated now.