diff --git a/dts/arm/st/stm32f103Xb.dtsi b/dts/arm/st/stm32f103Xb.dtsi index 2e3f364509f..cbae4f17b27 100644 --- a/dts/arm/st/stm32f103Xb.dtsi +++ b/dts/arm/st/stm32f103Xb.dtsi @@ -9,6 +9,7 @@ #include #include +#include / { cpus { @@ -44,6 +45,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -52,6 +54,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -60,6 +63,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f103Xe.dtsi b/dts/arm/st/stm32f103Xe.dtsi index 9369eaa3549..1055c018f30 100644 --- a/dts/arm/st/stm32f103Xe.dtsi +++ b/dts/arm/st/stm32f103Xe.dtsi @@ -9,6 +9,7 @@ #include #include +#include / { cpus { @@ -44,6 +45,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -52,6 +54,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -60,6 +63,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f107.dtsi b/dts/arm/st/stm32f107.dtsi index 8539ddabb13..e5ddebaa127 100644 --- a/dts/arm/st/stm32f107.dtsi +++ b/dts/arm/st/stm32f107.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f303.dtsi b/dts/arm/st/stm32f303.dtsi index 978e2a56d42..4ab3a3e236c 100644 --- a/dts/arm/st/stm32f303.dtsi +++ b/dts/arm/st/stm32f303.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f334.dtsi b/dts/arm/st/stm32f334.dtsi index fe54b476219..cabf1e7b7b1 100644 --- a/dts/arm/st/stm32f334.dtsi +++ b/dts/arm/st/stm32f334.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f373.dtsi b/dts/arm/st/stm32f373.dtsi index fe54b476219..cabf1e7b7b1 100644 --- a/dts/arm/st/stm32f373.dtsi +++ b/dts/arm/st/stm32f373.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f4.dtsi b/dts/arm/st/stm32f4.dtsi index 3977ce4250c..d7d7135cf1d 100644 --- a/dts/arm/st/stm32f4.dtsi +++ b/dts/arm/st/stm32f4.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40011000 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40011000 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart6: serial@40011400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40011400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000020>; interrupts = <71 0>; status = "disabled"; label = "UART_6"; diff --git a/dts/arm/st/stm32f407.dtsi b/dts/arm/st/stm32f407.dtsi index 2420d1beff0..422fbeb7ed4 100644 --- a/dts/arm/st/stm32f407.dtsi +++ b/dts/arm/st/stm32f407.dtsi @@ -11,6 +11,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; @@ -19,6 +20,7 @@ uart4: serial@40004c00 { compatible ="st,stm32-uart"; reg = <0x40004c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00080000>; interrupts = <52 0>; status = "disabled"; label = "UART_4"; @@ -27,6 +29,7 @@ uart5: serial@40005000 { compatible = "st,stm32-uart"; reg = <0x40005000 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00100000>; interrupts = <53 0>; status = "disabled"; label = "UART_5"; diff --git a/dts/arm/st/stm32f412.dtsi b/dts/arm/st/stm32f412.dtsi index 99d3c4635bb..356e3ce80d4 100644 --- a/dts/arm/st/stm32f412.dtsi +++ b/dts/arm/st/stm32f412.dtsi @@ -11,6 +11,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; diff --git a/dts/arm/st/stm32f413.dtsi b/dts/arm/st/stm32f413.dtsi index d0dbaa90a90..4dc89d3c831 100644 --- a/dts/arm/st/stm32f413.dtsi +++ b/dts/arm/st/stm32f413.dtsi @@ -11,6 +11,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; @@ -19,6 +20,7 @@ uart4: serial@40004c00 { compatible ="st,stm32-uart"; reg = <0x40004c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00080000>; interrupts = <52 0>; status = "disabled"; label = "UART_4"; @@ -27,6 +29,7 @@ uart5: serial@40005000 { compatible = "st,stm32-uart"; reg = <0x40005000 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00100000>; interrupts = <53 0>; status = "disabled"; label = "UART_5"; @@ -35,6 +38,7 @@ uart7: serial@40007800 { compatible = "st,stm32-uart"; reg = <0x40007800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x40000000>; interrupts = <82 0>; status = "disabled"; label = "UART_7"; @@ -43,6 +47,7 @@ uart8: serial@40007c00 { compatible = "st,stm32-uart"; reg = <0x40007c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>; interrupts = <83 0>; status = "disabled"; label = "UART_8"; @@ -51,6 +56,7 @@ uart9: serial@40011800 { compatible = "st,stm32-uart"; reg = <0x40011800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000040>; interrupts = <88 0>; status = "disabled"; label = "UART_9"; @@ -59,6 +65,7 @@ uart10: serial@40011c00 { compatible = "st,stm32-uart"; reg = <0x40011c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000080>; interrupts = <89 0>; status = "disabled"; label = "UART_10"; diff --git a/dts/arm/st/stm32f469.dtsi b/dts/arm/st/stm32f469.dtsi index ddfbd6e4e8d..4d50c3d5494 100644 --- a/dts/arm/st/stm32f469.dtsi +++ b/dts/arm/st/stm32f469.dtsi @@ -11,6 +11,7 @@ uart7: serial@40007800 { compatible = "st,stm32-uart"; reg = <0x40007800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x40000000>; interrupts = <82 0>; status = "disabled"; label = "UART_7"; @@ -19,6 +20,7 @@ uart8: serial@40007c00 { compatible = "st,stm32-uart"; reg = <0x40007c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>; interrupts = <83 0>; status = "disabled"; label = "UART_8"; diff --git a/dts/arm/st/stm32l432.dtsi b/dts/arm/st/stm32l432.dtsi index 264f2260895..57ecd2b210e 100644 --- a/dts/arm/st/stm32l432.dtsi +++ b/dts/arm/st/stm32l432.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; @@ -65,6 +69,7 @@ uart4: serial@40004c00 { compatible = "st,stm32-uart"; reg = <0x40004c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00080000>; interrupts = <52 0>; status = "disabled"; label = "UART_4"; diff --git a/dts/arm/st/stm32l475.dtsi b/dts/arm/st/stm32l475.dtsi index a33b950d3b7..cd19f43606a 100644 --- a/dts/arm/st/stm32l475.dtsi +++ b/dts/arm/st/stm32l475.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { cpus { @@ -41,6 +42,7 @@ usart1: serial@40013800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; interrupts = <37 0>; status = "disabled"; label = "UART_1"; @@ -49,6 +51,7 @@ usart2: serial@40004400 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004400 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>; interrupts = <38 0>; status = "disabled"; label = "UART_2"; @@ -57,6 +60,7 @@ usart3: serial@40004800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40004800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>; interrupts = <39 0>; status = "disabled"; label = "UART_3"; @@ -65,6 +69,7 @@ uart4: serial@40004c00 { compatible = "st,stm32-uart"; reg = <0x40004c00 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00080000>; interrupts = <52 0>; status = "disabled"; label = "UART_4"; @@ -73,6 +78,7 @@ uart5: serial@40005000 { compatible = "st,stm32-uart"; reg = <0x40005000 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00100000>; interrupts = <53 0>; status = "disabled"; label = "UART_5"; diff --git a/include/drivers/clock_control/stm32_clock_control.h b/include/drivers/clock_control/stm32_clock_control.h index acb0ca593aa..56c4d85b9a4 100644 --- a/include/drivers/clock_control/stm32_clock_control.h +++ b/include/drivers/clock_control/stm32_clock_control.h @@ -10,20 +10,11 @@ #define _STM32_CLOCK_CONTROL_H_ #include +#include /* common clock control device name for all STM32 chips */ #define STM32_CLOCK_CONTROL_NAME "stm32-cc" -/* Bus */ -enum { - STM32_CLOCK_BUS_AHB1, - STM32_CLOCK_BUS_AHB2, - STM32_CLOCK_BUS_APB1, -#ifdef CONFIG_SOC_SERIES_STM32L4X - STM32_CLOCK_BUS_APB1_2, -#endif - STM32_CLOCK_BUS_APB2, -}; struct stm32_pclken { u32_t bus; diff --git a/include/dt-bindings/clock/stm32_clock.h b/include/dt-bindings/clock/stm32_clock.h new file mode 100644 index 00000000000..2130b56c5c6 --- /dev/null +++ b/include/dt-bindings/clock/stm32_clock.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef __STM32_CLOCK_H +#define __STM32_CLOCK_H + +/* clock bus references */ +#define STM32_CLOCK_BUS_AHB1 0 +#define STM32_CLOCK_BUS_AHB2 1 +#define STM32_CLOCK_BUS_APB1 2 +#define STM32_CLOCK_BUS_APB2 3 +#define STM32_CLOCK_BUS_APB1_2 4 + + +#endif /* __STM32_CLOCK_H */