mbox series

[v2,00/15] dt-bindings: ufs: add common platform bindings + fixes

Message ID 20220222145854.358646-1-krzysztof.kozlowski@canonical.com
Headers show
Series dt-bindings: ufs: add common platform bindings + fixes | expand

Message

Krzysztof Kozlowski Feb. 22, 2022, 2:58 p.m. UTC
Hi,

Not tested on hardware, so please kindly test.
Bindings maintainers might need checking - taken from git log.

Changes since v1
================
1. Make freq-table as matrix of tuples (Nishanth).
2. New patches: convert all bindings and fix up DTS files.
3. Several minor fixes in UFS bindings.

Dependencies
============
1. The DTS patches (10-15) depend on scsi/ufs driver change (patch 9), so
   they should go in a following release, after merging driver.

   This is also might affect out-of-tree users of these DTSes (other
   projects, e.g. U-boot).

Best regards,
Krzysztof

Krzysztof Kozlowski (15):
  dt-bindings: ufs: add common platform bindings
  dt-bindings: ufs: samsung,exynos-ufs: use common bindings
  dt-bindings: ufs: cdns,ufshc: convert to dtschema
  dt-bindings: ufs: drop unused/old ufs-qcom PHY bindings
  dt-bindings: ufs: qcom,ufs: convert to dtschema
  dt-bindings: ufs: hisilicon,ufs: convert to dtschema
  dt-bindings: ufs: mediatek,ufs: convert to dtschema
  dt-bindings: ufs: snps,tc-dwc-g210: convert to dtschema
  scsi: ufs: deprecate 'freq-table-hz' property
  arm64: dts: hi3670: use 'freq-table' in UFS node
  arm64: dts: ti: use 'freq-table' in UFS node
  arm64: dts: qcom: use 'freq-table' in UFS node
  arm64: dts: qcom: msm8996: drop unsupported UFS
    vddp-ref-clk-max-microamp
  arm64: dts: qcom: msm8996: correct UFS compatible
  arm64: dts: qcom: sm8350: drop duplicated ref_clk in UFS

 .../devicetree/bindings/ufs/cdns,ufshc.txt    |  32 ---
 .../devicetree/bindings/ufs/cdns,ufshc.yaml   |  68 +++++
 .../bindings/ufs/hisilicon,ufs.yaml           |  90 +++++++
 .../devicetree/bindings/ufs/mediatek,ufs.yaml |  67 +++++
 .../devicetree/bindings/ufs/qcom,ufs.yaml     | 241 ++++++++++++++++++
 .../bindings/ufs/samsung,exynos-ufs.yaml      |  13 +-
 .../bindings/ufs/snps,tc-dwc-g210.yaml        |  51 ++++
 .../bindings/ufs/tc-dwc-g210-pltfrm.txt       |  26 --
 .../devicetree/bindings/ufs/ti,j721e-ufs.yaml |   9 +-
 .../devicetree/bindings/ufs/ufs-common.yaml   |  88 +++++++
 .../devicetree/bindings/ufs/ufs-hisi.txt      |  42 ---
 .../devicetree/bindings/ufs/ufs-mediatek.txt  |  45 ----
 .../devicetree/bindings/ufs/ufs-qcom.txt      |  63 -----
 .../devicetree/bindings/ufs/ufshcd-pltfrm.txt |  90 -------
 MAINTAINERS                                   |   1 +
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi     |   4 +-
 .../boot/dts/qcom/msm8996-xiaomi-common.dtsi  |   1 -
 arch/arm64/boot/dts/qcom/msm8996.dtsi         |   5 +-
 arch/arm64/boot/dts/qcom/msm8998.dtsi         |   2 +-
 arch/arm64/boot/dts/qcom/sdm845.dtsi          |   2 +-
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |   2 +-
 arch/arm64/boot/dts/qcom/sm8250.dtsi          |   2 +-
 arch/arm64/boot/dts/qcom/sm8350.dtsi          |   5 +-
 arch/arm64/boot/dts/qcom/sm8450.dtsi          |   2 +-
 arch/arm64/boot/dts/ti/k3-j721e-main.dtsi     |   4 +-
 drivers/scsi/ufs/ufshcd-pltfrm.c              |  21 +-
 26 files changed, 641 insertions(+), 335 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
 create mode 100644 Documentation/devicetree/bindings/ufs/hisilicon,ufs.yaml
 create mode 100644 Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
 create mode 100644 Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
 create mode 100644 Documentation/devicetree/bindings/ufs/snps,tc-dwc-g210.yaml
 delete mode 100644 Documentation/devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/ufs-common.yaml
 delete mode 100644 Documentation/devicetree/bindings/ufs/ufs-hisi.txt
 delete mode 100644 Documentation/devicetree/bindings/ufs/ufs-mediatek.txt
 delete mode 100644 Documentation/devicetree/bindings/ufs/ufs-qcom.txt
 delete mode 100644 Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt

