From patchwork Sun Nov 4 17:01:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 992759 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OU7pYMnh"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42p2CX4HN6zB6MX for ; Mon, 5 Nov 2018 04:01:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729037AbeKECRU (ORCPT ); Sun, 4 Nov 2018 21:17:20 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41609 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728899AbeKECRU (ORCPT ); Sun, 4 Nov 2018 21:17:20 -0500 Received: by mail-wr1-f67.google.com with SMTP id x12-v6so6873643wrw.8; Sun, 04 Nov 2018 09:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7BhPzUWn1MaIgK31+5J7Ua1Lzr2Bs715vEAvl1+RoEU=; b=OU7pYMnhet1N4SzX3QofVtMeN1OkzDx+h9yCVvdCbaV3vpTj044twFP5x/N6mWnpwt wXAu/UwwIVx00XsDaZZmxN9/WSTVnFdnRnJE/VEv8keY7bJ2i3Xou/9HzEnlEdrMzKrV IMbc/jXntPdsLp7it/DA3gRZg4LZLJZfTFdDlJsMl4I/0j3LhlFPhRHgSsh10LOJlxKI 0VkBBhZQdfm/jumT8H6d+WMoRsKCpnJMmo+Xn55vCR8wNfeTElX/zS+0tvQYUV9EgVOH Ph4JHZTSMDiJU2g9Uz0+H9Uyu+mWiPycwig87pDnovZVD//TwA/AOd+bcIkE99TPNi0q sMHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7BhPzUWn1MaIgK31+5J7Ua1Lzr2Bs715vEAvl1+RoEU=; b=PMcnpUpgSfK7vCQHmNyaaiTPKgSUzTIepHHlOcu4CitXmu+OgEDWoSzLYJ0Q5BREG+ LpivHs8WTB4M0jRgPoFUzTL3vJRwb+SFjPcPFeduAc5ZSKCE+pa7e6300/X/pP2IhbFa C2jgtBEtNm3m3ooCGavHPjd4ROkdrLNT0JuHjwblLeMINMQNk0hTPopfvkaNsEWN78fu 5V3gm9xe1+kMfmozlbOIOKZdn0DCtBkQ5cQzuheWb6BnADa5am4MzLcOcOCCWzb02Tue UmEN9wuNHjVQVlDgpo9vJ85lGto6kUTFtzqoxrexXJBz8AQEuqQ4jKG65FOauWt+bQez x4JQ== X-Gm-Message-State: AGRZ1gIuEiSXGgpDFFznseMJEs5itz9D9pO41oAaA/X3RfnlGVGfBzoi cfFcChjd/B+TJDxTGqQ7or9CjuiL0uQ= X-Google-Smtp-Source: AJdET5e6ZZANDX1X5FXC59z0HEU9YtraZEKgNJkMe+6IjFo+1BniV8xZI7ab9dmL54gPzqzqxcAQbA== X-Received: by 2002:a5d:4807:: with SMTP id l7-v6mr16464284wrq.46.1541350901044; Sun, 04 Nov 2018 09:01:41 -0800 (PST) Received: from debian64.daheim (p5B0D79A7.dip0.t-ipconnect.de. [91.13.121.167]) by smtp.gmail.com with ESMTPSA id y76-v6sm30967871wmd.37.2018.11.04.09.01.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Nov 2018 09:01:40 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gJLmN-0004Pk-EJ; Sun, 04 Nov 2018 18:01:39 +0100 From: Christian Lamparter To: dmaengine@vger.kernel.org, devicetree@vger.kernel.org Cc: Dan Williams , Vinod Koul , Andy Shevchenko , Viresh Kumar , Rob Herring , Mark Rutland Subject: [PATCH v1 1/2] dt-bindings: dmaengine: dw-dmac: add protection control property Date: Sun, 4 Nov 2018 18:01:38 +0100 Message-Id: <6b18bcf33d6473c166b607a5fa31ba63727cf6bb.1541350844.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds the per-channel dma protection control prop-encoded-array and dt-binding definitions (including definitions for the existing channel allocation and priority order values based on include/linux/platform_data/dma-dw.h) for the DesignWare AHB Central Direct Memory Access Controller. Note: The protection control signals are one-to-one mapped to the AHB HPROT[1:3] signals. The HPROT0 (Data Access) is always hardwired to 1 for this controller. Signed-off-by: Christian Lamparter Reviewed-by: Andy Shevchenko --- .../devicetree/bindings/dma/snps-dma.txt | 4 ++++ MAINTAINERS | 4 +++- include/dt-bindings/dma/dw-dmac.h | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/dma/dw-dmac.h diff --git a/Documentation/devicetree/bindings/dma/snps-dma.txt b/Documentation/devicetree/bindings/dma/snps-dma.txt index 39e2b26be344..72b4984a4c18 100644 --- a/Documentation/devicetree/bindings/dma/snps-dma.txt +++ b/Documentation/devicetree/bindings/dma/snps-dma.txt @@ -27,6 +27,10 @@ Optional properties: general purpose DMA channel allocator. False if not passed. - multi-block: Multi block transfers supported by hardware. Array property with one cell per channel. 0: not supported, 1 (default): supported. +- snps,dma-protection-control: Channel's AHB HPROT[3:1] protection setting. + Array property with one cell per channel. The default value for a channel + is 0 (for non-cacheable, strongly ordered, unprivileged data access). + Refer to include/dt-bindings/dma/dw-dmac.h for possible values. Example: diff --git a/MAINTAINERS b/MAINTAINERS index dacba23b80b4..c35998e20e9d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14107,9 +14107,11 @@ SYNOPSYS DESIGNWARE DMAC DRIVER M: Viresh Kumar R: Andy Shevchenko S: Maintained +F: Documentation/devicetree/bindings/dma/snps-dma.txt +F: drivers/dma/dw/ +F: include/dt-bindings/dma/dw-dmac.h F: include/linux/dma/dw.h F: include/linux/platform_data/dma-dw.h -F: drivers/dma/dw/ SYNOPSYS DESIGNWARE ENTERPRISE ETHERNET DRIVER M: Jose Abreu diff --git a/include/dt-bindings/dma/dw-dmac.h b/include/dt-bindings/dma/dw-dmac.h new file mode 100644 index 000000000000..9152a6e2406c --- /dev/null +++ b/include/dt-bindings/dma/dw-dmac.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ + +#ifndef __DT_BINDINGS_DMA_DW_DMAC_H__ +#define __DT_BINDINGS_DMA_DW_DMAC_H__ + +#define DW_DMAC_CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */ +#define DW_DMAC_CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */ +#define DW_DMAC_CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */ +#define DW_DMAC_CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */ + +/* + * Protection Control bits provide protection against illegal transactions. + * The protection bits[0:2] are one-to-one mapped to AHB HPROT[3:1] signals. + * The AHB HPROT[0] bit is hardwired to 1: Data Access. + */ +#define DW_DMAC_HPROT1_PRIVILEGED_MODE (1 << 0) /* Privileged Mode */ +#define DW_DMAC_HPROT2_BUFFERABLE (1 << 1) /* DMA is bufferable */ +#define DW_DMAC_HPROT3_CACHEABLE (1 << 2) /* DMA is cacheable */ + +#endif /* __DT_BINDINGS_DMA_DW_DMAC_H__ */