Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33615410 authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Greg Kroah-Hartman
Browse files

ARM: dts: at91: sama5d2: fix CAN message ram offset and size



commit 85b8350ae99d1300eb6dc072459246c2649a8e50 upstream.

CAN0 and CAN1 instances share the same message ram configured
at 0x210000 on sama5d2 Linux systems.
According to current configuration of CAN0, we need 0x1c00 bytes
so that the CAN1 don't overlap its message ram:
64 x RX FIFO0 elements => 64 x 72 bytes
32 x TXE (TX Event FIFO) elements => 32 x 8 bytes
32 x TXB (TX Buffer) elements => 32 x 72 bytes
So a total of 7168 bytes (0x1C00).

Fix offset to match this needed size.
Make the CAN0 message ram ioremap match exactly this size so that is
easily understandable.  Adapt CAN1 size accordingly.

Fixes: bc6d5d76 ("ARM: dts: at91: sama5d2: add m_can nodes")
Reported-by: default avatarDan Sneddon <dan.sneddon@microchip.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: default avatarCristian Birsan <cristian.birsan@microchip.com>
Cc: stable@vger.kernel.org # v4.13+
Link: https://lore.kernel.org/r/20201203091949.9015-1-nicolas.ferre@microchip.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a66d8ccc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1298,7 +1298,7 @@

			can0: can@f8054000 {
				compatible = "bosch,m_can";
				reg = <0xf8054000 0x4000>, <0x210000 0x4000>;
				reg = <0xf8054000 0x4000>, <0x210000 0x1c00>;
				reg-names = "m_can", "message_ram";
				interrupts = <56 IRQ_TYPE_LEVEL_HIGH 7>,
					     <64 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -1491,7 +1491,7 @@

			can1: can@fc050000 {
				compatible = "bosch,m_can";
				reg = <0xfc050000 0x4000>, <0x210000 0x4000>;
				reg = <0xfc050000 0x4000>, <0x210000 0x3800>;
				reg-names = "m_can", "message_ram";
				interrupts = <57 IRQ_TYPE_LEVEL_HIGH 7>,
					     <65 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -1501,7 +1501,7 @@
				assigned-clocks = <&can1_gclk>;
				assigned-clock-parents = <&utmi>;
				assigned-clock-rates = <40000000>;
				bosch,mram-cfg = <0x1100 0 0 64 0 0 32 32>;
				bosch,mram-cfg = <0x1c00 0 0 64 0 0 32 32>;
				status = "disabled";
			};