Comments

Rob Herring (Arm) Feb. 25, 2022, 7:26 p.m. UTC | #1
On Tue, Feb 22, 2022 at 03:58:40PM +0100, Krzysztof Kozlowski wrote:
> Add bindings for common parts (platform) of Universal Flash Storage
> (UFS) Host Controllers in dtschema format.
> 
> The 'freq-table-hz' is not correct in dtschema, because '-hz' suffix
> defines uint32 type, not an array.  Therefore deprecate 'freq-table-hz'
> and use 'freq-table' instead.

-hz is an array type. We can extend it to matrix if needed.

I do think this property is a bit questionable. Do we really need a 
minimum in DT and if not, wouldn't assigned-clocks-rate work? Or an OPP 
table.

> Include also the bindings directory in UFS maintainers entry.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../devicetree/bindings/ufs/ti,j721e-ufs.yaml |  2 +-
>  .../devicetree/bindings/ufs/ufs-common.yaml   | 88 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  3 files changed, 90 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/ufs/ufs-common.yaml
> 
> diff --git a/Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml b/Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml
> index 4d13e6bc1c50..dc93fe2d3458 100644
> --- a/Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml
> +++ b/Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml
> @@ -80,7 +80,7 @@ examples:
>                  compatible = "cdns,ufshc-m31-16nm", "jedec,ufs-2.0";
>                  reg = <0x0 0x4000 0x0 0x10000>;
>                  interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
> -                freq-table-hz = <19200000 19200000>;
> +                freq-table = <19200000 19200000>;
>                  power-domains = <&k3_pds 277>;
>                  clocks = <&k3_clks 277 1>;
>                  assigned-clocks = <&k3_clks 277 1>;
> diff --git a/Documentation/devicetree/bindings/ufs/ufs-common.yaml b/Documentation/devicetree/bindings/ufs/ufs-common.yaml
> new file mode 100644
> index 000000000000..85c73d2853e9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ufs/ufs-common.yaml
> @@ -0,0 +1,88 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ufs/ufs-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common properties for Universal Flash Storage (UFS) Host Controllers
> +
> +maintainers:
> +  - Alim Akhtar <alim.akhtar@samsung.com>
> +  - Avri Altman <avri.altman@wdc.com>
> +
> +properties:
> +  clocks: true
> +
> +  clock-names: true
> +
> +  freq-table-hz:
> +    deprecated: true
> +    description:
> +      Use freq-table.
> +
> +  freq-table:
> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +    items:
> +      items:
> +        - description: Minimum frequency for given clock
> +        - description: Maximum frequency for given clock
> +    description: |
> +      Array of <min max> operating frequencies in Hz stored in the same order
> +      as the clocks property. If this property is not defined or a value in the
> +      array is "0" then it is assumed that the frequency is set by the parent
> +      clock or a fixed rate clock source.
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  lanes-per-direction:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [1, 2]
> +    default: 2
> +    description:
> +      Number of lanes available per direction.  Note that it is assume same
> +      number of lanes is used both directions at once.
> +
> +  vdd-hba-supply:
> +    description:
> +      Phandle to UFS host controller supply regulator node.
> +
> +  vcc-supply:
> +    description:
> +      Phandle to VCC supply regulator node.
> +
> +  vccq-supply:
> +    description:
> +      Phandle to VCCQ supply regulator node.
> +
> +  vccq2-supply:
> +    description:
> +      Phandle to VCCQ2 supply regulator node.
> +
> +  vcc-supply-1p8:
> +    type: boolean
> +    description:
> +      For embedded UFS devices, valid VCC range is 1.7-1.95V or 2.7-3.6V. This
> +      boolean property when set, specifies to use low voltage range of
> +      1.7-1.95V. Note for external UFS cards this property is invalid and valid
> +      VCC range is always 2.7-3.6V.
> +
> +  vcc-max-microamp:
> +    description:
> +      Specifies max. load that can be drawn from VCC supply.
> +
> +  vccq-max-microamp:
> +    description:
> +      Specifies max. load that can be drawn from VCCQ supply.
> +
> +  vccq2-max-microamp:
> +    description:
> +      Specifies max. load that can be drawn from VCCQ2 supply.
> +
> +dependencies:
> +  freq-table: [ 'clocks' ]
> +
> +required:
> +  - interrupts
> +
> +additionalProperties: true
> diff --git a/MAINTAINERS b/MAINTAINERS
> index aa0f6cbb634e..c2cff57d32f8 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -20015,6 +20015,7 @@ R:	Alim Akhtar <alim.akhtar@samsung.com>
>  R:	Avri Altman <avri.altman@wdc.com>
>  L:	linux-scsi@vger.kernel.org
>  S:	Supported
> +F:	Documentation/devicetree/bindings/ufs/
>  F:	Documentation/scsi/ufs.rst
>  F:	drivers/scsi/ufs/
>  
> -- 
> 2.32.0
> 
>
Rob Herring (Arm) Feb. 25, 2022, 7:28 p.m. UTC | #2
On Tue, 22 Feb 2022 15:58:42 +0100, Krzysztof Kozlowski wrote:
> Convert the Cadence Universal Flash Storage (UFS) Controlle to DT schema
> format.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../devicetree/bindings/ufs/cdns,ufshc.txt    | 32 ---------
>  .../devicetree/bindings/ufs/cdns,ufshc.yaml   | 68 +++++++++++++++++++
>  .../devicetree/bindings/ufs/ti,j721e-ufs.yaml |  7 +-
>  3 files changed, 71 insertions(+), 36 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
>  create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Rob Herring (Arm) Feb. 25, 2022, 7:33 p.m. UTC | #3
On Tue, 22 Feb 2022 15:58:44 +0100, Krzysztof Kozlowski wrote:
> Convert the Qualcomm Universal Flash Storage (UFS) Controller to DT
> schema format.
> 
> Except the conversion, add also properties already present in DTS:
> iommus, interconnects and power-domains.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../devicetree/bindings/ufs/qcom,ufs.yaml     | 241 ++++++++++++++++++
>  .../devicetree/bindings/ufs/ufshcd-pltfrm.txt |  90 -------
>  2 files changed, 241 insertions(+), 90 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
>  delete mode 100644 Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Krzysztof Kozlowski Feb. 27, 2022, 10:24 a.m. UTC | #4
On 25/02/2022 20:26, Rob Herring wrote:
> On Tue, Feb 22, 2022 at 03:58:40PM +0100, Krzysztof Kozlowski wrote:
>> Add bindings for common parts (platform) of Universal Flash Storage
>> (UFS) Host Controllers in dtschema format.
>>
>> The 'freq-table-hz' is not correct in dtschema, because '-hz' suffix
>> defines uint32 type, not an array.  Therefore deprecate 'freq-table-hz'
>> and use 'freq-table' instead.
> 
> -hz is an array type. We can extend it to matrix if needed.
> 
> I do think this property is a bit questionable. Do we really need a 
> minimum in DT and if not, wouldn't assigned-clocks-rate work? Or an OPP 
> table.
> 

I think the proper solution is OPP table, see also comments from Bjorn:
https://lore.kernel.org/all/YhUodbzxx4wbr+gy@ripper/

I would rather refrain from converting it to OPP tables, because I won't
be able to test any changes in the driver.


Best regards,
Krzysztof