Linux kernel 生成 /dev/spidev*

  • 最近在调试一个 spi 转 4 路uart 的设备

  • 先从spi 底层开始做起

  • kernel make menuconfig

    Device Drivers  --->
        [*] SPI support  --->
            <*>   User mode SPI device driver support
  • 板级文件

    // vim arch/arm/mach-omap2/board-aplex_ECM_5412.c
    1998 static struct spi_board_info am335x_spi1_slave_info[] = {
    1999 #if 1
    2000     {
    2001         .modalias      = "spidev",
    2002         .max_speed_hz  = 48000000,//48Mbps
    2003         .bus_num       = 2,
    2004         .chip_select   = 0,
    2005         .mode = SPI_MODE_0,
    2006     },
    2007 #endif
  • 编译 make uImage

  • 在文件系统层就会出现 /dev/spidev2.0

posted @ 2017-09-05 09:53  陈富林  阅读(3386)  评论(0编辑  收藏  举报