How can Build,install ,test the SPIdev Module at TX1 R28.1?

How can Build,install ,test the SPIdev Module at TX1 R28.1?

  1. Which type is build the SPIdev Module?
    [ * ] built-in is this?
    < M > module ,is this?

2.How can install the SPIdev Module?

3.How can test the SPIdev Module?

I am not an “SPI guy”, but generally speaking (and there are exceptions to this) you can build as a module ("") to simplify your life. Some features cannot be built as a module, e.g., swap, and some features are needed before boot can occur (e.g., understanding ext4 can’t be a module if the modules are on an ext4 partition…else it couldn’t read its own ext4 module).

If you build a module, then it ends up as a file copy to somewhere in “/lib/modules/$(uname -r)/”, and the actual kernel is not modified.

If you build as a non-module (integrated) feature, then the Image file (the actual kernel) is what changes. If and only if the build of a kernel Image does not change “uname -r” will the modules be searched for in the same place and perhaps not need replacement (if the previous configuration changes only by addition of modules, then all previous modules will be valid…if a feature integrated within the kernel changes, then previous modules may be invalid).

I do edit “CONFIG_LOCALVERSION” by hand. If my previous “uname -r” is something like “4.4.38-tegra”, then I edit CONFIG_LOCALVERSION to be “-tegra”. Everything else I use one of the make targets for configuration…those tools understand dependencies. If you add a feature for SPI using one of these tools, then you know the configuration will “do the right thing” and you do not need to worry about other dependencies. My favorite (due to search features and the ability to see features not yet enabled) is “make nconfig”. There are other config tools as well.

This is for a TX2, but both share the same kernel and procedures in R28+:
https://devtalk.nvidia.com/default/topic/1038175/jetson-tx2/tx2i-wifi-support/post/5274619/#5274619

You could skip “make Image” if you are only building modules, but then you need to start instead with “make modules_prepare”. I recommend against skipping “make Image” even if you are not building the kernel and only want modules. I say this because it is a “sanity check” on whether the configuration is correct. “make Image” does some configuration which can take the place of “make modules_prepare”, plus it builds the actual Image. Failing to build “Image” is a good sign the modules won’t be valid for your Image.

Any given module, within the kernel source, tends to be in a directory which is similar to where it would be in the final “/lib/modules/$(uname -r)/”. As an example, I see in source “drivers/spi/spidev.c”. I am guessing that any automatic tool for installing some spidev.ko module, when “uname -r” is “4.4.38-tegra”, would be:

/lib/modules/4.4.38-tegra/kernel/drivers/spi/spidev.ko

A correctly built spidev.ko, placed as shown, and then followed by “sudo depmod -a”, is probably what you want.

EDIT: Forgot to add, another thread reminded me:
Tip: If you have not done so already, then the command line config tools will want this package added:

sudo apt-get install libncurses5-dev