Skip to contentSkip to conversation

Termination resistor documentation

PATCH Applied Daniel S. Trevitz 2 participants 2 messages Oct 7, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Termination resistor documentation

Add documentation for how to use and setup the switchable termination resistor support for the can-controllers.

---
 Documentation/networking/can.rst | 33 ++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
Documentation/networking/can.rst +33 -0
index ebc822e605f5..90121deef217 100644
@@ -1148,6 +1148,39 @@ tuning on deep embedded systems'. The author is running a MPC603e
 load without any problems ...
 
 
+Switchable Termination Resistors
+--------------------------------
+
+CAN bus requires a specific impedance across the differential pair,
+typically provided by two 120Ohm resistors on the farthest nodes of
+the bus. Some CAN controllers support activating / deactivating a
+termination resistor(s) to provide the correct impedance.
+
+Query the available resistances::
+
+    $ ip -details link show can0
+    ...
+    termination 120 [ 0, 120 ]
+
+Activate the terminating resistor::
+
+    $ ip link set dev can0 type can termination 120
+
+Deactivate the terminating resistor::
+
+    $ ip link set dev can0 type can termination 0
+
+To enable termination resistor support to a can-controller, either
+implement in the controller's struct can-priv::
+
+    termination_const
+    termination_const_cnt
+    do_set_termination
+
+or add gpio control with the device tree entries from
+Documentation/devicetree/bindings/net/can/can-controller.yaml
+
+
 The Virtual CAN Driver (vcan)
 -----------------------------
 
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Daniel S. Trevitz

Add documentation for how to use and setup the switchable termination resistor support for the can-controllers.

Applied to linux-can/main

Thanks,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |