From patchwork Fri Sep 11 14:14:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 53471 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id ACB9A22B26 for ; Fri, 11 Sep 2015 14:15:02 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf19104792wic.3 for ; Fri, 11 Sep 2015 07:15:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=LDSaZ16PAkRi8bSz//dkJIMYZ3453NRf9XdDSnNHTBM=; b=fpNtKSOasljB4APGVQxXjIubL46yX47hyx5bFtxuTtknZRYRzIAh2LK4KLSt4EqLq9 /6Y9+eO2y1NyCbmHfKhO4bu4J33PFkgDSjoZQiGOVtLt0QSEI9wX60Orf9eHmh5/v1Gl lR3kFH1xtRTa1Vync1s+b/IwWUukP08Dxb58FnaA/kwvRZlCNVwM/v4OT9t20SQA/bYE a985zh/26Srw/vwk24xrmlvAk/oYAtzmXC8lwui0evJUVKk0QFYT4gTj2x0isrdfILq3 aV5uxNvZVhjPCwPT2s8TAECrw9Oyn/ySDa7Ko0J/29cU+X0vsKglfpSn9dNmlIqV5bMo UhBA== X-Gm-Message-State: ALoCoQkJCQDZtdZ09+XWb1+0IcLXmHrlHUsxuBy4/xJRugCRY+1Bah+EN7eLEqSI5wZiiKixN9OJ X-Received: by 10.112.144.99 with SMTP id sl3mr11197213lbb.12.1441980901832; Fri, 11 Sep 2015 07:15:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.231 with SMTP id i7ls341148lae.1.gmail; Fri, 11 Sep 2015 07:15:01 -0700 (PDT) X-Received: by 10.112.168.7 with SMTP id zs7mr42500484lbb.26.1441980901627; Fri, 11 Sep 2015 07:15:01 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id i7si388367laf.17.2015.09.11.07.15.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 07:15:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lahg1 with SMTP id g1so18734580lah.1 for ; Fri, 11 Sep 2015 07:15:01 -0700 (PDT) X-Received: by 10.112.77.10 with SMTP id o10mr42212991lbw.73.1441980901463; Fri, 11 Sep 2015 07:15:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1626865lbq; Fri, 11 Sep 2015 07:15:00 -0700 (PDT) X-Received: by 10.66.120.75 with SMTP id la11mr86793089pab.14.1441980900382; Fri, 11 Sep 2015 07:15:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id na3si777104pbc.99.2015.09.11.07.14.54; Fri, 11 Sep 2015 07:15:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753053AbbIKOOn (ORCPT + 28 others); Fri, 11 Sep 2015 10:14:43 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:33236 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbbIKOOk (ORCPT ); Fri, 11 Sep 2015 10:14:40 -0400 Received: by wiclk2 with SMTP id lk2so66168004wic.0 for ; Fri, 11 Sep 2015 07:14:39 -0700 (PDT) X-Received: by 10.194.103.228 with SMTP id fz4mr56880540wjb.53.1441980879390; Fri, 11 Sep 2015 07:14:39 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by smtp.gmail.com with ESMTPSA id i6sm577236wje.33.2015.09.11.07.14.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Sep 2015 07:14:38 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, srinivas.kandagatla@gmail.com, maxime.coquelin@st.com, patrice.chotard@st.com, vinod.koul@intel.com Cc: peter.griffin@linaro.org, lee.jones@linaro.org, robh+dt@kernel.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, Ludovic Barre Subject: [PATCH v2 2/9] dmaengine: st_fdma: Add st fdma platform specific header Date: Fri, 11 Sep 2015 15:14:24 +0100 Message-Id: <1441980871-24475-3-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441980871-24475-1-git-send-email-peter.griffin@linaro.org> References: <1441980871-24475-1-git-send-email-peter.griffin@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.griffin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Ludovic Barre Signed-off-by: Peter Griffin --- include/linux/platform_data/dma-st_fdma.h | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 include/linux/platform_data/dma-st_fdma.h diff --git a/include/linux/platform_data/dma-st_fdma.h b/include/linux/platform_data/dma-st_fdma.h new file mode 100644 index 0000000..ea2523b --- /dev/null +++ b/include/linux/platform_data/dma-st_fdma.h @@ -0,0 +1,72 @@ +/* + * dma-st-fdma.h + * + * Copyright (C) 2014 STMicroelectronics + * Author: Ludovic Barre + * License terms: GNU General Public License (GPL), version 2 + */ +#ifndef __PLAT_ST_FDMA_H +#define __PLAT_ST_FDMA_H + +#include + +/* + * Channel type + */ +enum st_fdma_type { + ST_FDMA_TYPE_FREE_RUN, + ST_FDMA_TYPE_PACED, +}; + +struct st_fdma_cfg { + struct device_node *of_node; + enum st_fdma_type type; + dma_addr_t dev_addr; + enum dma_transfer_direction dir; + int req_line; /* request line */ + u32 req_ctrl; /* Request control */ +}; + +#define FW_NAME_SIZE 30 + +/** + * struct st_fdma_platform_data - platform specific data for FDMA engine + * + * @nr_channels: Number of channels supported by hardware + * @fw_name: The firmware name + */ +struct st_fdma_platform_data { + u32 nr_channels; + u32 id; + char fw_name[FW_NAME_SIZE]; +}; + +/* + * request control bits + */ +#define REQ_CTRL_NUM_OPS_MASK GENMASK(31, 24) +#define REQ_CTRL_NUM_OPS(n) (REQ_CTRL_NUM_OPS_MASK & ((n) << 24)) +#define REQ_CTRL_INITIATOR_MASK BIT(22) +#define REQ_CTRL_INIT0 (0x0 << 22) +#define REQ_CTRL_INIT1 (0x1 << 22) +#define REQ_CTRL_INC_ADDR_ON BIT(21) +#define REQ_CTRL_DATA_SWAP_ON BIT(17) +#define REQ_CTRL_WNR BIT(14) +#define REQ_CTRL_OPCODE_MASK GENMASK(7, 4) +#define REQ_CTRL_OPCODE_LD_ST1 (0x0 << 4) +#define REQ_CTRL_OPCODE_LD_ST2 (0x1 << 4) +#define REQ_CTRL_OPCODE_LD_ST4 (0x2 << 4) +#define REQ_CTRL_OPCODE_LD_ST8 (0x3 << 4) +#define REQ_CTRL_OPCODE_LD_ST16 (0x4 << 4) +#define REQ_CTRL_OPCODE_LD_ST32 (0x5 << 4) +#define REQ_CTRL_OPCODE_LD_ST64 (0x6 << 4) +#define REQ_CTRL_HOLDOFF_MASK GENMASK(2, 0) +#define REQ_CTRL_HOLDOFF(n) ((n) & REQ_CTRL_HOLDOFF_MASK) + +/* bits used by client to configure request control */ +#define REQ_CTRL_CFG_MASK (REQ_CTRL_HOLDOFF_MASK | REQ_CTRL_DATA_SWAP_ON \ + | REQ_CTRL_INC_ADDR_ON | REQ_CTRL_INITIATOR_MASK) + +bool st_fdma_filter_fn(struct dma_chan *chan, void *param); + +#endif /* __PLAT_ST_FDMA_H */