]> git.baikalelectronics.ru Git - kernel.git/commit
can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers.
authorPankaj Bansal <pankaj.bansal@nxp.com>
Fri, 24 Nov 2017 13:22:08 +0000 (18:52 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 1 Dec 2017 08:14:23 +0000 (09:14 +0100)
commitfaa84a5135463a6fb51cde163e8a96367b1214d8
treed491a2ca0a76815d33b1b24565a583f09637e0c3
parenta167060ceead48ea7768233cce01746ea60ac835
can: flexcan: Remodel FlexCAN register r/w APIs for big endian FlexCAN controllers.

The FlexCAN driver assumed that FlexCAN controller is big endian for
powerpc architecture and little endian for other architectures.

But this may not be the case. FlexCAN controller can be little or big
endian on any architecture. For e.g. NXP LS1021A ARM based SOC has big
endian FlexCAN controller.

Therefore, the driver has been modified to add a provision for both
types of controllers using an additional device tree property. On a
"fsl,p1010-flexcan" device BE is default, on all other devices LE is.

Big Endian controllers should have "big-endian" set in the device tree.
check "Documentation/devicetree/bindings/net/can/fsl-flexcan.txt" for
usage.

This is the standard practice followed in linux. for more info check:
Documentation/devicetree/bindings/common-properties.txt

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@freescale.com>
Signed-off-by: Sakar Arora <Sakar.Arora@freescale.com>
Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Reviewed-by: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c