drivers: can: mcux: flexcan: fix mailbox allocation for errata 5461/5829

Commit a50b69dfb7 introduced a work-around
for FlexCAN errata 5461 and 5829, but neglegted to take the RX mailbox
offset into account when calculating maximum number of mailboxes
allocated for RX/TX.

Fixes: #44724

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2022-04-08 13:55:33 +02:00 committed by Carles Cufí
commit 51053932a3
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ config CAN_MAX_FILTER
depends on CAN_MCUX_FLEXCAN
default 5
range 1 15 if SOC_SERIES_KINETIS_KE1XF || SOC_SERIES_KINETIS_K6X
range 1 64 if SOC_SERIES_IMX_RT
range 1 63 if SOC_SERIES_IMX_RT
help
Defines maximum number of concurrent active RX filters

View file

@ -51,7 +51,7 @@ LOG_MODULE_REGISTER(can_mcux_flexcan, CONFIG_CAN_LOG_LEVEL);
* RX message buffers (filters) will take up the first N message
* buffers. The rest are available for TX use.
*/
#define MCUX_FLEXCAN_MAX_RX CONFIG_CAN_MAX_FILTER
#define MCUX_FLEXCAN_MAX_RX (CONFIG_CAN_MAX_FILTER + RX_START_IDX)
#define MCUX_FLEXCAN_MAX_TX \
(FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(0) \
- MCUX_FLEXCAN_MAX_RX)