AM335X can驱动移植

  • 驱动选择

    make menuconfig
    
    [*] Networking support  --->
        <*>   CAN bus subsystem support  --->
            --- CAN bus subsystem support
            <*>   Raw CAN Protocol (raw access with CAN-ID filtering)
            <*>   Broadcast Manager CAN Protocol (with content filtering)
            <*>   CAN Gateway/Router (with netlink configuration) 
                CAN Device Drivers  --->
                    <*> Virtual Local CAN Interface (vcan)
                    <*> Platform CAN drivers with Netlink support
                    [*]   CAN bit-timing calculation
                    <*> Bosch D_CAN devices  --->
                        <*>   Generic Platform Bus based D_CAN driver
  • 板级文件内加入

    1429 static struct evm_dev_cfg cmi_at101_dev_cfg[] = {
                // ... ...
    1442     {d_can_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
    1443     {NULL, 0, 0},
    1444 };

    // 设备节点
     850 static void d_can_init(int evm_id, int profile)
     851 {
     852     setup_pin_mux(d_can0_pin_mux);
     853     am33xx_d_can_init(0);
     854 
     855     setup_pin_mux(d_can1_pin_mux);
     856     am33xx_d_can_init(1);
     857 }

    // pin_mux
     616 static struct pinmux_config d_can0_pin_mux[] = {
     617      {"uart1_ctsn.d_can0_tx", OMAP_MUX_MODE2 | AM33XX_PULL_ENBL},
     618      {"uart1_rtsn.d_can0_rx", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
     619      {NULL, 0},
     620 };
     621 
     622 static struct pinmux_config d_can1_pin_mux[] = {
     623     {"uart0_ctsn.d_can1_tx", OMAP_MUX_MODE2 | AM33XX_PULL_ENBL},
     624     {"uart0_rtsn.d_can1_rx", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
     625     {NULL, 0},
     626 };
posted @ 2017-10-18 09:04  陈富林  阅读(1331)  评论(0编辑  收藏  举报