Why my build Image can't detect /dev/spi* but the Image in l4t32.3.1/kernel can?

Hi All,

My build Image scipt as blow.

garret:~/src_share/l4t32.3.1/kernel_src/kernel/kernel-4.9$ cat make.sh
#!/bin/bash

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make tegra_defconfig
make -j4 -f ./Makefile zImage

the spi object files as follows,

garret:~/src_share/l4t32.3.1/kernel_src/kernel/kernel-4.9$ find ./ -name "*.o" | grep spi
./drivers/net/can/spi/built-in.o
./drivers/media/spi/built-in.o
./drivers/media/spi/imx204.o
./drivers/spi/built-in.o
./drivers/spi/spi-tegra210-qspi.o
./drivers/spi/spi-tegra114.o
./drivers/spi/spi-tegra124-slave.o
./drivers/spi/spi.o
./drivers/spi/spi-tegra-aon.o
./drivers/mtd/devices/qspi_mtd.o
./drivers/mtd/spi-nor/built-in.o
./drivers/mtd/spi-nor/spi-nor.o
./drivers/base/regmap/regmap-spi.o
./kernel/locking/spinlock.o
./sound/spi/built-in.o
./lib/bust_spinlocks.o
./arch/arm64/kernel/smp_spin_table.o

and the nano spi infomation is in blow code section.

sercomm:/sys/devices/7000d400.spi/of_node/spi@0$ ls /sys/bus/spi/
devices  drivers  drivers_autoprobe  drivers_probe  uevent
sercomm:/sys/devices/7000d400.spi/of_node/spi@0$ ls /sys/bus/spi/devices/
spi0.0  spi1.0  spi32766.0
sercomm:/sys/devices/7000d400.spi/of_node/spi@0$ dmesg | grep spi
[    0.439376] iommu: Adding device 7000d400.spi to group 7
[    0.439630] iommu: Adding device 7000d600.spi to group 8
[    0.439920] iommu: Adding device 70410000.spi to group 9
[    1.062082] tegra-qspi 70410000.spi: Prod settings list not found
[    1.063347] qspi_mtd spi32766.0: MX25U3235F (4096 Kbytes)
[    1.063358] qspi_mtd spi32766.0: mtd .name = spi32766.0, .size = 0x400000 (4MiB) .erasesize = 0x00001000 (4KiB) .numeraseregions = 0

Do I need to config the .config file generated by make tegra_defconfig?

It needs to change the default the CONFIG_SPI_SPIDEV=m in .config CONFIG_SPI_SPIDEV=y.
The /dev/spi* can be detected now.

sercomm:~$ ls /dev/s
shm/       snd/       spidev0.0  spidev1.0  stderr     stdin      stdout

Or, you just need to add a file in /etc/modprobe.d with “spidev” in it.

You may need to check if uname -a is the same after you update your Image.

May need export LOCALVERSION=-tegra to build the kernel Image for module name detect.