summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Beims <rafael.beims@toradex.com>2021-12-21 17:03:50 -0300
committerRafael Beims <rafael.beims@toradex.com>2022-01-11 09:47:52 -0300
commit5b3083e6d7a98e4afec861060537004772dc4acf (patch)
tree37d1e1a4bd40df83dfb90661e1c18484386b98ad
parentc65f1622951c93914478b4f006278b6bc4520fcc (diff)
arm64: dts: imx8mm-verdin: Update mcp2518fd maximum SPI clock frequency
The current verdin imx8mm device tree sets up the maximum SPI clock of the MCP2518FD CAN controller to 2Mhz. After executing tests with real CAN bus traffic, customers noticed significant packet loss (in some cases higher than 30% of packets lost). With more testing, we found out that increasing the SPI clock reduces the packet loss significantly without noticeable negative impact. The tests were performed with 3 different bus rates (256kbps, 512kbps and 1Mbps) and 3 different CAN bus occupation rates (~30%, ~55% and ~100%). To select the SPI clock rate for this change, we considered an errata for the MCP2518FD chip that states that the RAM can be corrupted when written at high SPI clock speeds while there's simultaneous activity on the CAN bus. The listed workaround for this issue is to limit the SPI clock to 0.85 * (SYSCLK/2). On the verdin imx8mm we have the SYSCLK setup in the hardware as 20MHz. This commit changes the SPI clock frequency to 8.5 Mhz so that we get the best performance out of the hardware. With this change we can measure reduced packet loss in several conditions, according to the table (all the tests executed with DLC 1): +-------------+----------------+------------------+--------------------+ | Bus bitrate | Bus occupation | Packet Loss 2Mhz | Packet Loss 8.5Mhz | +-------------+----------------+------------------+--------------------+ | 1Mbps | 57 % | 33.92 % | 0 | +-------------+----------------+------------------+--------------------+ | 500kbps | 57 % | 12.03 % | 0 | +-------------+----------------+------------------+--------------------+ | 1Mbps | 100 % | 31.68 % | 4.1 % | +-------------+----------------+------------------+--------------------+ | 500kbps | 100 % | 32.66 % | 0.2 % | +-------------+----------------+------------------+--------------------+ Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
-rwxr-xr-xarch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
index b6f398cd5c2f..5c2c8cca65d1 100755
--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
@@ -178,7 +178,7 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_can1_int>;
reg = <0>;
- spi-max-frequency = <2000000>;
+ spi-max-frequency = <8500000>;
};
can2: can@1 {