diff --git a/drivers/can/CMakeLists.txt b/drivers/can/CMakeLists.txt index 3302c7e6af5..d6c2730c015 100644 --- a/drivers/can/CMakeLists.txt +++ b/drivers/can/CMakeLists.txt @@ -13,7 +13,7 @@ zephyr_library_sources_ifdef(CONFIG_CAN_MCP2515 can_mcp2515.c) zephyr_library_sources_ifdef(CONFIG_CAN_MCUX_FLEXCAN can_mcux_flexcan.c) zephyr_library_sources_ifdef(CONFIG_CAN_SAM can_sam.c) zephyr_library_sources_ifdef(CONFIG_CAN_SAM0 can_sam0.c) -zephyr_library_sources_ifdef(CONFIG_CAN_STM32 can_stm32.c) +zephyr_library_sources_ifdef(CONFIG_CAN_STM32_BXCAN can_stm32_bxcan.c) zephyr_library_sources_ifdef(CONFIG_CAN_STM32FD can_stm32fd.c) zephyr_library_sources_ifdef(CONFIG_CAN_STM32H7 can_stm32h7.c) zephyr_library_sources_ifdef(CONFIG_CAN_RCAR can_rcar.c) diff --git a/drivers/can/Kconfig.stm32 b/drivers/can/Kconfig.stm32 index 4121c665be6..a807406e7e1 100644 --- a/drivers/can/Kconfig.stm32 +++ b/drivers/can/Kconfig.stm32 @@ -3,18 +3,17 @@ # Copyright (c) 2018 Alexander Wachter # SPDX-License-Identifier: Apache-2.0 -config CAN_STM32 - bool "STM32 CAN Driver" +config CAN_STM32_BXCAN + bool "STM32 bxCAN driver" default y - depends on DT_HAS_ST_STM32_CAN_ENABLED + depends on DT_HAS_ST_STM32_BXCAN_ENABLED help - Enable STM32 CAN Driver. - Tested on STM32F0, STM32F4, STM32L4 and STM32F7 series. + Enable STM32 bxCAN Driver. -if CAN_STM32 +if CAN_STM32_BXCAN config CAN_MAX_STD_ID_FILTER - int "Maximum number of std ID filters" + int "Maximum number of standard (11-bit) ID filters" default 14 range 0 28 help @@ -30,7 +29,7 @@ config CAN_MAX_STD_ID_FILTER CAN_MAX_STD_ID_FILTER + CAN_MAX_EXT_ID_FILTER * 2 <= 28 config CAN_MAX_EXT_ID_FILTER - int "Maximum number of ext ID filters" + int "Maximum number of extended (29-bit) ID filters" default 7 range 0 14 help @@ -45,4 +44,4 @@ config CAN_MAX_EXT_ID_FILTER CAN_MAX_STD_ID_FILTER + CAN_MAX_EXT_ID_FILTER * 2 <= 28 -endif # CAN_STM32 +endif # CAN_STM32_BXCAN diff --git a/drivers/can/can_stm32.c b/drivers/can/can_stm32_bxcan.c similarity index 99% rename from drivers/can/can_stm32.c rename to drivers/can/can_stm32_bxcan.c index 6674597764b..7d2fb5c1d54 100644 --- a/drivers/can/can_stm32.c +++ b/drivers/can/can_stm32_bxcan.c @@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(can_stm32, CONFIG_CAN_LOG_LEVEL); #define CAN_INIT_TIMEOUT (10 * sys_clock_hw_cycles_per_sec() / MSEC_PER_SEC) -#define DT_DRV_COMPAT st_stm32_can +#define DT_DRV_COMPAT st_stm32_bxcan #define SP_IS_SET(inst) DT_INST_NODE_HAS_PROP(inst, sample_point) || diff --git a/dts/arm/st/f0/stm32f042.dtsi b/dts/arm/st/f0/stm32f042.dtsi index 5eb16fdbce5..e8aed739bd7 100644 --- a/dts/arm/st/f0/stm32f042.dtsi +++ b/dts/arm/st/f0/stm32f042.dtsi @@ -39,7 +39,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <30 0>; clocks = <&rcc STM32_CLOCK_BUS_APB1 0x02000000>; diff --git a/dts/arm/st/f0/stm32f072.dtsi b/dts/arm/st/f0/stm32f072.dtsi index 196becfd778..368ea324e4f 100644 --- a/dts/arm/st/f0/stm32f072.dtsi +++ b/dts/arm/st/f0/stm32f072.dtsi @@ -11,7 +11,7 @@ compatible = "st,stm32f072", "st,stm32f0", "simple-bus"; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <30 0>; clocks = <&rcc STM32_CLOCK_BUS_APB1 0x02000000>; diff --git a/dts/arm/st/f0/stm32f091.dtsi b/dts/arm/st/f0/stm32f091.dtsi index 02df5e0dd7f..2b68394f507 100644 --- a/dts/arm/st/f0/stm32f091.dtsi +++ b/dts/arm/st/f0/stm32f091.dtsi @@ -53,7 +53,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <30 0>; clocks = <&rcc STM32_CLOCK_BUS_APB1 0x02000000>; diff --git a/dts/arm/st/f1/stm32f103X8.dtsi b/dts/arm/st/f1/stm32f103X8.dtsi index 1802f2d6ed1..a70d4c83a39 100644 --- a/dts/arm/st/f1/stm32f103X8.dtsi +++ b/dts/arm/st/f1/stm32f103X8.dtsi @@ -48,7 +48,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f1/stm32f105.dtsi b/dts/arm/st/f1/stm32f105.dtsi index 62004051337..9ff6104bf12 100644 --- a/dts/arm/st/f1/stm32f105.dtsi +++ b/dts/arm/st/f1/stm32f105.dtsi @@ -34,7 +34,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; @@ -45,7 +45,7 @@ }; can2: can@40006800 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006800 0x400>; interrupts = <63 0>, <64 0>, <65 0>, <66 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f3/stm32f3.dtsi b/dts/arm/st/f3/stm32f3.dtsi index 4f208b2d5b5..bef28bd44dc 100644 --- a/dts/arm/st/f3/stm32f3.dtsi +++ b/dts/arm/st/f3/stm32f3.dtsi @@ -414,7 +414,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f4/stm32f405.dtsi b/dts/arm/st/f4/stm32f405.dtsi index a3264e2bf4c..a04a6c5ddd6 100644 --- a/dts/arm/st/f4/stm32f405.dtsi +++ b/dts/arm/st/f4/stm32f405.dtsi @@ -206,7 +206,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; @@ -217,7 +217,7 @@ }; can2: can@40006800 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006800 0x400>; interrupts = <63 0>, <64 0>, <65 0>, <66 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f4/stm32f412.dtsi b/dts/arm/st/f4/stm32f412.dtsi index e6550de6c62..760b01c6396 100644 --- a/dts/arm/st/f4/stm32f412.dtsi +++ b/dts/arm/st/f4/stm32f412.dtsi @@ -206,7 +206,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; @@ -217,7 +217,7 @@ }; can2: can@40006800 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006800 0x400>; interrupts = <63 0>, <64 0>, <65 0>, <66 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f4/stm32f413.dtsi b/dts/arm/st/f4/stm32f413.dtsi index 11cfcd66ccd..17d8137badd 100644 --- a/dts/arm/st/f4/stm32f413.dtsi +++ b/dts/arm/st/f4/stm32f413.dtsi @@ -73,7 +73,7 @@ }; can3: can@40006c00 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006c00 0x400>; interrupts = <74 0>, <75 0>, <76 0>, <77 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f4/stm32f446.dtsi b/dts/arm/st/f4/stm32f446.dtsi index f3ae8479f95..d7039c4ff1b 100644 --- a/dts/arm/st/f4/stm32f446.dtsi +++ b/dts/arm/st/f4/stm32f446.dtsi @@ -59,7 +59,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; @@ -70,7 +70,7 @@ }; can2: can@40006800 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006800 0x400>; interrupts = <63 0>, <64 0>, <65 0>, <66 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f7/stm32f7.dtsi b/dts/arm/st/f7/stm32f7.dtsi index 4519c6d65a9..b4c80c89103 100644 --- a/dts/arm/st/f7/stm32f7.dtsi +++ b/dts/arm/st/f7/stm32f7.dtsi @@ -396,7 +396,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/f7/stm32f745.dtsi b/dts/arm/st/f7/stm32f745.dtsi index 83763dce605..895525f9bc0 100644 --- a/dts/arm/st/f7/stm32f745.dtsi +++ b/dts/arm/st/f7/stm32f745.dtsi @@ -66,7 +66,7 @@ }; can2: can@40006800 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006800 0x400>; interrupts = <63 0>, <64 0>, <65 0>, <66 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/l4/stm32l431.dtsi b/dts/arm/st/l4/stm32l431.dtsi index 9262c99ae8f..d25d3bc1c22 100644 --- a/dts/arm/st/l4/stm32l431.dtsi +++ b/dts/arm/st/l4/stm32l431.dtsi @@ -102,7 +102,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; clocks = <&rcc STM32_CLOCK_BUS_APB1 0x02000000>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; diff --git a/dts/arm/st/l4/stm32l432.dtsi b/dts/arm/st/l4/stm32l432.dtsi index 9b488bf555c..3ad6a2e3aae 100644 --- a/dts/arm/st/l4/stm32l432.dtsi +++ b/dts/arm/st/l4/stm32l432.dtsi @@ -51,7 +51,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/l4/stm32l451.dtsi b/dts/arm/st/l4/stm32l451.dtsi index a80f3a00129..a8722ed5890 100644 --- a/dts/arm/st/l4/stm32l451.dtsi +++ b/dts/arm/st/l4/stm32l451.dtsi @@ -135,7 +135,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/l4/stm32l471.dtsi b/dts/arm/st/l4/stm32l471.dtsi index 24a62a365a1..e180b1310c0 100644 --- a/dts/arm/st/l4/stm32l471.dtsi +++ b/dts/arm/st/l4/stm32l471.dtsi @@ -226,7 +226,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/l4/stm32l496.dtsi b/dts/arm/st/l4/stm32l496.dtsi index fe6401b3a2a..d253a945415 100644 --- a/dts/arm/st/l4/stm32l496.dtsi +++ b/dts/arm/st/l4/stm32l496.dtsi @@ -49,7 +49,7 @@ }; can2: can@40006800 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006800 0x400>; interrupts = <86 0>, <87 0>, <88 0>, <89 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/arm/st/l4/stm32l4p5.dtsi b/dts/arm/st/l4/stm32l4p5.dtsi index 16b4f8d6c47..d84f2d164e7 100644 --- a/dts/arm/st/l4/stm32l4p5.dtsi +++ b/dts/arm/st/l4/stm32l4p5.dtsi @@ -285,7 +285,7 @@ }; can1: can@40006400 { - compatible = "st,stm32-can"; + compatible = "st,stm32-bxcan"; reg = <0x40006400 0x400>; interrupts = <19 0>, <20 0>, <21 0>, <22 0>; interrupt-names = "TX", "RX0", "RX1", "SCE"; diff --git a/dts/bindings/can/st,stm32-can.yaml b/dts/bindings/can/st,stm32-bxcan.yaml similarity index 92% rename from dts/bindings/can/st,stm32-can.yaml rename to dts/bindings/can/st,stm32-bxcan.yaml index 6f0f3db674a..c37031b765b 100644 --- a/dts/bindings/can/st,stm32-can.yaml +++ b/dts/bindings/can/st,stm32-bxcan.yaml @@ -1,6 +1,6 @@ description: STM32 CAN controller -compatible: "st,stm32-can" +compatible: "st,stm32-bxcan" include: [can-controller.yaml, pinctrl-device.yaml]