How to add SPI device on AM335X
As we know, we frequently utilize SPI devices on the embedded boards, however, many development boards have no SPI devices, as a result, there is no registration information of SPI devices in it's kernel, you may have no ideas for adding SP...
By jack
As we know, we frequently utilize SPI devices on the embedded boards, however, many development boards have no SPI devices, as a result, there is no registration information of SPI devices in it's kernel, you may have no ideas for adding SPI devices if you are not familiar with the kernel.
Don't worry, here, we take MYD-AM335X development board as an example to indicate the way to add SPI flash on the board.
1. First, we need spidev, and we need to add it to the kernel, running it under the root catalog of Linux kernel original code.
1 | make ARCH=arm menuconfig |
Choose it in sequence:

Attention: above should all be choosed.
2. Add pin configuration of SPI on arch/arm/mach-omap2/board-am335xevm.c file.
1 2 3 4 5 6 7 8 | /* Module pin for SPI, JBO */
|
3. Add SPI devices and registration function
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 | /* Spi slave device, JBO */
|
4. Add the function call on device initialization list, comment out the MCASP function, as follow
1 2 3 4 5 6 7 | static struct evm_dev_cfg myd_am335x_dev_cfg[] = {
|
5. recompile the kernel, you could find spidev 2.0 device node under the /dev/ catalog after you start up the board by this kernel.
By jack
Re-use is only permitted for informational and non-commercial or personal use only.
