Skip to content

Commit 1b9e927

Browse files
drivers: can: mcux: flexcan: allow configuring max filters from 0 to 128
The maximum number of RX filters is limited by the number of message buffers, which cannot exceed 128. Add a range to the Kconfig option imposing this. Remove artificial build-time check on CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS being larger than zero, as transmit-only configuration is otherwise fully supported. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
1 parent 2cd5621 commit 1b9e927

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

‎drivers/can/Kconfig.mcux‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ config CAN_MCUX_FLEXCAN_WAIT_TIMEOUT
2929
freeze mode.
3030

3131
config CAN_MCUX_FLEXCAN_MAX_FILTERS
32-
int "Maximum number of concurrent active RX filters"
32+
int "Maximum number of concurrently active RX filters"
33+
range 0 128
3334
default 5 if CAN_MCUX_FLEXCAN_FD
3435
default 13
3536
help
36-
Defines maximum number of concurrent active RX filters
37-
The maximum value depends on the number of available message
38-
buffers for each FlexCAN instance. CAN FD mode uses larger
39-
message buffers, resulting in fewer available filters.
37+
Defines maximum number of concurrently active RX filters. The maximum value depends on the
38+
number of available message buffers for each FlexCAN instance.
39+
40+
CAN FD mode uses larger message buffers, resulting in fewer available filters.
4041

4142
endif # CAN_MCUX_FLEXCAN

‎drivers/can/can_mcux_flexcan.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,8 +1537,6 @@ static DEVICE_API(can, mcux_flexcan_fd_driver_api) = {
15371537
"FlexCAN instance " STRINGIFY(id) " clk-source without named clock")))
15381538

15391539
#define FLEXCAN_CHECK_MAX_FILTER(id) \
1540-
BUILD_ASSERT(CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS > 0, \
1541-
"Maximum number of RX filters should greater than 0"); \
15421540
BUILD_ASSERT(FLEXCAN_INST_NUMBER_OF_MB(id) > FLEXCAN_INST_RX_MB(id), \
15431541
"FlexCAN instance " STRINGIFY(id) " number-of-mb (" \
15441542
STRINGIFY(FLEXCAN_INST_NUMBER_OF_MB(id)) \

‎dts/bindings/can/nxp,flexcan.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ properties:
4848
- 128
4949
required: true
5050
description: |
51-
Number of 8-byte sized message buffers supported by this FlexCAN instance.
51+
Number of 8-byte sized message buffers (MBs) supported by this FlexCAN instance. CAN FD mode,
52+
if supported, uses 64-byte sized MBs, resulting in fewer available MBs.
5253
5354
examples:
5455
- |

0 commit comments

Comments
 (0)