linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Martin Povišer" <povik@protonmail.com>
Cc: mturquette@baylibre.com, sboyd@kernel.org,
	devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	kettenis@openbsd.org, marcan@marcan.st, sven@svenpeter.dev
Subject: Re: [PATCH 1/2] dt-bindings: clock: Add Apple NCO
Date: Tue, 14 Dec 2021 09:40:05 -0600	[thread overview]
Message-ID: <Ybi61fzpOV7CumtR@robh.at.kernel.org> (raw)
In-Reply-To: <20211214120213.15649-2-povik@protonmail.com>

On Tue, Dec 14, 2021 at 12:02:48PM +0000, Martin Povišer wrote:
> The NCO block found on Apple SoCs is a programmable clock generator
> performing fractional division of a high frequency input clock.
> 
> Signed-off-by: Martin Povišer <povik@protonmail.com>
> ---
>  .../devicetree/bindings/clock/apple,nco.yaml  | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/clock/apple,nco.yaml
> 
> diff --git a/Documentation/devicetree/bindings/clock/apple,nco.yaml b/Documentation/devicetree/bindings/clock/apple,nco.yaml
> new file mode 100644
> index 000000000000..5029824ab179
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/apple,nco.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/apple,nco.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Apple SoCs' NCO block
> +
> +maintainers:
> +  - Martin Povišer <povik@protonmail.com>
> +
> +description: |
> +  The NCO (Numerically Controlled Oscillator) block found on Apple SoCs
> +  such as the t8103 (M1) is a programmable clock generator performing
> +  fractional division of a high frequency input clock.
> +
> +  It carries a number of independent channels and is typically used for
> +  generation of audio bitclocks.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +        - apple,t6000-nco
> +        - apple,t8103-nco
> +      - const: apple,nco
> +
> +  apple,nchannels:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      The number of output channels the NCO block has been
> +      synthesized for.

I'd assume there is some max number?

Do you really need to know this? If this is just to validate the clock 
cell values are less than this, then just drop that and the property. 
It's not the kernel's job to validate the DT.

> +
> +  clocks:
> +    description:
> +      Specifies the reference clock from which the output clocks
> +      are derived through fractional division.
> +    maxItems: 1
> +
> +  '#clock-cells':
> +    const: 1
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - apple,nchannels
> +  - clocks
> +  - '#clock-cells'
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    nco_clkref: clock-ref {
> +      compatible = "fixed-clock";
> +      #clock-cells = <0>;
> +      clock-frequency = <900000000>;
> +      clock-output-names = "nco-ref";
> +    };
> +
> +    nco: clock-generator@23b044000 {

clock-controller@...

> +      compatible = "apple,t8103-nco", "apple,nco";
> +      reg = <0x3b044000 0x14000>;

You really have 0x14000 worth of registers here because all of that 
will be mapped into virtual memory? Doesn't matter so much on 64-bit, 
but it did for 32-bit.

> +      #clock-cells = <1>;
> +      clocks = <&nco_clkref>;
> +      apple,nchannels = <5>;
> +    };
> --
> 2.33.0
> 
> 
> 

  parent reply	other threads:[~2021-12-14 15:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 12:02 [PATCH 0/2] Support for Apple SoCs' NCO blocks Martin Povišer
2021-12-14 12:02 ` [PATCH 1/2] dt-bindings: clock: Add Apple NCO Martin Povišer
2021-12-14 15:21   ` Rob Herring
2021-12-14 15:40   ` Rob Herring [this message]
2021-12-14 20:07     ` Martin Povišer
2021-12-14 23:53       ` Rob Herring
2021-12-15  8:28         ` Martin Povišer
2021-12-15  8:43           ` Sven Peter
2021-12-15 12:15             ` Martin Povišer
2021-12-14 12:02 ` [PATCH 2/2] clk: clk-apple-nco: Add driver for " Martin Povišer
2021-12-15  9:01   ` Sven Peter
2021-12-15 12:43     ` Martin Povišer
2022-01-08  1:06   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ybi61fzpOV7CumtR@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kettenis@openbsd.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=mturquette@baylibre.com \
    --cc=povik@protonmail.com \
    --cc=sboyd@kernel.org \
    --cc=sven@svenpeter.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).