Message ID | 20200109145333.12260-2-benjamin.gaignard@st.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | clockevent: add low power STM32 timer | expand |
On Thu, Jan 09, 2020 at 03:53:31PM +0100, Benjamin Gaignard wrote: > Document STM32 Low Power bindings. > > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> > --- > .../bindings/timer/st,stm32-lp-timer.yaml | 44 ++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100644 Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > diff --git a/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > new file mode 100644 > index 000000000000..ca040b96dc47 > --- /dev/null > +++ b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml Use the compatible for the filename. > @@ -0,0 +1,44 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/timer/st,stm32-lp-timer.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: STMicroelectronics STM32 Low Power 16 bits timers bindings > + > +maintainers: > + - Benjamin Gaignard <benjamin.gaignard@st.com> > + > +properties: > + compatible: > + const: st,stm32-lptimer-clkevent 'clkevent' is a h/w name? Seems redundant and abusing compatible to bind to a specific Linux driver. > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + clocks: > + maxItems: 1 > + > +required: > + - compatible > + - reg > + - interrupts > + - clocks > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/clock/stm32mp1-clks.h> > + clkevent: clkevent@40009000 { timer@... > + compatible = "st,stm32-lptimer-clkevent"; > + reg = <0x40009000 0x400>; > + clocks = <&rcc LPTIM1_K>; > + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; > + }; > + > +... > -- > 2.15.0 >
Le mer. 15 janv. 2020 à 15:35, Rob Herring <robh@kernel.org> a écrit : > > On Thu, Jan 09, 2020 at 03:53:31PM +0100, Benjamin Gaignard wrote: > > Document STM32 Low Power bindings. > > > > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> > > --- > > .../bindings/timer/st,stm32-lp-timer.yaml | 44 ++++++++++++++++++++++ > > 1 file changed, 44 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > > diff --git a/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > new file mode 100644 > > index 000000000000..ca040b96dc47 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > Use the compatible for the filename. it will be in v2 > > > @@ -0,0 +1,44 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/timer/st,stm32-lp-timer.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: STMicroelectronics STM32 Low Power 16 bits timers bindings > > + > > +maintainers: > > + - Benjamin Gaignard <benjamin.gaignard@st.com> > > + > > +properties: > > + compatible: > > + const: st,stm32-lptimer-clkevent > > 'clkevent' is a h/w name? Seems redundant and abusing compatible to > bind to a specific Linux driver. No but st,stm32-lptimer compatible is already used for another driver The hardware block can implement multiple features but not all at the same time so I try to distinguish them with the compatible. In this particular case I would like tag it as a clock event driver. > > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + - clocks > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + #include <dt-bindings/interrupt-controller/arm-gic.h> > > + #include <dt-bindings/clock/stm32mp1-clks.h> > > + clkevent: clkevent@40009000 { > > timer@... OK > > > + compatible = "st,stm32-lptimer-clkevent"; > > + reg = <0x40009000 0x400>; > > + clocks = <&rcc LPTIM1_K>; > > + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; > > + }; > > + > > +... > > -- > > 2.15.0 > > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Jan 15, 2020 at 8:46 AM Benjamin Gaignard <benjamin.gaignard@linaro.org> wrote: > > Le mer. 15 janv. 2020 à 15:35, Rob Herring <robh@kernel.org> a écrit : > > > > On Thu, Jan 09, 2020 at 03:53:31PM +0100, Benjamin Gaignard wrote: > > > Document STM32 Low Power bindings. > > > > > > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> > > > --- > > > .../bindings/timer/st,stm32-lp-timer.yaml | 44 ++++++++++++++++++++++ > > > 1 file changed, 44 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > new file mode 100644 > > > index 000000000000..ca040b96dc47 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > > Use the compatible for the filename. > > it will be in v2 > > > > > > @@ -0,0 +1,44 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/timer/st,stm32-lp-timer.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: STMicroelectronics STM32 Low Power 16 bits timers bindings > > > + > > > +maintainers: > > > + - Benjamin Gaignard <benjamin.gaignard@st.com> > > > + > > > +properties: > > > + compatible: > > > + const: st,stm32-lptimer-clkevent > > > > 'clkevent' is a h/w name? Seems redundant and abusing compatible to > > bind to a specific Linux driver. > > No but st,stm32-lptimer compatible is already used for another driver > The hardware block can implement multiple features but not all at the same time > so I try to distinguish them with the compatible. > In this particular case I would like tag it as a clock event driver. That's a Linux specific thing which we've said no to for 10 years. Is "Not at the same time" a chip design time configuration or run-time config. If the latter, why do you want to use a particular instance over another one for clock event? There has to be some h/w difference. Describe the difference and then use that to grab the device to use for a clockevent. I'm fine if you omit the pwm node and then use that to decide which instance to use. Rob
Le mer. 15 janv. 2020 à 20:00, Rob Herring <robh@kernel.org> a écrit : > > On Wed, Jan 15, 2020 at 8:46 AM Benjamin Gaignard > <benjamin.gaignard@linaro.org> wrote: > > > > Le mer. 15 janv. 2020 à 15:35, Rob Herring <robh@kernel.org> a écrit : > > > > > > On Thu, Jan 09, 2020 at 03:53:31PM +0100, Benjamin Gaignard wrote: > > > > Document STM32 Low Power bindings. > > > > > > > > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> > > > > --- > > > > .../bindings/timer/st,stm32-lp-timer.yaml | 44 ++++++++++++++++++++++ > > > > 1 file changed, 44 insertions(+) > > > > create mode 100644 Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > > > > > > diff --git a/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > > new file mode 100644 > > > > index 000000000000..ca040b96dc47 > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml > > > > > > Use the compatible for the filename. > > > > it will be in v2 > > > > > > > > > @@ -0,0 +1,44 @@ > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/timer/st,stm32-lp-timer.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: STMicroelectronics STM32 Low Power 16 bits timers bindings > > > > + > > > > +maintainers: > > > > + - Benjamin Gaignard <benjamin.gaignard@st.com> > > > > + > > > > +properties: > > > > + compatible: > > > > + const: st,stm32-lptimer-clkevent > > > > > > 'clkevent' is a h/w name? Seems redundant and abusing compatible to > > > bind to a specific Linux driver. > > > > No but st,stm32-lptimer compatible is already used for another driver > > The hardware block can implement multiple features but not all at the same time > > so I try to distinguish them with the compatible. > > In this particular case I would like tag it as a clock event driver. > > That's a Linux specific thing which we've said no to for 10 years. > > Is "Not at the same time" a chip design time configuration or run-time > config. If the latter, why do you want to use a particular instance > over another one for clock event? There has to be some h/w difference. > Describe the difference and then use that to grab the device to use > for a clockevent. I'm fine if you omit the pwm node and then use that > to decide which instance to use. > There is no hardware difference between the devices but we can't do pwm and clockevent at the same time. We use the same hardware for two exclusives features. In addition we want to be able to use clockevent on one device and pwm on one another. Could "st,stm32-low-power-timer" compatible be a solution ? Benjamin > Rob
diff --git a/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml new file mode 100644 index 000000000000..ca040b96dc47 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/st,stm32-lp-timer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 Low Power 16 bits timers bindings + +maintainers: + - Benjamin Gaignard <benjamin.gaignard@st.com> + +properties: + compatible: + const: st,stm32-lptimer-clkevent + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/stm32mp1-clks.h> + clkevent: clkevent@40009000 { + compatible = "st,stm32-lptimer-clkevent"; + reg = <0x40009000 0x400>; + clocks = <&rcc LPTIM1_K>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + }; + +...
Document STM32 Low Power bindings. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> --- .../bindings/timer/st,stm32-lp-timer.yaml | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/st,stm32-lp-timer.yaml