Add Devicetree bindings for the Timestamp Counter Subsystem (TSCSS) found on Qualcomm Nord and Shikra SoCs. TSCSS is a time synchronization subsystem composed of two main blocks: Timestamp Counter (TSC) and Event Timestamp Unit (ETU). The TSC block provides a continuously running counter used for timekeeping, while the ETU captures timestamps for external hardware event triggers. Nord additionally has a timer register region used to generate a periodic pulse in sync with the TSC counter. Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Imran Shaik --- .../devicetree/bindings/ptp/qcom,nord-tscss.yaml | 186 +++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/Documentation/devicetree/bindings/ptp/qcom,nord-tscss.yaml b/Documentation/devicetree/bindings/ptp/qcom,nord-tscss.yaml new file mode 100644 index 000000000000..9d49e66a35c9 --- /dev/null +++ b/Documentation/devicetree/bindings/ptp/qcom,nord-tscss.yaml @@ -0,0 +1,186 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/ptp/qcom,nord-tscss.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Timestamp Counter Subsystem (TSCSS) on Qualcomm Nord and Shikra + +maintainers: + - Imran Shaik + - Taniya Das + +description: | + Qualcomm TSCSS is a time synchronization subsystem composed of two main + blocks - the Timestamp Counter (TSC) and the Event Timestamp Unit (ETU). + + The TSC block is a timestamp generator that maintains a running counter used + for system timekeeping, and is functional with just the AHB and counter + clocks. + The ETU block captures TSC timestamps for external hardware events. Each + ETU slice binds a slice number to an external event selector, and a + single summary interrupt is raised for any ETU slice event. + + Nord additionally has a timer register region used to generate a + periodic pulse in sync with the TSC counter. + +properties: + compatible: + oneOf: + - const: qcom,nord-tscss + - items: + - const: qcom,shikra-tscss + - const: qcom,nord-tscss + + reg: + minItems: 1 + maxItems: 3 + + reg-names: + minItems: 1 + items: + - const: tsc + - const: etu + - const: timer + + clocks: + items: + - description: TSC AHB configuration clock. + - description: TSC global counter clock. + - description: TSC ETU clock. + + clock-names: + items: + - const: ahb + - const: cntr + - const: etu + + interrupts: + items: + - description: + Summary interrupt raised based on an external event for any + of the ETU slices. + + interrupt-names: + items: + - const: etu_summary + + pinctrl-names: + minItems: 1 + maxItems: 32 + items: + pattern: "^slice[0-9]+$" + + qcom,etu-slice: + description: + ETU slice number for each entry in pinctrl-, pinctrl-names and + qcom,etu-event-sel. + minItems: 1 + maxItems: 32 + $ref: /schemas/types.yaml#/definitions/uint32-array + + qcom,etu-event-sel: + description: + External event selection value for each ETU slice listed in + qcom,etu-slice. + minItems: 1 + maxItems: 32 + $ref: /schemas/types.yaml#/definitions/uint32-array + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + +allOf: + - if: + properties: + reg-names: + contains: + const: etu + then: + required: + - interrupts + - interrupt-names + - pinctrl-names + - qcom,etu-slice + - qcom,etu-event-sel + + - if: + properties: + compatible: + contains: + const: qcom,shikra-tscss + then: + properties: + reg-names: + minItems: 1 + items: + - const: tsc + - const: etu + pinctrl-names: + maxItems: 8 + qcom,etu-slice: + maxItems: 8 + qcom,etu-event-sel: + maxItems: 8 + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + ptp@1c80000 { + compatible = "qcom,nord-tscss"; + reg = <0x0 0x01c80000 0x0 0x2000>; + reg-names = "tsc"; + + clocks = <&gcc_tscss_ahb_clk>, + <&gcc_tscss_cntr_clk>, + <&gcc_tscss_etu_clk>; + clock-names = "ahb", "cntr", "etu"; + + assigned-clocks = <&gcc_tscss_cntr_clk>; + assigned-clock-rates = <250000000>; + }; + }; + + - | + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + + ptp@1c80000 { + compatible = "qcom,nord-tscss"; + reg = <0x0 0x01c80000 0x0 0x2000>, + <0x0 0x01ca0000 0x0 0x20000>, + <0x0 0x01c87000 0x0 0x1000>; + reg-names = "tsc", "etu", "timer"; + + clocks = <&gcc_tscss_ahb_clk>, + <&gcc_tscss_cntr_clk>, + <&gcc_tscss_etu_clk>; + clock-names = "ahb", "cntr", "etu"; + + assigned-clocks = <&gcc_tscss_cntr_clk>; + assigned-clock-rates = <250000000>; + + interrupts = ; + interrupt-names = "etu_summary"; + + pinctrl-0 = <&cci_timer0>; + pinctrl-1 = <&cci_timer1>; + pinctrl-names = "slice1", "slice2"; + + qcom,etu-slice = <1 2>; + qcom,etu-event-sel = <1 2>; + }; + }; +... -- 2.34.1