For Zynq CANPS Dts file: zynq_can_0: can@e0008000 { compatible = "xlnx,zynq-can-1.0"; clocks = <&clkc 19>, <&clkc 36>; clock-names = "can_clk", "pclk"; reg = <0xe0008000 0x1000>; interrupts = <0 28 4>; interrupt-parent = <&intc>; tx-fifo-depth = <0x40>; rx-fifo-depth = <0x40>; }; For Axi CAN Dts file: axi_can_0: axi-can@40000000 { compatible = "xlnx,axi-can-1.00.a"; clocks = <&clkc 0>, <&clkc 1>; clock-names = "can_clk","s_axi_aclk" ; reg = <0x40000000 0x10000>; interrupt-parent = <&intc>; interrupts = <0 59 1>; tx-fifo-depth = <0x40>; rx-fifo-depth = <0x40>; }; For CAN FD 1.0: axi_can_0: axi-can@40000000 { compatible = "xlnx-canfd-1.0"; clocks = <&clkc 0>, <&clkc 1>; clock-names = "can_clk","s_axi_aclk" ; reg = <0x40000000 0x10000>; interrupt-parent = <&intc>; interrupts = <0 59 1>; tx-fifo-depth = <0x40>; rx-fifo-depth = <0x40>; }; For CAN FD 2.0: axi_can_0: canfd@80000000 { clock-names "can_clk", "can_clk_x2", "s_axi_aclk"; clocks <0x18 0x19 0x0 0x3 0x47>; compatible "xlnx,canfd-2.0"; interrupt-names "ip2bus_intrevent"; interrupt-parent <0x4>; interrupts <0x0 0x59 0x4>; reg <0x0 0x80000000 0x0 0x10000>; rx-fifo-depth <0x20>; tx-mailbox-count <0x20>; }; Note: There is no software difference between AXI CANFD and CANFD PS. So compatible "xlnx,canfd-2.0" will work for both. |
root@Xilinx-ZC702-2013:~# canconfig can3 ctrlmode loopback on can3 ctrlmode: loopback[ON], listen-only[OFF], tripple-sampling[OFF],one-shot[OFF], berr-reporting[OFF] root@Xilinx-ZC702-2013:~# cancon root@Xilinx-ZC702-2013:~# canconfig can3 bitrate 500000 XILINX_CAN e0008000.ps7-can can3: bitrate error 0.7% can3 bitrate: 496031, sample-point: 0.666 root@Xilinx-ZC702-2013:~# canconfig can3 start can3 state: ERROR-ACTIVE root@Xilinx-ZC702-2013:~# cansend can3 -i 0x77 0x33 0x88 0x33 0x88 0x33 0x88 0x33 interface = can3, family = 29, type = 3, proto = 1 root@Xilinx-ZC702-2013:~# ip -d -s link show can3 5: can3: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10 link/can promiscuity 0 can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 bitrate 496031 sample-point 0.666 tq 672 prop-seg 0 phase-seg1 1 phase-seg2 1 sjw 1 XILINX_CAN: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1 clock 23809523 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 RX: bytes packets errors dropped overrun mcast 7 1 0 0 0 0 TX: bytes packets errors dropped carrier collsns 7 1 0 0 0 0 root@Xilinx-ZC702-2013:~# cansend can3 -i 0x33 0x88 0x33 0x88 0x33 0x99 0x33 0x88 0x88 interface = can3, family = 29, type = 3, proto = 1 root@Xilinx-ZC702-2013:~# ip -d -s link show can3 5: can3: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10 link/can promiscuity 0 can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 bitrate 496031 sample-point 0.666 tq 672 prop-seg 0 phase-seg1 1 phase-seg2 1 sjw 1 XILINX_CAN: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1 clock 23809523 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 RX: bytes packets errors dropped overrun mcast 15 2 0 0 0 0 TX: bytes packets errors dropped carrier collsns 15 2 0 0 0 0 root@Xilinx-ZC702-2013:~# cansen root@Xilinx-ZC702-2013:~# cansend can3 -i 0x88 0x33 0x88 0x33 0x88 x0x33 0x88 0x33 0x88 --loop=10 interface = can3, family = 29, type = 3, proto = 1 root@Xilinx-ZC702-2013:~# ip -d -s link show can3 5: can3: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10 link/can promiscuity 0 can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 bitrate 496031 sample-point 0.666 tq 672 prop-seg 0 phase-seg1 1 phase-seg2 1 sjw 1 XILINX_CAN: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1 clock 23809523 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 RX: bytes packets errors dropped overrun mcast 95 12 0 0 0 0 TX: bytes packets errors dropped carrier collsns 95 12 0 0 0 0 root@Xilinx-ZC702-2013:~# |
2023.2
2023.1
2022.2
2022.1
2021.2
2021.1
2020.2
2020.1
2019.2
2019.1
2018.3
2018.2
2018.1
2017.4
2017.3
2017.2
2017.1
2016.4
2016.3