本篇记录移植spi 接口的 mcp2515 can 芯片驱动的过程,mcp2515 芯片通过spi接口连接NUC980 的spi1接口,中断引脚接PA0中断。 此驱动移植过程主要分为如下几步。
第一步: 配置 linux 内核支持mcp2515的驱动,配置内容:
can 功能配置
[*] Networking support --->
<*> CAN bus subsystem support --->
<*> Raw CAN Protocol (raw access with CAN-ID filtering)
<*> Broadcast Manager CAN Protocol (with content filtering)
CAN Device Drivers --->
<*> Platform CAN drivers with Netlink support
[*] CAN bit-timing calculation
CAN SPI interfaces --->
<*> Microchip MCP251x and MCP25625 SPI CAN controllers
spi 接口配置
Device Drivers --->
[*] SPI support --->
<*> Nuvoton NUC980 Series SPI Port 0
SPI0 IO port selection (Port D) --->
SPI0 TX/RX by PDMA or not (Use PDMA) --->