From patchwork Tue Oct 29 19:29:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13855338 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB397207217 for ; Tue, 29 Oct 2024 19:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730230166; cv=none; b=daZdFybZmnOf/IL6XgzSF3VBWxC9/zfMCkTyLiyiUbfpQaLCGn95hDM60vSDEUYk6YkaVm57Epi8B5HsDbIYu5x4wQ5nOm/Fvq22xFiDXIG6PV5y2glynSD6JhsTYyOTREeWpdiPjHdOtbXbut2Z/aW2+jZRuyDS+b5aQhPa6iw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730230166; c=relaxed/simple; bh=8EUqJovA7utVx8xu/0JUVUpmXzywcAPcFPLtYOmfMSY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cVpeJHmFDO2D7Bj6SnepY5hgsrl+0kUUqlBLNMMkY35gck6O+hvSeSUM8X5Vt1E0k2p6ot6Meae0BafsHJRnj15LL69JClC1QSlqwALqi2Ps7vLj9APQgSarhrNfxxakzVWKQVVZcaJhYtVQ84z5n0sLK9liRdlST1SDhYP+k1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=OT3aueSC; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="OT3aueSC" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5ec1ee251b8so96493eaf.1 for ; Tue, 29 Oct 2024 12:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730230163; x=1730834963; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=h0i0gDomS/2bQGSRG3crSVR1V8RdXXRlgTTIe9AsM+o=; b=OT3aueSCq1U+3gAJo4iag0fJQSG+WKhlYCmMU6fX2o6PFtcrknuVKwD2DrkNv3Kanh cDOr5tP5ohoxDX2EJXqmN3bOtbq6WKHsIfCFb7vDibVJv16TdBBAwr+imd4dNjOeb763 UR5ZwzVfZf0Vj7jPHGxCx1ARbmMBMx/u9CXSkaDZ9e8zomsX7sAoubwq3lpsuWvJ4Dqw /yfD1sigkVmWsFLcyrbElWoGHhk5UTd5WVeoJ4huR8jipf4AsqpulEGyTgMlMAQt/fh3 hMLOjiO7sSOuKFOnh20BlX86jaeft2uJcZkNx41/jsMqyBZXgIBsUnOTHxKKvjyD1AH+ +Jaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730230163; x=1730834963; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h0i0gDomS/2bQGSRG3crSVR1V8RdXXRlgTTIe9AsM+o=; b=Zqiu3TtWTnhzcbGjA7CtqujWEHIqTz5FjJBzgCVFayoddX2X8W2EHdbnEy4MfhqSe+ ORXnQKPzqABrYvdNYcSfPDKPl9WVNrCLCnm6qPyVOD0estjY1zNneeHmiS9dnQgHzKOu WQXzVhbjWMChksP/xq5iz7nCSwvT6ajZ+GpRvz9XbdNYv8P0Ba4cQKhBz2wX5opntmyw kCsCJq2qKwZzBgUhQJ/6YQINusIee5IkAA95xWAUUMW9Uh29NtPBLl+MTusbQSDBabNl kaA16b3J/x/eEWW7K8JYESAX2lmsnG2KIuVPZ4sbCb89LRSyTN3S8Kg7U23dJHnAwCuN qW2g== X-Forwarded-Encrypted: i=1; AJvYcCXqKZDAGZwyXAMLhznL1ifBnjW6eQ/C81vvSJNLXq3vnO4JtSmTmuZBoWRDkpQH+Pm1AyMg2hZFM4c=@vger.kernel.org X-Gm-Message-State: AOJu0YwXAbLS9zUfhD/T4eRZoEYwc2o9gyL9mt0n3bMXo0dW+mmaMas/ tyxpBLow243DEjCvgatx9XlkcOiYFV0OdK0D//NGj0wI410Qxs0btYFddtwSqhI= X-Google-Smtp-Source: AGHT+IHn7p2YwZ0/eIPpHhCrsdCewUER/sa1NujFZfvrkvuya5I9+xUtxxuPx6Z0EBL7Gh9JqQDxFg== X-Received: by 2002:a05:6820:220b:b0:5e1:c6ae:d93 with SMTP id 006d021491bc7-5ec54da4da0mr2127519eaf.2.1730230162692; Tue, 29 Oct 2024 12:29:22 -0700 (PDT) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5ec18598e79sm2452495eaf.14.2024.10.29.12.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 12:29:21 -0700 (PDT) From: David Lechner Date: Tue, 29 Oct 2024 14:29:14 -0500 Subject: [PATCH v2 1/2] dt-bindings: dma: adi,axi-dmac: convert to yaml schema Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241029-axi-dma-dt-yaml-v2-1-52a6ec7df251@baylibre.com> References: <20241029-axi-dma-dt-yaml-v2-0-52a6ec7df251@baylibre.com> In-Reply-To: <20241029-axi-dma-dt-yaml-v2-0-52a6ec7df251@baylibre.com> To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nuno Sa Cc: Lars-Peter Clausen , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, David Lechner X-Mailer: b4 0.14.1 Convert the AXI DMAC bindings from .txt to .yaml. Acked-by: Nuno Sa Signed-off-by: David Lechner Reviewed-by: Rob Herring (Arm) --- For the maintainer, Lars is the original author, but isn't really active with ADI anymore, so I have added Nuno instead since he is the most active ADI representative currently and is knowledgeable about this hardware. As in v1, the rob-bot is likely to complain with the following: Documentation/devicetree/bindings/dma/adi,axi-dmac.yaml: properties:adi,channels:type: 'boolean' was expected hint: A vendor boolean property can use "type: boolean" from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# DTC [C] Documentation/devicetree/bindings/dma/adi,axi-dmac.example.dtb This is due to the fact that we have a vendor prefix on an object node. We can't change that since it is an existing binding. Rob said he will fix this in dtschema. --- .../devicetree/bindings/dma/adi,axi-dmac.txt | 61 --------- .../devicetree/bindings/dma/adi,axi-dmac.yaml | 139 +++++++++++++++++++++ 2 files changed, 139 insertions(+), 61 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/adi,axi-dmac.txt b/Documentation/devicetree/bindings/dma/adi,axi-dmac.txt deleted file mode 100644 index cd17684aaab5..000000000000 --- a/Documentation/devicetree/bindings/dma/adi,axi-dmac.txt +++ /dev/null @@ -1,61 +0,0 @@ -Analog Devices AXI-DMAC DMA controller - -Required properties: - - compatible: Must be "adi,axi-dmac-1.00.a". - - reg: Specification for the controllers memory mapped register map. - - interrupts: Specification for the controllers interrupt. - - clocks: Phandle and specifier to the controllers AXI interface clock - - #dma-cells: Must be 1. - -Required sub-nodes: - - adi,channels: This sub-node must contain a sub-node for each DMA channel. For - the channel sub-nodes the following bindings apply. They must match the - configuration options of the peripheral as it was instantiated. - -Required properties for adi,channels sub-node: - - #size-cells: Must be 0 - - #address-cells: Must be 1 - -Required channel sub-node properties: - - reg: Which channel this node refers to. - - adi,source-bus-width, - adi,destination-bus-width: Width of the source or destination bus in bits. - - adi,source-bus-type, - adi,destination-bus-type: Type of the source or destination bus. Must be one - of the following: - 0 (AXI_DMAC_TYPE_AXI_MM): Memory mapped AXI interface - 1 (AXI_DMAC_TYPE_AXI_STREAM): Streaming AXI interface - 2 (AXI_DMAC_TYPE_AXI_FIFO): FIFO interface - -Deprecated optional channel properties: - - adi,length-width: Width of the DMA transfer length register. - - adi,cyclic: Must be set if the channel supports hardware cyclic DMA - transfers. - - adi,2d: Must be set if the channel supports hardware 2D DMA transfers. - -DMA clients connected to the AXI-DMAC DMA controller must use the format -described in the dma.txt file using a one-cell specifier. The value of the -specifier refers to the DMA channel index. - -Example: - -dma: dma@7c420000 { - compatible = "adi,axi-dmac-1.00.a"; - reg = <0x7c420000 0x10000>; - interrupts = <0 57 0>; - clocks = <&clkc 16>; - #dma-cells = <1>; - - adi,channels { - #size-cells = <0>; - #address-cells = <1>; - - dma-channel@0 { - reg = <0>; - adi,source-bus-width = <32>; - adi,source-bus-type = ; - adi,destination-bus-width = <64>; - adi,destination-bus-type = ; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/dma/adi,axi-dmac.yaml b/Documentation/devicetree/bindings/dma/adi,axi-dmac.yaml new file mode 100644 index 000000000000..b1f4bdcab4fd --- /dev/null +++ b/Documentation/devicetree/bindings/dma/adi,axi-dmac.yaml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/adi,axi-dmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AXI-DMAC DMA controller + +description: | + FPGA-based DMA controller designed for use with high-speed converter hardware. + + http://analogdevicesinc.github.io/hdl/library/axi_dmac/index.html + +maintainers: + - Nuno Sa + +additionalProperties: false + +properties: + compatible: + const: adi,axi-dmac-1.00.a + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + "#dma-cells": + const: 1 + + adi,channels: + type: object + description: This sub-node must contain a sub-node for each DMA channel. + additionalProperties: false + + properties: + "#size-cells": + const: 0 + "#address-cells": + const: 1 + + patternProperties: + "^dma-channel@[0-9a-f]+$": + type: object + description: + DMA channel properties based on HDL compile-time configuration. + additionalProperties: false + + properties: + reg: + maxItems: 1 + + adi,source-bus-width: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Width of the source bus in bits. + enum: [8, 16, 32, 64, 128] + + adi,destination-bus-width: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Width of the destination bus in bits. + enum: [8, 16, 32, 64, 128] + + adi,source-bus-type: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Type of the source bus. + + 0: Memory mapped AXI interface + 1: Streaming AXI interface + 2: FIFO interface + enum: [0, 1, 2] + + adi,destination-bus-type: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Type of the destination bus (see adi,source-bus-type). + enum: [0, 1, 2] + + adi,length-width: + deprecated: true + $ref: /schemas/types.yaml#/definitions/uint32 + description: Width of the DMA transfer length register. + + adi,cyclic: + deprecated: true + type: boolean + description: + Must be set if the channel supports hardware cyclic DMA transfers. + + adi,2d: + deprecated: true + type: boolean + description: + Must be set if the channel supports hardware 2D DMA transfers. + + required: + - reg + - adi,source-bus-width + - adi,destination-bus-width + - adi,source-bus-type + - adi,destination-bus-type + + required: + - "#size-cells" + - "#address-cells" + +required: + - compatible + - reg + - interrupts + - clocks + - "#dma-cells" + - adi,channels + +examples: + - | + dma-controller@7c420000 { + compatible = "adi,axi-dmac-1.00.a"; + reg = <0x7c420000 0x10000>; + interrupts = <0 57 0>; + clocks = <&clkc 16>; + #dma-cells = <1>; + + adi,channels { + #size-cells = <0>; + #address-cells = <1>; + + dma-channel@0 { + reg = <0>; + adi,source-bus-width = <32>; + adi,source-bus-type = <0>; /* Memory mapped */ + adi,destination-bus-width = <64>; + adi,destination-bus-type = <2>; /* FIFO */ + }; + }; + };