xref: /linux/Documentation/networking/device_drivers/can/freescale/flexcan.rst (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1bc3897f7SDario Binacchi.. SPDX-License-Identifier: GPL-2.0+
2bc3897f7SDario Binacchi
3bc3897f7SDario Binacchi=============================
4bc3897f7SDario BinacchiFlexcan CAN Controller driver
5bc3897f7SDario Binacchi=============================
6bc3897f7SDario Binacchi
7bc3897f7SDario BinacchiAuthors: Marc Kleine-Budde <mkl@pengutronix.de>,
8*318d8235SDario BinacchiDario Binacchi <dario.binacchi@amarulasolutions.com>
9bc3897f7SDario Binacchi
10bc3897f7SDario BinacchiOn/off RTR frames reception
11bc3897f7SDario Binacchi===========================
12bc3897f7SDario Binacchi
13bc3897f7SDario BinacchiFor most flexcan IP cores the driver supports 2 RX modes:
14bc3897f7SDario Binacchi
15bc3897f7SDario Binacchi- FIFO
16bc3897f7SDario Binacchi- mailbox
17bc3897f7SDario Binacchi
18bc3897f7SDario BinacchiThe older flexcan cores (integrated into the i.MX25, i.MX28, i.MX35
19bc3897f7SDario Binacchiand i.MX53 SOCs) only receive RTR frames if the controller is
20bc3897f7SDario Binacchiconfigured for RX-FIFO mode.
21bc3897f7SDario Binacchi
22bc3897f7SDario BinacchiThe RX FIFO mode uses a hardware FIFO with a depth of 6 CAN frames,
23bc3897f7SDario Binacchiwhile the mailbox mode uses a software FIFO with a depth of up to 62
24bc3897f7SDario BinacchiCAN frames. With the help of the bigger buffer, the mailbox mode
25bc3897f7SDario Binacchiperforms better under high system load situations.
26bc3897f7SDario Binacchi
27bc3897f7SDario BinacchiAs reception of RTR frames is part of the CAN standard, all flexcan
28bc3897f7SDario Binacchicores come up in a mode where RTR reception is possible.
29bc3897f7SDario Binacchi
30bc3897f7SDario BinacchiWith the "rx-rtr" private flag the ability to receive RTR frames can
31bc3897f7SDario Binacchibe waived at the expense of losing the ability to receive RTR
32bc3897f7SDario Binacchimessages. This trade off is beneficial in certain use cases.
33bc3897f7SDario Binacchi
34bc3897f7SDario Binacchi"rx-rtr" on
35bc3897f7SDario Binacchi  Receive RTR frames. (default)
36bc3897f7SDario Binacchi
37bc3897f7SDario Binacchi  The CAN controller can and will receive RTR frames.
38bc3897f7SDario Binacchi
39bc3897f7SDario Binacchi  On some IP cores the controller cannot receive RTR frames in the
40bc3897f7SDario Binacchi  more performant "RX mailbox" mode and will use "RX FIFO" mode
41bc3897f7SDario Binacchi  instead.
42bc3897f7SDario Binacchi
43bc3897f7SDario Binacchi"rx-rtr" off
44bc3897f7SDario Binacchi
45bc3897f7SDario Binacchi  Waive ability to receive RTR frames. (not supported on all IP cores)
46bc3897f7SDario Binacchi
47bc3897f7SDario Binacchi  This mode activates the "RX mailbox mode" for better performance, on
48bc3897f7SDario Binacchi  some IP cores RTR frames cannot be received anymore.
49bc3897f7SDario Binacchi
50bc3897f7SDario BinacchiThe setting can only be changed if the interface is down::
51bc3897f7SDario Binacchi
52bc3897f7SDario Binacchi    ip link set dev can0 down
53bc3897f7SDario Binacchi    ethtool --set-priv-flags can0 rx-rtr {off|on}
54bc3897f7SDario Binacchi    ip link set dev can0 up
55