Commit 7d39f32c authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Herbert Xu
Browse files

dt-bindings: crypto: Convert Marvell CESA to DT schema



Convert the Marvell CESA binding to DT schema format. The
marvell-cesa.txt and mv_cesa.txt are duplicate bindings.

The clock properties are quite varied for each platform hence the
if/then schemas. The old binding was fairly accurate with reality.

The original binding didn't mention there is 1 interrupt per CESA
engine. Based on users, there's a maximum of 2 engines.

Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 7eff621c
Loading
Loading
Loading
Loading
+133 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/crypto/marvell,orion-crypto.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Marvell Cryptographic Engines And Security Accelerator

maintainers:
  - Andrew Lunn <andrew@lunn.ch>
  - Boris Brezillon <bbrezillon@kernel.org>

description: |
  Marvell Cryptographic Engines And Security Accelerator

properties:
  compatible:
    enum:
      - marvell,armada-370-crypto
      - marvell,armada-xp-crypto
      - marvell,armada-375-crypto
      - marvell,armada-38x-crypto
      - marvell,dove-crypto
      - marvell,kirkwood-crypto
      - marvell,orion-crypto

  reg:
    minItems: 1
    items:
      - description: Registers region
      - description: SRAM region
        deprecated: true

  reg-names:
    minItems: 1
    items:
      - const: regs
      - const: sram
        deprecated: true

  interrupts:
    description: One interrupt for each CESA engine
    minItems: 1
    maxItems: 2

  clocks:
    description: One or two clocks for each CESA engine
    minItems: 1
    maxItems: 4

  clock-names:
    minItems: 1
    items:
      - const: cesa0
      - const: cesa1
      - const: cesaz0
      - const: cesaz1

  marvell,crypto-srams:
    description: Phandle(s) to crypto SRAM.
    $ref: /schemas/types.yaml#/definitions/phandle-array
    minItems: 1
    maxItems: 2
    items:
      maxItems: 1

  marvell,crypto-sram-size:
    description: SRAM size reserved for crypto operations.
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0x800

required:
  - compatible
  - reg
  - reg-names
  - interrupts
  - marvell,crypto-srams

allOf:
  - if:
      not:
        properties:
          compatible:
            enum:
              - marvell,kirkwood-crypto
              - marvell,orion-crypto
    then:
      required:
        - clocks
  - if:
      properties:
        compatible:
          contains:
            enum:
              - marvell,armada-370-crypto
              - marvell,armada-375-crypto
              - marvell,armada-38x-crypto
              - marvell,armada-xp-crypto
    then:
      required:
        - clock-names
  - if:
      properties:
        compatible:
          contains:
            enum:
              - marvell,armada-375-crypto
              - marvell,armada-38x-crypto
    then:
      properties:
        clocks:
          minItems: 4
        clock-names:
          minItems: 4
    else:
      properties:
        clocks:
          maxItems: 2
        clock-names:
          maxItems: 2

additionalProperties: false

examples:
  - |
    crypto@30000 {
        compatible = "marvell,orion-crypto";
        reg = <0x30000 0x10000>;
        reg-names = "regs";
        interrupts = <22>;
        marvell,crypto-srams = <&crypto_sram>;
        marvell,crypto-sram-size = <0x600>;
    };
+0 −44
Original line number Diff line number Diff line
Marvell Cryptographic Engines And Security Accelerator

Required properties:
- compatible: should be one of the following string
	      "marvell,orion-crypto"
	      "marvell,kirkwood-crypto"
	      "marvell,dove-crypto"
	      "marvell,armada-370-crypto"
	      "marvell,armada-xp-crypto"
	      "marvell,armada-375-crypto"
	      "marvell,armada-38x-crypto"
- reg: base physical address of the engine and length of memory mapped
       region. Can also contain an entry for the SRAM attached to the CESA,
       but this representation is deprecated and marvell,crypto-srams should
       be used instead
- reg-names: "regs". Can contain an "sram" entry, but this representation
	     is deprecated and marvell,crypto-srams should be used instead
- interrupts: interrupt number
- clocks: reference to the crypto engines clocks. This property is not
	  required for orion and kirkwood platforms
- clock-names: "cesaX" and "cesazX", X should be replaced by the crypto engine
	       id.
	       This property is not required for the orion and kirkwoord
	       platforms.
	       "cesazX" clocks are not required on armada-370 platforms
- marvell,crypto-srams: phandle to crypto SRAM definitions

Optional properties:
- marvell,crypto-sram-size: SRAM size reserved for crypto operations, if not
			    specified the whole SRAM is used (2KB)


Examples:

	crypto@90000 {
		compatible = "marvell,armada-xp-crypto";
		reg = <0x90000 0x10000>;
		reg-names = "regs";
		interrupts = <48>, <49>;
		clocks = <&gateclk 23>, <&gateclk 23>;
		clock-names = "cesa0", "cesa1";
		marvell,crypto-srams = <&crypto_sram0>, <&crypto_sram1>;
		marvell,crypto-sram-size = <0x600>;
	};
+0 −32
Original line number Diff line number Diff line
Marvell Cryptographic Engines And Security Accelerator

Required properties:
- compatible: should be one of the following string
	      "marvell,orion-crypto"
	      "marvell,kirkwood-crypto"
	      "marvell,dove-crypto"
- reg: base physical address of the engine and length of memory mapped
       region. Can also contain an entry for the SRAM attached to the CESA,
       but this representation is deprecated and marvell,crypto-srams should
       be used instead
- reg-names: "regs". Can contain an "sram" entry, but this representation
	     is deprecated and marvell,crypto-srams should be used instead
- interrupts: interrupt number
- clocks: reference to the crypto engines clocks. This property is only
	  required for Dove platforms
- marvell,crypto-srams: phandle to crypto SRAM definitions

Optional properties:
- marvell,crypto-sram-size: SRAM size reserved for crypto operations, if not
			    specified the whole SRAM is used (2KB)

Examples:

	crypto@30000 {
		compatible = "marvell,orion-crypto";
		reg = <0x30000 0x10000>;
		reg-names = "regs";
		interrupts = <22>;
		marvell,crypto-srams = <&crypto_sram>;
		marvell,crypto-sram-size = <0x600>;
	};