cpu:omap3530
内核版本:2.6.32
交叉编译工具:arm-angstrom-linux-gnueabi-gcc
#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), /*gpio_171*/
OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), /*gpio_172*/
OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), /*gpio_173*/
OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), /*gpio_174*/
OMAP3_MUX(ETK_D7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
{ .reg_offset = OMAP_MUX_TERMINATOR },
};
#else
#define board_mux NULL
#endif
其中MCSPI1_CLK需要设置OMAP_PIN_INPUT输入模式,
参考:https://groups.google.com/forum/#!topic/beagleboard/xytp7UXXRAM
And, we can see in "Technical Reference Manual" 26.2.3.
It is said "SPI serial clock (output when master, input when slave)"
And it also said "(1) This output signal is also used as a re-timing input. The associated CONF_<module>_<pin>_RXACTIVE bit for the output clock must be set to 1 to enable the clock input back to the module."
omap3530想使用mcspi3、mcspi4进行AD、FPGA等交互时,考虑pin mux(端口复用)情况;
同时需要应查看mux.c、mux.h、mux34XX.h以及
OMAP35x Applications Processor
Technical Reference Manual.pdf
第776页所描述的接口复用;
SPI驱动编写,参考《OMAP3630下的Linux SPI总线驱动分析(2)》 :https://blog.csdn.net/jzzjsy/article/details/20635463
参考网址:
https://markmail.org/thread/oyrfigv37df26223
https://markmail.org/message/ktm4e2qytiv4tcm3
https://elinux.org/BeagleBoardPinMux
http://www.brianhensley.net/2012/02/spi-working-on-beagleboard-xm-rev-c.html
https://elinux.org/BeagleBoard/SPI
https://groups.google.com/forum/#!topic/beagleboard/xytp7UXXRAM
https://elinux.org/BeagleBone_Black_Enable_SPIDEV
https://groups.google.com/forum/#!topic/beagleboard/1qTgcDAzyto
https://groups.google.com/forum/#!topic/beagleboard/MgzrowFy-6U