devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] gate clock binding and descriptiveness of bindings
@ 2012-12-18  4:50 Stephen Boyd
       [not found] ` <50CFF628.4010208-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Boyd @ 2012-12-18  4:50 UTC (permalink / raw)
  To: devicetree-discuss
  Cc: Mike Turquette, Rob Herring, Grant Likely, Saravana Kannan,
	Shawn Guo, linux-arm-kernel@lists.infradead.org

Hi,

I'd like to propose a binding for gate clocks so that we can discuss how
descriptive devicetree clock bindings should be.

Binding for simple gate clocks.

This binding uses the common clock binding[1].

[1] Documentation/devicetree/bindings/clock/clock-bindings.txt

Required properties:
- compatible : shall be "gate-clock"
- #clock-cells : from common clock binding; shall be set to 0
- reg : shall be register containing bit to toggle to gate/ungate the clock
- enable-bit : shall be bit in register to set/clear to toggle the gate

Optional properties:
- clock-output-names : from common clock binding
- clocks : shall be the input parent clock which is gated by this clock.
- set-to-disable: if present, indicates bit must be set to disable the clock

Example:
        gate {
                compatible = "gate-clock";
                #clock-cells = <0>;
                reg = <0x45 0x4>;
                enable-bit = <1>;
                clocks = <&osc>
        };

This seems to capture what the gate clock needs, minus the spinlock
which can't come from DT.

Some starter questions:

1) Should we have two compatible strings, one for the "set-to-disable"
clocks and one for the "set-to-enable" clocks instead of having a
property "set-to-disable"?

2) Should we specify the enable bit as a property or should that be
handled by software? I.e. is it too descriptive to specify the bits
within a register that do something?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] gate clock binding and descriptiveness of bindings
       [not found] ` <50CFF628.4010208-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2012-12-18 22:30   ` Mitch Bradley
  0 siblings, 0 replies; 2+ messages in thread
From: Mitch Bradley @ 2012-12-18 22:30 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mike Turquette,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Rob Herring

On 12/17/2012 6:50 PM, Stephen Boyd wrote:
> Hi,
> 
> I'd like to propose a binding for gate clocks so that we can discuss how
> descriptive devicetree clock bindings should be.
> 
> Binding for simple gate clocks.
> 
> This binding uses the common clock binding[1].
> 
> [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
> 
> Required properties:
> - compatible : shall be "gate-clock"
> - #clock-cells : from common clock binding; shall be set to 0
> - reg : shall be register containing bit to toggle to gate/ungate the clock
> - enable-bit : shall be bit in register to set/clear to toggle the gate
> 
> Optional properties:
> - clock-output-names : from common clock binding
> - clocks : shall be the input parent clock which is gated by this clock.
> - set-to-disable: if present, indicates bit must be set to disable the clock
> 
> Example:
>         gate {
>                 compatible = "gate-clock";
>                 #clock-cells = <0>;
>                 reg = <0x45 0x4>;
>                 enable-bit = <1>;
>                 clocks = <&osc>
>         };
> 
> This seems to capture what the gate clock needs, minus the spinlock
> which can't come from DT.
> 
> Some starter questions:
> 
> 1) Should we have two compatible strings, one for the "set-to-disable"
> clocks and one for the "set-to-enable" clocks instead of having a
> property "set-to-disable"?

I would say no, based on the fact that it is very likely that there will
be a single driver.

> 
> 2) Should we specify the enable bit as a property or should that be
> handled by software? I.e. is it too descriptive to specify the bits
> within a register that do something?

If you want to parameterize it down to the register level, you probably
also need to express the register access size.  For ARM, it will nearly
always be 32 bits, but other architectures sometimes use other access
sizes.

> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-18 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18  4:50 [RFC] gate clock binding and descriptiveness of bindings Stephen Boyd
     [not found] ` <50CFF628.4010208-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2012-12-18 22:30   ` Mitch Bradley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).