From patchwork Thu Oct 27 05:14:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sireesh Kodali X-Patchwork-Id: 619614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21FEAFA3740 for ; Thu, 27 Oct 2022 05:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234290AbiJ0FOx (ORCPT ); Thu, 27 Oct 2022 01:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234305AbiJ0FOr (ORCPT ); Thu, 27 Oct 2022 01:14:47 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D23C41CB0D; Wed, 26 Oct 2022 22:14:43 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id u8-20020a17090a5e4800b002106dcdd4a0so5195986pji.1; Wed, 26 Oct 2022 22:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2oMfxaXF7nRI4BLfRkUmZFlJUfBUODNFJS3becz/GPQ=; b=ZON6/JpoeO41g78FtnY6wu8/97zwQU3H41Ex8/Sk28ZEFSj0drFqzMy2meOlmlAW0c v6J496KoWJwEN6WYDR11wotmU6hAeTKOwwmhiOZRmi2lCEDMK9sz4O61D25ZrCraFCos cFPKTfs7tZUXqiJ9pJ4ddU4odhH921pkTe6TkbKjUCh8xQJpw2KQmSCaRXphz/bW04o/ m1+/AbfSUPHxfYGLpgFbwUzrdZKrF8ygsbj1u2111qx7yyDjOFbm1Khf9/F1E41K8pZO uyxqVgD+1UGNwQfnMnDkIv4ysc4pkvqeyMIzGDXCkbvqmbF8wnwFuIPeksIG2/3nJtiu eRHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2oMfxaXF7nRI4BLfRkUmZFlJUfBUODNFJS3becz/GPQ=; b=TSrKn7RvkO6A6TLBNTGlies9E1fFk59jpVo668tuK+UK3gzIQPbuUUt/RKvN2LVW+K JJzHL0APbuEx05kHaiXVen4V1q5xjoIkkQVDd2TIFGVhKDSp0x8X3owKObeE/S9IS6/S Aw+hNj//K+YXUDnEo67qmvBG8cI84HQctyR26SysFcpzvEAwZ0Vfyu1ILbx+G+PeAQgg F79nYnRzn/30eWieHgL1MAq4Lu1K98w/57S79mRmL41Yi6cqbXIGInhWbXGycsBsjQfG mljVcoLSva4zWG0zyosw7dguIo9hUKGJN0iLtm7iIih13CqD9SZvYH1N7DhFe2UN0Bwx Smag== X-Gm-Message-State: ACrzQf27C95fbyqxJXXHMQ2l47tVjIppKq7kec4wRhAlfH3gZeiMomFd g+Zhh+Ns5l9WogE3d7ffRIo= X-Google-Smtp-Source: AMsMyM6LdVb3pwNKgm9TQaOrdm/oRLxBIWu8X88HIbZcvT49c3mpI/PeeYndAhpIxWAAZWIHmvczVA== X-Received: by 2002:a17:902:d4c4:b0:186:a951:b8f9 with SMTP id o4-20020a170902d4c400b00186a951b8f9mr19152254plg.130.1666847683310; Wed, 26 Oct 2022 22:14:43 -0700 (PDT) Received: from skynet-linux.local ([2406:7400:61:dcaa:bb0:9908:b137:b0b4]) by smtp.googlemail.com with ESMTPSA id s8-20020a170902ea0800b001869ba04c83sm216713plg.245.2022.10.26.22.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:14:42 -0700 (PDT) From: Sireesh Kodali To: vkoul@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: dmaengine@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Sireesh Kodali , Jonathan Corbet Subject: [PATCH v2 1/3] doc: dmaengine: client-api: Add immediate commands in the DMA client API Date: Thu, 27 Oct 2022 10:44:27 +0530 Message-Id: <20221027051429.46593-2-sireeshkodali1@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027051429.46593-1-sireeshkodali1@gmail.com> References: <20221027051429.46593-1-sireeshkodali1@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Immediate commands are used by the IPA driver to send commands to the microcontroller over BAM. These are different from PREP_CMD. Signed-off-by: Sireesh Kodali --- Documentation/driver-api/dmaengine/provider.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/driver-api/dmaengine/provider.rst b/Documentation/driver-api/dmaengine/provider.rst index ceac2a300e32..5afe21191299 100644 --- a/Documentation/driver-api/dmaengine/provider.rst +++ b/Documentation/driver-api/dmaengine/provider.rst @@ -590,6 +590,16 @@ DMA_CTRL_REUSE writes for which the descriptor should be in different format from normal data descriptors. +- DMA_PREP_IMM_CMD + + - If set, the client driver tells DMA controller that passed data in DMA + API is immediate command data. + + - Interpretation of command data is DMA controller specific. It can be + used for issuing immediate commands to other peripherals/register + reads/register writes for which the descriptor should be in a + different format from normal data descriptors. + - DMA_PREP_REPEAT - If set, the transfer will be automatically repeated when it ends until a From patchwork Thu Oct 27 05:14:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sireesh Kodali X-Patchwork-Id: 619290 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D1A0FA3741 for ; Thu, 27 Oct 2022 05:14:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234328AbiJ0FOy (ORCPT ); Thu, 27 Oct 2022 01:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233917AbiJ0FOu (ORCPT ); Thu, 27 Oct 2022 01:14:50 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D59120BD; Wed, 26 Oct 2022 22:14:47 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id b11so498534pjp.2; Wed, 26 Oct 2022 22:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VVZZUSIC9z7s5n7uGatrD9g/rvuN1O14UMugKzBE6CA=; b=CbSV+L1onJuzwTvZbJ6p7505PoKAEODSzSp5UTQp8VhXjhAO8KIwwZ/0iAxmBxzLRK LcPVrI2i770a7EveFZYeVdJVJp1VzggM8nYZVyqgH6TfzW7yB819TeVXvMIyqTtd+zuz iz7HA6bB2dUNvcLDXavrvjRYBZF1xuhn9UDTualnBjbT730dLYV8QRFF0JqvrJHOtyYg jP9H5yKpAZiIPtjeW/yKcRKFGvqHhHA4QaM1orj0rS6LzejB/qI1+bFrx2vNiLLA1PNj gzoA7NLfglyguLQXCiDc0UO+VBl9rmLVInN4+yo/pctzuVjmMadzCsmoZ2hkD0fsiroG 6vdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VVZZUSIC9z7s5n7uGatrD9g/rvuN1O14UMugKzBE6CA=; b=lnA+vzXALl2mQhAU6pTHq/NjSExBnR7joju2hqy9Mw08Fs376hJl/TxGrCkmbohfEO cn2KDpi4gFGVsvXSkDZdnu+MP33sOS+o+wB3LuBLialWkxazRhVnSr6OoC4hbg8H9PIL JhFb4djJwA/uvR4aPupmx+e16h23FRqnruHvbfVeuH8fZGW4GT8H8yYoiG0PThrEL36D wMpglr30MhIZegEWeOxjosu/h3IxjYVRQoZgAwvV/yLn5ZrIPaUaXeftiG5DRegS67q/ vm+5SJ4ZPZ+bTS82SMru+1CuLlxDyN7qxG8+AKQtpoE5s0U8XV6vAubf2XZxa51PTNit X7Zg== X-Gm-Message-State: ACrzQf1PZ4im5OebbVf3xgJKVgQ1g5HYu43Rha11OVqNIk1LhQcylCry dQGpSPa9kiKn81o9BfGyJJk= X-Google-Smtp-Source: AMsMyM6CLsp43+za32DC0T/iF4tMwJB0ZXqJWohEqTxVaF5BQSe5W0EDmjIj6f9370Ng7ozT2Ijy8A== X-Received: by 2002:a17:903:2442:b0:186:ef89:7b41 with SMTP id l2-20020a170903244200b00186ef897b41mr126475pls.164.1666847686611; Wed, 26 Oct 2022 22:14:46 -0700 (PDT) Received: from skynet-linux.local ([2406:7400:61:dcaa:bb0:9908:b137:b0b4]) by smtp.googlemail.com with ESMTPSA id s8-20020a170902ea0800b001869ba04c83sm216713plg.245.2022.10.26.22.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:14:46 -0700 (PDT) From: Sireesh Kodali To: vkoul@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: dmaengine@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Sireesh Kodali Subject: [PATCH v2 2/3] dmaengine: Add support for immediate commands in the client API Date: Thu, 27 Oct 2022 10:44:28 +0530 Message-Id: <20221027051429.46593-3-sireeshkodali1@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027051429.46593-1-sireeshkodali1@gmail.com> References: <20221027051429.46593-1-sireeshkodali1@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Immediate commands are needed by the IPA network driver, so that it can send commands via BAM to the IPA microcontroller. Signed-off-by: Sireesh Kodali --- include/linux/dmaengine.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index c923f4e60f24..8da96bb50a63 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -190,6 +190,9 @@ struct dma_interleaved_template { * transaction is marked with DMA_PREP_REPEAT will cause the new transaction * to never be processed and stay in the issued queue forever. The flag is * ignored if the previous transaction is not a repeated transaction. + * @DMA_PREP_IMM_CMD: tell the driver that the data passed to the DMA API is + * immediate command data and the descriptor should be in a different format + * from the normal data and descriptor */ enum dma_ctrl_flags { DMA_PREP_INTERRUPT = (1 << 0), @@ -202,6 +205,7 @@ enum dma_ctrl_flags { DMA_PREP_CMD = (1 << 7), DMA_PREP_REPEAT = (1 << 8), DMA_PREP_LOAD_EOT = (1 << 9), + DMA_PREP_IMM_CMD = (1 << 10), }; /** From patchwork Thu Oct 27 05:14:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sireesh Kodali X-Patchwork-Id: 619613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1F68FA3741 for ; Thu, 27 Oct 2022 05:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234436AbiJ0FPS (ORCPT ); Thu, 27 Oct 2022 01:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234369AbiJ0FPD (ORCPT ); Thu, 27 Oct 2022 01:15:03 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13AE574CCC; Wed, 26 Oct 2022 22:15:01 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id b29so390705pfp.13; Wed, 26 Oct 2022 22:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mOGRH9NXdrfqgbNenNuBmO6i+ru+iWERjL2qQ8bxKOc=; b=GGl2VErwxlzjseiEoId4PZOsXmsgVi2Udhz+DvniQ41BY8OPcCl1DVdKnUs8R7cY71 sS4is/og8XoTndtqK9zcSUX8Ek/9GYYe163+5S6qZUAhGz7hDIA73bhnXCTusQ6tppnQ Cw15UZ2XJaiqZlWNlfl56JtY8QJ8523iRbkBii3Qnhagc1nTeUWNdlz0HkgJAKcanEvW 2fSNowmzImpuC1sa0tih6zRYsZlmGo+iCy1wDmyf9LMXKi9qucQYjiV0oguqFuwJRZL1 fRt1QEh2+W8uhteWX4b6LBfgKyIgKVi1kmvKxuDQMthf72CFVPtEG+WV7Mh4fn8vbIbv xLIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mOGRH9NXdrfqgbNenNuBmO6i+ru+iWERjL2qQ8bxKOc=; b=C4+Dp2A/stO9NN6kq1qjqGMnicgufOAkUAnE3X2y21tNisgoBaU+HFyTuaCv5+Lj30 aWtTi8RliSPEad4xF9a+4N00LPfdBrZsiX3Lw0jIrVUfZl6ETgzxGOTkHyicYrf6nusu bAawtwYnF+KnUrPsDHDkdLrgCmMfz1YJZU5S6ekhgMiq78xEhIHQsNuA7kWQc2EY9rkD VnHHoivQ1ATCj9ZuAowNyKS2W23+u1C73+UxRwS0nojJcK3lkzOpOYESZKYvh5rj60HO OVODnawV1atoMUhqXyNlLPKvzMISEiKgO+oTEU5xbmDfS+MYuJ3u5aSvQ8A/YVeL8ZrN /fIA== X-Gm-Message-State: ACrzQf1SNRk8H9j6vES13EauemiiN9dQ52o46euEcb8etozxlFrLtssd IAhCmq57UYwICeYuGvyBtEiZLf4sd+rH7w== X-Google-Smtp-Source: AMsMyM7kLAPyboZ1bo3FBbafLPqEEmUiEqpipe4WaWFsn+1q7Q+Y6J3nXYCe8ac9I5OcmiDy5RLvaw== X-Received: by 2002:a17:902:900a:b0:178:77c7:aa28 with SMTP id a10-20020a170902900a00b0017877c7aa28mr46692384plp.3.1666847690404; Wed, 26 Oct 2022 22:14:50 -0700 (PDT) Received: from skynet-linux.local ([2406:7400:61:dcaa:bb0:9908:b137:b0b4]) by smtp.googlemail.com with ESMTPSA id s8-20020a170902ea0800b001869ba04c83sm216713plg.245.2022.10.26.22.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:14:49 -0700 (PDT) From: Sireesh Kodali To: vkoul@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: dmaengine@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Sireesh Kodali , Andy Gross , Bjorn Andersson , Konrad Dybcio Subject: [PATCH v2 3/3] dmaengine: bam_dma: Add support for immediate commands Date: Thu, 27 Oct 2022 10:44:29 +0530 Message-Id: <20221027051429.46593-4-sireeshkodali1@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027051429.46593-1-sireeshkodali1@gmail.com> References: <20221027051429.46593-1-sireeshkodali1@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Immediate commands are handled similar to regular commands that are sent over BAM, only a different flag needs to be set. The immediate command support is needed to implement support for IPA v2.x, which rely on BAM immediate commands to send commands to the IPA microcontroller. Signed-off-by: Sireesh Kodali --- drivers/dma/qcom/bam_dma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 2ff787df513e..3135a3e4a167 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -58,6 +58,7 @@ struct bam_desc_hw { #define DESC_FLAG_EOB BIT(13) #define DESC_FLAG_NWD BIT(12) #define DESC_FLAG_CMD BIT(11) +#define DESC_FLAG_IMM BIT(8) struct bam_async_desc { struct virt_dma_desc vd; @@ -693,6 +694,8 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, do { if (flags & DMA_PREP_CMD) desc->flags |= cpu_to_le16(DESC_FLAG_CMD); + else if (flags & DMA_PREP_IMM_CMD) + desc->flags |= cpu_to_le16(DESC_FLAG_IMM); desc->addr = cpu_to_le32(sg_dma_address(sg) + curr_offset);