7.1.2. CAN配置指南

7.1.2.1. 内核配置

[*] Networking 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--->
                    <*> Platform CAN drivers with Netlink support
                    [*] CAN bit-timing calculation
                    <*> Support for ARTC CAN

7.1.2.2. DTS配置

CAN模块基本配置

can0: can@19230000 {
    compatible = "artc,artc-can";
    reg = <0x0 0x19230000 0x0 0x400>;
    interrupts-extended = <&plic0 88 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&cmu CLK_CAN0>;
    resets = <&rst RESET_CAN0>;
};

can1: can@19231000 {
    compatible = "artc,artc-can";
    reg = <0x0 0x19231000 0x0 0x400>;
    interrupts-extended = <&plic0 89 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&cmu CLK_CAN1>;
    resets = <&rst RESET_CAN1>;
};

xxx-board.dts配置

&can0 {
    pinctrl-names = "default";
    pinctrl-0 = <&can0_pins>;
    status = "okay";
};

&can1 {
    pinctrl-names = "default";
    pinctrl-0 = <&can1_pins>;
    status = "okay";
};