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