diff options
author | Rafael Beims <rafael.beims@toradex.com> | 2021-12-21 17:03:50 -0300 |
---|---|---|
committer | Rafael Beims <rafael.beims@toradex.com> | 2022-01-11 09:47:52 -0300 |
commit | 5b3083e6d7a98e4afec861060537004772dc4acf (patch) | |
tree | 37d1e1a4bd40df83dfb90661e1c18484386b98ad /arch/mips/kernel/r2300_switch.S | |
parent | c65f1622951c93914478b4f006278b6bc4520fcc (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>
Diffstat (limited to 'arch/mips/kernel/r2300_switch.S')
0 files changed, 0 insertions, 0 deletions