]> git.baikalelectronics.ru Git - kernel.git/commit
can: ifi: Add obscure bit swap for EFF frame IDs
authorMarek Vasut <marex@denx.de>
Thu, 3 Mar 2016 19:45:58 +0000 (20:45 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 10 Mar 2016 09:19:09 +0000 (10:19 +0100)
commitd0f3cfb3de3d928447e4f73c5d8df80bcc5a5636
treeeee67e46f22111dad939b2ea5d40d8b3312e2fc9
parent55c755fbf923d9522b1a135fe4373d1614c13032
can: ifi: Add obscure bit swap for EFF frame IDs

In case of CAN2.0 EFF frame, the controller handles frame IDs in a
rather bizzare way. The ID is split into an extended part, IDX[28:11]
and standard part, ID[10:0]. In the TX path, the core first sends the
top 11 bits of the IDX, followed by ID and finally the rest of IDX.
In the RX path, the core stores the ID the LSbit part of IDX field,
followed by the LSbit parts of real IDX. The MSbit parts of IDX are
stored in ID field of the register.

This patch implements the necessary bit shuffling to mitigate this
obscure behavior. In case two of these controllers are connected
together, the RX and TX bit swapping nullifies itself and the issue
does not manifest. The issue only manifests when talking to another
different CAN controller.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Reviewed-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/ifi_canfd/ifi_canfd.c