From patchwork Sun Sep 19 14:43:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sireesh Kodali X-Patchwork-Id: 12504351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 603DCC433F5 for ; Sun, 19 Sep 2021 14:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 440F06126A for ; Sun, 19 Sep 2021 14:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232917AbhISOpd (ORCPT ); Sun, 19 Sep 2021 10:45:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbhISOpb (ORCPT ); Sun, 19 Sep 2021 10:45:31 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9368CC06175F; Sun, 19 Sep 2021 07:44:06 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id q68so14762195pga.9; Sun, 19 Sep 2021 07:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eYQdmjVuswA5ajxv1Qre9oW4YHwul4VIctgt9MF9joU=; b=U7ilE28J7eBa1z7cBaTpnLhLvo7ti/uvif1oyEmXbi9xeLY6UOh9B4O8f4EJTuk7r3 6gXVGmR0zfl3SJbz1PPKp+VlmiruuK4MuXlUj4z1wJkkzUXkfOdbkvKzm23qdy3J0iyt S5Ryb3+RxrAxMVpZSaeuPArjCZXt+OekfVcCqByy1wd4aHdUUp5eByEuCV1MBFF59cV4 3TrIIrSGlaNIInLCKichmlTUInEoBWnbrn2Y6qYLZ0nEcyWxyj19aL+qaY1HGDi8QlLS IW8oTe6OW28bP4rmzZ2OOqyEVB9sQXyZl09sV8usFa5VniZ3r3VaS6cFDeICgUhRvkD7 LSvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eYQdmjVuswA5ajxv1Qre9oW4YHwul4VIctgt9MF9joU=; b=YG7jmVffCDKJTzO+yRQNCL5NCsjerK+DxXFXUhsgKvgAkUpS6ZPYcEQ5AkxI0k2Wmv eJRuuFVPF5wIOhoDKF0ktc9rlzdezRd0rn1wnejMKg+/jc7/JkG1JQTggO1lp1++zmKc DnKgawFsfbWGuPLljSlhePfKZ/7dY62U6siEbfN/rbWRr4QqRhJQPKItk0PMzXMf/UX+ WtFzDKqFF7JxlGWFDBqTUHj2RoyaZtdiK9HZuKRHQmbjB7ID4zMoZf98GC/icOJFIoCA vOtkjAQ7Qi9YwMfv8e5l7uRS+6M420cw9/0N2XfQoePpwbo2Jy8xNkihubKPvRBvyN2v FZUA== X-Gm-Message-State: AOAM531a5WuKCyjFx5odQMAKgR9G9dcZ5jaBi+jROB8VJxav2ngr4Ha3 OAtPW+ploHc7mSrqRYH9QmniV6ETiQNQqAhL X-Google-Smtp-Source: ABdhPJy1Hapx/Wk4MQhozXahELgkxD2JVEC8Gw+h8eANYkNMFUD6FNzGPqC7xrl7EYkK++Ym2+7lkw== X-Received: by 2002:a62:7a11:0:b0:443:937:9fd1 with SMTP id v17-20020a627a11000000b0044309379fd1mr17487583pfc.47.1632062645885; Sun, 19 Sep 2021 07:44:05 -0700 (PDT) Received: from skynet-linux.local ([106.201.127.154]) by smtp.googlemail.com with ESMTPSA id c9sm16270427pjg.2.2021.09.19.07.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 07:44:05 -0700 (PDT) From: Sireesh Kodali To: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Sireesh Kodali , Vinod Koul , Jonathan Corbet , linux-doc@vger.kernel.org (open list:DOCUMENTATION) Subject: [PATCH 1/3] doc: dmaengine: client-api: Add immediate commands in the DMA client API Date: Sun, 19 Sep 2021 20:13:19 +0530 Message-Id: <20210919144322.31977-2-sireeshkodali1@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210919144322.31977-1-sireeshkodali1@gmail.com> References: <20210919144322.31977-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 ddb0a81a796c..f92a0bae06a0 100644 --- a/Documentation/driver-api/dmaengine/provider.rst +++ b/Documentation/driver-api/dmaengine/provider.rst @@ -571,6 +571,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 shoudl 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 Sun Sep 19 14:43:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sireesh Kodali X-Patchwork-Id: 12504353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2657C433EF for ; Sun, 19 Sep 2021 14:44:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89D2161242 for ; Sun, 19 Sep 2021 14:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233171AbhISOpr (ORCPT ); Sun, 19 Sep 2021 10:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233092AbhISOpi (ORCPT ); Sun, 19 Sep 2021 10:45:38 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4089CC06175F; Sun, 19 Sep 2021 07:44:12 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id m21-20020a17090a859500b00197688449c4so10865127pjn.0; Sun, 19 Sep 2021 07:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HsaGsJCStsTHiEfpVj6BO+eliZRcGPVjXTabPxhQ32M=; b=Oh0Cvrt3pwdG3s8tr8fkA5wY0ema/NIKhX8pnLDiQy5cBpbqATM+2PL244BxuH0Ye6 f1/7TQXBSohKwH/HVQPkVFLUFhYnpSDqPz5j86PHqYPTW4wyc8s3jjqC+vT1CamdKybi bre4/VFbOkTPoualRBNeZ1El/ji/0TZFKFrOrPxfxLIAJdtj6FmueC69MZ7+Ta4xmQ3l wJvS8DQZJwnljck3GzUwz6wAGVqqzjA8qzbWj+Sapc/02BeNsGz3B9c228uHpLXgzKaW FC+qcZ/JSsp52NiOQBW446/Fwi6visVBiK3Rcb9zcLwPxfniSpctwrxBM39WMRWzDo65 bHQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HsaGsJCStsTHiEfpVj6BO+eliZRcGPVjXTabPxhQ32M=; b=z4hqMzhB2HoldEZkNqWLjYqRZEZB9PyXMODLxltCjGe/9Xf2ozA7eqoo6v1wCpCjzx 4j29Y9PXA2nhmmdOeG/eXkl4qXH2i5ud+uWAHTOFRdtssy8hArIZVbqdQ/DovSTMqq6p qDrejrEqjvblD+tOhKQGy9ykG/Gvx5+y1Aivcl0dfz8df0zqG/lsbEtr6GAI4nYUu1Du 15Anfex3AOC8EgWdoDq98y1FdHhd7/lofAnIHZVGtrE3ua4grFPYkgCPNyUZtu1WXX/R 0NZgvDkrZJUBPukPwR0Bywg1suxcJlFyOENCUyfyvC96bctVlT9MUUU9rAgGCVRmCkx3 a4yA== X-Gm-Message-State: AOAM5322IhzYnRt7JMHVHIMkTnCtFb8Wfxrkk48X9OT3WQKNNjVIIvcd SBVvOYPdjphBWOPvbqu/xXR78DtHYahtESkJ X-Google-Smtp-Source: ABdhPJzFD+U2I7ogcmy2H6Wc5RDD5XT2+HtTQk0+5YtP+kgixknv68+Q5okesAhCuibJWO/eiQtFnQ== X-Received: by 2002:a17:90b:f08:: with SMTP id br8mr24166702pjb.119.1632062651612; Sun, 19 Sep 2021 07:44:11 -0700 (PDT) Received: from skynet-linux.local ([106.201.127.154]) by smtp.googlemail.com with ESMTPSA id c9sm16270427pjg.2.2021.09.19.07.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 07:44:11 -0700 (PDT) From: Sireesh Kodali To: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Sireesh Kodali , Vinod Koul Subject: [PATCH 2/3] dmaengine: Add support for immediate commands in the client API Date: Sun, 19 Sep 2021 20:13:20 +0530 Message-Id: <20210919144322.31977-3-sireeshkodali1@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210919144322.31977-1-sireeshkodali1@gmail.com> References: <20210919144322.31977-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 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 e5c2c9e71bf1..9bac959b34a8 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 Sun Sep 19 14:43:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sireesh Kodali X-Patchwork-Id: 12504355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B563C433F5 for ; Sun, 19 Sep 2021 14:44:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9C3061244 for ; Sun, 19 Sep 2021 14:44:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233042AbhISOpt (ORCPT ); Sun, 19 Sep 2021 10:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233146AbhISOpm (ORCPT ); Sun, 19 Sep 2021 10:45:42 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2C7DC061574; Sun, 19 Sep 2021 07:44:16 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 203so5946123pfy.13; Sun, 19 Sep 2021 07:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=10LUk0W8IOVg0OUZbJtJhF1cbYBC9z6X1SxaX5YYh8Q=; b=jXrpgOxNs1ZU4+Il79/OZ0GDGWHMWM3co+agqBxXG1C0LXni2VRZDzrF1XK44Fuqw/ 9+zLm3sR26nXysMyUTrAnc5L0AQocUUwpCDDhlgacYRtrhgP5N/EfMoTEh1iCWlO4AfP kCoUvfMP9EiZS/9Q/Uf4rlFsHoCdYoDk/n4IctmVpMnbWcJuR6LJKiw3rT/HgT44Jnmy YN2t73z1to2BxFjsUsIVnF5ERc3ciwPYAQiC6vnIxFwuD8GobVG9YPFttzonpRHm7R0C DjoO8MEHM5VcdOhsr5YSXCjZbQFTe7bBaZSvW35uGpEXuFWaERq644INgPAmLcYVBGbG grpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=10LUk0W8IOVg0OUZbJtJhF1cbYBC9z6X1SxaX5YYh8Q=; b=Zj1rycWVOSAoDjcZoq1bHux/jhdwsVE2r8u0muHfufWdzA4E5OF4Mjs6TmGl/h07mi NWsSdyPuZ2umg7r1IWHv4Fnp4pNFf2T/HxIeQ+k/tju7x59JJqBpwmxmWQLqlGxE22GD aqszi2zTHpW4+xvWY3x8ZxEKjWjPmy5q/cONuv9huqA/H8beJ5uvo1rcaymJpQ0QC3IH 1qcNOiPszREPNY8kmyH7NYQT6FXyNFm4+c3ZwTnqL+svGzzAx7XcQfeIKhoOQoU6jSxb UBaaDgc4LAI+ItjQ6ar5G13WdBeYKIn+NRxhDng2zL0BTFLi0f+S81SEjw6sgm5GpcDP 1DVg== X-Gm-Message-State: AOAM531wsaEkzVP7qDOiYjiX/XjrslvmZsFJwGQmsYKOxzDzCD4km/m5 MxG2WO/DBZTX3c0Qbsm7dsWbrYmfKXoPL7kX X-Google-Smtp-Source: ABdhPJxOOgxA2vAtef/IbEwk3K61jYYWuTeN+IeIIDc8wVeGFEl6SXwrGd3nASGBeRGcNZJtX9P40w== X-Received: by 2002:a63:7f58:: with SMTP id p24mr18973660pgn.203.1632062656317; Sun, 19 Sep 2021 07:44:16 -0700 (PDT) Received: from skynet-linux.local ([106.201.127.154]) by smtp.googlemail.com with ESMTPSA id c9sm16270427pjg.2.2021.09.19.07.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 07:44:15 -0700 (PDT) From: Sireesh Kodali To: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Sireesh Kodali , Andy Gross , Bjorn Andersson , Vinod Koul Subject: [PATCH 3/3] dmaengine: qcom: bam_dma: Add support for immediate commands Date: Sun, 19 Sep 2021 20:13:21 +0530 Message-Id: <20210919144322.31977-4-sireeshkodali1@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210919144322.31977-1-sireeshkodali1@gmail.com> References: <20210919144322.31977-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 driver to send commands to the IPA controller over BAM. To support immediate commands, all we need to do is set the relevant flag in the descriptor. 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 c8a77b428b52..cebec638a994 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; @@ -651,6 +652,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);