2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00

dt-bindings: clock: Convert ingenic,cgu.txt to YAML

Convert the ingenic,cgu.txt doc file to ingenic,cgu.yaml.

The binding documentation has been updated as well. The node can have a
child node that corresponds to the USB PHY, which happens to be present
in the middle of the CGU registers.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Paul Cercueil 2020-04-26 20:58:49 +02:00 committed by Rob Herring
parent c54030b191
commit 4b7cf35c55
2 changed files with 122 additions and 57 deletions

View File

@ -1,57 +0,0 @@
Ingenic SoC CGU binding
The CGU in an Ingenic SoC provides all the clocks generated on-chip. It
typically includes a variety of PLLs, multiplexers, dividers & gates in order
to provide many different clock signals derived from only 2 external source
clocks.
Required properties:
- compatible : Should be one of:
* ingenic,jz4740-cgu
* ingenic,jz4725b-cgu
* ingenic,jz4770-cgu
* ingenic,jz4780-cgu
* ingenic,x1000-cgu
- reg : The address & length of the CGU registers.
- clocks : List of phandle & clock specifiers for clocks external to the CGU.
Two such external clocks should be specified - first the external crystal
"ext" and second the RTC clock source "rtc".
- clock-names : List of name strings for the external clocks.
- #clock-cells: Should be 1.
Clock consumers specify this argument to identify a clock. The valid values
may be found in <dt-bindings/clock/<soctype>-cgu.h>.
Example SoC include file:
/ {
cgu: jz4740-cgu {
compatible = "ingenic,jz4740-cgu";
reg = <0x10000000 0x100>;
#clock-cells = <1>;
};
uart0: serial@10030000 {
clocks = <&cgu JZ4740_CLK_UART0>;
};
};
Example board file:
/ {
ext: clock@0 {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12000000>;
};
rtc: clock@1 {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <32768>;
};
&cgu {
clocks = <&ext> <&rtc>;
clock-names: "ext", "rtc";
};
};

View File

@ -0,0 +1,122 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/ingenic,cgu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ingenic SoCs CGU devicetree bindings
description: |
The CGU in an Ingenic SoC provides all the clocks generated on-chip. It
typically includes a variety of PLLs, multiplexers, dividers & gates in order
to provide many different clock signals derived from only 2 external source
clocks.
maintainers:
- Paul Cercueil <paul@crapouillou.net>
select:
properties:
compatible:
contains:
enum:
- ingenic,jz4740-cgu
- ingenic,jz4725b-cgu
- ingenic,jz4770-cgu
- ingenic,jz4780-cgu
- ingenic,x1000-cgu
required:
- compatible
properties:
$nodename:
pattern: "^clock-controller@[0-9a-f]+$"
"#address-cells":
const: 1
"#size-cells":
const: 1
"#clock-cells":
const: 1
ranges: true
compatible:
items:
- enum:
- ingenic,jz4740-cgu
- ingenic,jz4725b-cgu
- ingenic,jz4770-cgu
- ingenic,jz4780-cgu
- ingenic,x1000-cgu
- const: simple-mfd
minItems: 1
reg:
maxItems: 1
clocks:
items:
- description: External oscillator clock
- description: Internal 32 kHz RTC clock
clock-names:
items:
- const: ext
- enum:
- rtc
- osc32k # Different name, same clock
assigned-clocks:
minItems: 1
maxItems: 64
assigned-clock-parents:
minItems: 1
maxItems: 64
assigned-clock-rates:
minItems: 1
maxItems: 64
required:
- "#clock-cells"
- compatible
- reg
- clocks
- clock-names
patternProperties:
"^usb-phy@[a-f0-9]+$":
allOf: [ $ref: "../usb/ingenic,jz4770-phy.yaml#" ]
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/jz4770-cgu.h>
cgu: clock-controller@10000000 {
compatible = "ingenic,jz4770-cgu", "simple-mfd";
reg = <0x10000000 0x100>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x10000000 0x100>;
clocks = <&ext>, <&osc32k>;
clock-names = "ext", "osc32k";
#clock-cells = <1>;
otg_phy: usb-phy@3c {
compatible = "ingenic,jz4770-phy";
reg = <0x3c 0x10>;
clocks = <&cgu JZ4770_CLK_OTG_PHY>;
vcc-supply = <&ldo5>;
#phy-cells = <0>;
};
};