boards: arm: stm32: move "st,prescaler" to timers instead of pwm

Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.
This change also prepares the introduction of timer based counter
(which requires prescaler at timer level)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
This commit is contained in:
Alexandre Bourdiol 2021-10-20 19:47:14 +02:00 committed by Maureen Helm
parent 3a60344522
commit 877379fba4
25 changed files with 52 additions and 53 deletions

View file

@ -147,33 +147,34 @@
};
&timers3 {
/*
* The maximum period needed on Legend devices for activity LED
* hardware blinking is 250ms (i.e. "error" fast blink at 4 Hz).
*
* We can use the following equation to compute the
* corresponding prescaler value:
*
* period_max = counter_size / cycles_per_second
*
* With:
*
* cycles_per_second = 48 MHz / (prescaler + 1)
* counter_size = 2^16
* period_max = 0.25
*
* Which gives:
*
* prescaler = 48 MHz * 0.25 / 2^16 + 1 = 182
*
* So any prescaler value above 182 is good for a 4 Hz hardware
* blinking. In addition the PWM frequency must be as high as
* possible to fool eyes and cameras with steady brightness
* levels.
*/
st,prescaler = <200>;
pwm3: pwm {
pinctrl-0 = <&tim3_ch3_pb0>;
/*
* The maximum period needed on Legend devices for activity LED
* hardware blinking is 250ms (i.e. "error" fast blink at 4 Hz).
*
* We can use the following equation to compute the
* corresponding prescaler value:
*
* period_max = counter_size / cycles_per_second
*
* With:
*
* cycles_per_second = 48 MHz / (prescaler + 1)
* counter_size = 2^16
* period_max = 0.25
*
* Which gives:
*
* prescaler = 48 MHz * 0.25 / 2^16 + 1 = 182
*
* So any prescaler value above 182 is good for a 4 Hz hardware
* blinking. In addition the PWM frequency must be as high as
* possible to fool eyes and cameras with steady brightness
* levels.
*/
st,prescaler = <200>;
status = "disabled";
};
};

View file

@ -98,11 +98,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pwm_pa8>;
};
};

View file

@ -93,11 +93,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pa8>;
};
};

View file

@ -116,11 +116,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch3_pe13>;
};
};

View file

@ -114,11 +114,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch3_pe13>;
};
};

View file

@ -114,11 +114,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch3_pe13>;
};
};

View file

@ -117,11 +117,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch3_pe13>;
};
};

View file

@ -100,10 +100,10 @@
};
&timers3 {
st,prescaler = <10000>;
status = "okay";
pwm3: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim3_ch1_pa6>;
};
};

View file

@ -106,19 +106,19 @@ zephyr_udc0: &usb {
};
&timers3 {
st,prescaler = <10000>;
status = "okay";
pwm3: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim3_ch1_pb4>;
};
};
&timers15 {
st,prescaler = <10000>;
status = "okay";
pwm15: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim15_ch1_pb14>;
};
};

View file

@ -121,10 +121,10 @@
};
&timers3 {
st,prescaler = <10000>;
status = "okay";
pwm3: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim3_ch1_pb4>;
};
};

View file

@ -116,11 +116,11 @@
};
&timers12 {
st,prescaler = <10000>;
status = "okay";
pwm12: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim12_ch1_pb14>;
};
};

View file

@ -107,11 +107,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers12 {
st,prescaler = <10000>;
status = "okay";
pwm12: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim12_ch1_pb14>;
};
};

View file

@ -83,11 +83,11 @@
};
&timers12 {
st,prescaler = <10000>;
status = "okay";
pwm12: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim12_ch1_pb14>;
};
};

View file

@ -107,11 +107,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers12 {
st,prescaler = <10000>;
status = "okay";
pwm12: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim12_ch1_pb14>;
};
};

View file

@ -145,11 +145,11 @@
};
&timers3 {
st,prescaler = <10000>;
status = "okay";
pwm3: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim3_ch1_pb4>;
};
};

View file

@ -101,11 +101,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pe9
&tim1_ch2_pe11
&tim1_ch3_pe13>;
@ -122,11 +122,11 @@
};
&timers15 {
st,prescaler = <10000>;
status = "okay";
pwm15: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim15_ch1_pb14>;
};
};

View file

@ -134,11 +134,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pa8>;
};
};

View file

@ -101,11 +101,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pwm_pa8>;
};
};

View file

@ -126,11 +126,11 @@ zephyr_udc0: &usb {
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pwm_pa8>;
};
};

View file

@ -90,11 +90,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pwm_pa8>;
};
};

View file

@ -182,10 +182,10 @@ zephyr_udc0: &usb {
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pa8>;
};
};

View file

@ -99,11 +99,11 @@
};
&timers4 {
st,prescaler = <10000>;
status = "okay";
pwm4: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim4_ch1_pd12
&tim4_ch2_pd13
&tim4_ch3_pd14

View file

@ -110,11 +110,11 @@ zephyr_udc0: &usbotg_fs {
};
&timers3 {
st,prescaler = <10000>;
status = "okay";
pwm3: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim3_ch1_pb4>;
};
};

View file

@ -40,9 +40,7 @@
};
&timers2 {
pwm {
st,prescaler = <10000>;
};
st,prescaler = <10000>;
};
&iwdg {

View file

@ -107,11 +107,11 @@
};
&timers1 {
st,prescaler = <10000>;
status = "okay";
pwm1: pwm {
status = "okay";
st,prescaler = <10000>;
pinctrl-0 = <&tim1_ch1_pwm_pa8>;
};
};