diff --git a/boards/arm/black_f407_generic/Kconfig.defconfig b/boards/arm/black_f407_generic/Kconfig.defconfig index 1c63787550b..a08b70c439d 100644 --- a/boards/arm/black_f407_generic/Kconfig.defconfig +++ b/boards/arm/black_f407_generic/Kconfig.defconfig @@ -12,10 +12,6 @@ config PWM_STM32_2 default y depends on PWM -config CAN_2 - default y - depends on CAN - config SPI_STM32_INTERRUPT default y depends on SPI diff --git a/boards/arm/black_f407_generic/black_f407ve.dts b/boards/arm/black_f407_generic/black_f407ve.dts index af9ceea8073..8caca94549b 100644 --- a/boards/arm/black_f407_generic/black_f407ve.dts +++ b/boards/arm/black_f407_generic/black_f407ve.dts @@ -83,7 +83,7 @@ &can1 { bus-speed = <125000>; - status = "okay"; + status = "disabled"; }; &can2 { diff --git a/boards/arm/black_f407_generic/pinmux.c b/boards/arm/black_f407_generic/pinmux.c index 55167e44e2f..0044712c63c 100644 --- a/boards/arm/black_f407_generic/pinmux.c +++ b/boards/arm/black_f407_generic/pinmux.c @@ -29,11 +29,11 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PD0, STM32F4_PINMUX_FUNC_PD0_CAN1_RX}, {STM32_PIN_PD1, STM32F4_PINMUX_FUNC_PD1_CAN1_TX}, -#endif /* CONFIG_CAN_1 */ -#ifdef CONFIG_CAN_2 +#endif +#if DT_HAS_NODE(DT_NODELABEL(can2)) {STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_CAN2_RX}, {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_CAN2_TX}, #endif /* CONFIG_CAN_2 */ diff --git a/boards/arm/nucleo_f746zg/Kconfig.defconfig b/boards/arm/nucleo_f746zg/Kconfig.defconfig index f3ae02b5180..0b7c6780881 100644 --- a/boards/arm/nucleo_f746zg/Kconfig.defconfig +++ b/boards/arm/nucleo_f746zg/Kconfig.defconfig @@ -23,10 +23,6 @@ config PWM_STM32_1 default y depends on PWM -config CAN_1 - default y - depends on CAN - config ADC_1 default y depends on ADC diff --git a/boards/arm/nucleo_f746zg/pinmux.c b/boards/arm/nucleo_f746zg/pinmux.c index 80c77959425..37fb004f23f 100644 --- a/boards/arm/nucleo_f746zg/pinmux.c +++ b/boards/arm/nucleo_f746zg/pinmux.c @@ -64,10 +64,10 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO }, { STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI }, #endif -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PD0, STM32F7_PINMUX_FUNC_PD0_CAN_RX}, {STM32_PIN_PD1, STM32F7_PINMUX_FUNC_PD1_CAN_TX}, -#endif /* CONFIG_CAN_1 */ +#endif #ifdef CONFIG_ADC_1 { STM32_PIN_PA0, STM32F7_PINMUX_FUNC_PA0_ADC123_IN0 }, #endif /* CONFIG_ADC_1 */ diff --git a/boards/arm/nucleo_f767zi/Kconfig.defconfig b/boards/arm/nucleo_f767zi/Kconfig.defconfig index 7e9bf529b55..a116070f33d 100644 --- a/boards/arm/nucleo_f767zi/Kconfig.defconfig +++ b/boards/arm/nucleo_f767zi/Kconfig.defconfig @@ -23,10 +23,6 @@ config PWM_STM32_1 default y depends on PWM -config CAN_1 - default y - depends on CAN - config ADC_1 default y depends on ADC diff --git a/boards/arm/nucleo_f767zi/pinmux.c b/boards/arm/nucleo_f767zi/pinmux.c index de13961331d..13db211c94e 100644 --- a/boards/arm/nucleo_f767zi/pinmux.c +++ b/boards/arm/nucleo_f767zi/pinmux.c @@ -64,10 +64,10 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO }, { STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI }, #endif -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PD0, STM32F7_PINMUX_FUNC_PD0_CAN_RX}, {STM32_PIN_PD1, STM32F7_PINMUX_FUNC_PD1_CAN_TX}, -#endif /* CONFIG_CAN_1 */ +#endif #ifdef CONFIG_ADC_1 { STM32_PIN_PA0, STM32F7_PINMUX_FUNC_PA0_ADC123_IN0 }, #endif /* CONFIG_ADC_1 */ diff --git a/boards/arm/nucleo_l432kc/Kconfig.defconfig b/boards/arm/nucleo_l432kc/Kconfig.defconfig index 9174aa7933a..d227e6e719c 100644 --- a/boards/arm/nucleo_l432kc/Kconfig.defconfig +++ b/boards/arm/nucleo_l432kc/Kconfig.defconfig @@ -17,8 +17,4 @@ config SPI_STM32_INTERRUPT default y depends on SPI -config CAN_1 - default y - depends on CAN - endif # BOARD_NUCLEO_L432KC diff --git a/boards/arm/nucleo_l432kc/pinmux.c b/boards/arm/nucleo_l432kc/pinmux.c index a4d6138b97b..b47ca403dcc 100644 --- a/boards/arm/nucleo_l432kc/pinmux.c +++ b/boards/arm/nucleo_l432kc/pinmux.c @@ -38,10 +38,10 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, #endif -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_CAN_RX}, {STM32_PIN_PA12, STM32L4X_PINMUX_FUNC_PA12_CAN_TX}, -#endif /* CONFIG_CAN_1 */ +#endif }; static int pinmux_stm32_init(struct device *port) diff --git a/boards/arm/nucleo_l452re/Kconfig.defconfig b/boards/arm/nucleo_l452re/Kconfig.defconfig index b8f221658be..f8436ebb81c 100644 --- a/boards/arm/nucleo_l452re/Kconfig.defconfig +++ b/boards/arm/nucleo_l452re/Kconfig.defconfig @@ -17,8 +17,4 @@ config SPI_STM32_INTERRUPT default y depends on SPI -config CAN_1 - default y - depends on CAN - endif # BOARD_NUCLEO_L452RE diff --git a/boards/arm/nucleo_l452re/pinmux.c b/boards/arm/nucleo_l452re/pinmux.c index 768ac2d469d..7d814747f51 100644 --- a/boards/arm/nucleo_l452re/pinmux.c +++ b/boards/arm/nucleo_l452re/pinmux.c @@ -37,10 +37,10 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, #endif -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_CAN_RX}, {STM32_PIN_PA12, STM32L4X_PINMUX_FUNC_PA12_CAN_TX}, -#endif /* CONFIG_CAN_1 */ +#endif }; static int pinmux_stm32_init(struct device *port) diff --git a/boards/arm/olimex_stm32_p405/Kconfig.defconfig b/boards/arm/olimex_stm32_p405/Kconfig.defconfig index 9d312f54954..8dc0211bd7f 100644 --- a/boards/arm/olimex_stm32_p405/Kconfig.defconfig +++ b/boards/arm/olimex_stm32_p405/Kconfig.defconfig @@ -8,8 +8,4 @@ if BOARD_OLIMEX_STM32_P405 config BOARD default "olimex_stm32_p405" -config CAN_1 - default y - depends on CAN - endif # BOARD_OLIMEX_STM32_P405 diff --git a/boards/arm/olimex_stm32_p405/pinmux.c b/boards/arm/olimex_stm32_p405/pinmux.c index 8446aca3c77..72b3cab12c7 100644 --- a/boards/arm/olimex_stm32_p405/pinmux.c +++ b/boards/arm/olimex_stm32_p405/pinmux.c @@ -18,10 +18,10 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, #endif -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_CAN1_RX}, {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_CAN1_TX}, -#endif /* CONFIG_CAN_1 */ +#endif }; static int pinmux_stm32_init(struct device *port) diff --git a/boards/arm/olimexino_stm32/Kconfig.defconfig b/boards/arm/olimexino_stm32/Kconfig.defconfig index 348304a02ce..93b4edbf7e3 100644 --- a/boards/arm/olimexino_stm32/Kconfig.defconfig +++ b/boards/arm/olimexino_stm32/Kconfig.defconfig @@ -16,8 +16,4 @@ config PWM_STM32_1 default y depends on PWM -config CAN_1 - default y - depends on CAN - endif # BOARD_OLIMEXINO_STM32 diff --git a/boards/arm/olimexino_stm32/pinmux.c b/boards/arm/olimexino_stm32/pinmux.c index 9f846d74ab6..7d5ec4f3827 100644 --- a/boards/arm/olimexino_stm32/pinmux.c +++ b/boards/arm/olimexino_stm32/pinmux.c @@ -58,10 +58,10 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PB8, STM32F1_PINMUX_FUNC_PB8_CAN_RX}, {STM32_PIN_PB9, STM32F1_PINMUX_FUNC_PB9_CAN_TX}, -#endif /* CONFIG_CAN_1 */ +#endif }; static int pinmux_stm32_init(struct device *port) @@ -69,10 +69,10 @@ static int pinmux_stm32_init(struct device *port) ARG_UNUSED(port); stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf)); -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) /* Set pin-mux so that CAN1 is on PB8 and PB9 */ AFIO->MAPR |= AFIO_MAPR_CAN_REMAP_REMAP2; -#endif /* CONFIG_CAN_1 */ +#endif return 0; } diff --git a/boards/arm/stm32f072b_disco/Kconfig.defconfig b/boards/arm/stm32f072b_disco/Kconfig.defconfig index e2826dfe11f..75472bbad3d 100644 --- a/boards/arm/stm32f072b_disco/Kconfig.defconfig +++ b/boards/arm/stm32f072b_disco/Kconfig.defconfig @@ -12,8 +12,4 @@ config SPI_STM32_INTERRUPT default y depends on SPI -config CAN_1 - default y - depends on CAN - endif # BOARD_STM32F072B_DISCO diff --git a/boards/arm/stm32f072b_disco/pinmux.c b/boards/arm/stm32f072b_disco/pinmux.c index 8fca8544ee9..08101a1e7cd 100644 --- a/boards/arm/stm32f072b_disco/pinmux.c +++ b/boards/arm/stm32f072b_disco/pinmux.c @@ -32,10 +32,10 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PB4, STM32F0_PINMUX_FUNC_PB4_SPI1_MISO}, {STM32_PIN_PB5, STM32F0_PINMUX_FUNC_PB5_SPI1_MOSI}, #endif -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PB8, STM32F0_PINMUX_FUNC_PB8_CAN_RX}, {STM32_PIN_PB9, STM32F0_PINMUX_FUNC_PB9_CAN_TX}, -#endif /* CONFIG_CAN_1 */ +#endif }; diff --git a/boards/arm/stm32f3_disco/Kconfig.defconfig b/boards/arm/stm32f3_disco/Kconfig.defconfig index a662a578766..f2def331570 100644 --- a/boards/arm/stm32f3_disco/Kconfig.defconfig +++ b/boards/arm/stm32f3_disco/Kconfig.defconfig @@ -8,8 +8,4 @@ if BOARD_STM32F3_DISCO config BOARD default "stm32f3_disco" -config CAN_1 - default y - depends on CAN - endif # BOARD_STM32F3_DISCO diff --git a/boards/arm/stm32f3_disco/pinmux.c b/boards/arm/stm32f3_disco/pinmux.c index 3870b158bf4..4381e761411 100644 --- a/boards/arm/stm32f3_disco/pinmux.c +++ b/boards/arm/stm32f3_disco/pinmux.c @@ -50,10 +50,10 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PD0, STM32F3_PINMUX_FUNC_PD0_CAN1_RX}, {STM32_PIN_PD1, STM32F3_PINMUX_FUNC_PD1_CAN1_TX}, -#endif /* CONFIG_CAN_1 */ +#endif }; static int pinmux_stm32_init(struct device *port) diff --git a/boards/arm/stm32f4_disco/Kconfig.defconfig b/boards/arm/stm32f4_disco/Kconfig.defconfig index 881b6496297..421d78abab0 100644 --- a/boards/arm/stm32f4_disco/Kconfig.defconfig +++ b/boards/arm/stm32f4_disco/Kconfig.defconfig @@ -12,8 +12,4 @@ config PWM_STM32_2 default y depends on PWM -config CAN_2 - default y - depends on CAN - endif # BOARD_STM32F4_DISCO diff --git a/boards/arm/stm32f4_disco/pinmux.c b/boards/arm/stm32f4_disco/pinmux.c index 172cb2b3044..4a805b50294 100644 --- a/boards/arm/stm32f4_disco/pinmux.c +++ b/boards/arm/stm32f4_disco/pinmux.c @@ -29,14 +29,14 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#ifdef CONFIG_CAN_1 +#if DT_HAS_NODE(DT_NODELABEL(can1)) {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_CAN1_RX}, {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_CAN1_TX}, -#endif /* CONFIG_CAN_1 */ -#ifdef CONFIG_CAN_2 +#endif +#if DT_HAS_NODE(DT_NODELABEL(can2)) {STM32_PIN_PB5, STM32F4_PINMUX_FUNC_PB5_CAN2_RX}, {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_CAN2_TX}, -#endif /* CONFIG_CAN_2 */ +#endif }; static int pinmux_stm32_init(struct device *port) diff --git a/boards/arm/stm32f4_disco/stm32f4_disco.dts b/boards/arm/stm32f4_disco/stm32f4_disco.dts index 36fe9115725..d22bf4ef86e 100644 --- a/boards/arm/stm32f4_disco/stm32f4_disco.dts +++ b/boards/arm/stm32f4_disco/stm32f4_disco.dts @@ -85,7 +85,7 @@ &can1 { bus-speed = <125000>; - status = "okay"; + status = "disabled"; }; &can2 {