From patchwork Wed Apr 6 13:25:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 12803674 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 9AAB0C4167B for ; Wed, 6 Apr 2022 15:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236767AbiDFP6d (ORCPT ); Wed, 6 Apr 2022 11:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237533AbiDFP6O (ORCPT ); Wed, 6 Apr 2022 11:58:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2D102AA18D; Wed, 6 Apr 2022 06:25:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F50B60BBC; Wed, 6 Apr 2022 13:25:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 185FAC385A1; Wed, 6 Apr 2022 13:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649251523; bh=QGkEFEefYTEXkBMQJmoYFoH64Owk00x5HUyX9UzaMs8=; h=From:To:Cc:Subject:Date:From; b=TwpYw6Fg0t6V8g3Y7nVZRVWV8NiF+3mdJQYWFirzVZ4t+NhlaKECJ3JtqEhRg8ktS Gq60nyUvTUKVGCu8Fr5ISHt5ArbWDbdaTXwyrTRLUeiZ+TBf1YrDCSf4vYUyiYpy25 9KfXhv2PzqvtCB/Xiv1Gus4I82LFALzoLrwETJmc6eqB4ZJlFi7YtDHb/WvlIDVfqA dlMYd43CgZOk/+1b7zjWOgPizhaLY587A2LsD45zBzb1HbHsPe0ASSRZpjWJ82Z35Y D8WiAPxLT4iwfiatsghZPzA+MzynRuupSb8cHIleMmFvveK8tlC9q4aoUMWiBGbxd4 Nh+3Ypkh8Up1w== From: Vinod Koul To: Vinod Koul Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] dmaengine: qcom: gpi: set chain and link flag for duplex Date: Wed, 6 Apr 2022 18:55:06 +0530 Message-Id: <20220406132508.1029348-1-vkoul@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Newer platforms seem to have strict requirement for TRE flags which causes transaction to timeout. This was resolved to missing chain and link flag for duplex spi transaction. So add these two flags. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson --- drivers/dma/qcom/gpi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c index 94f3648f7483..3429ceccd13b 100644 --- a/drivers/dma/qcom/gpi.c +++ b/drivers/dma/qcom/gpi.c @@ -1754,10 +1754,14 @@ static int gpi_create_spi_tre(struct gchan *chan, struct gpi_desc *desc, tre->dword[2] = u32_encode_bits(spi->rx_len, TRE_RX_LEN); tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE); - if (spi->cmd == SPI_RX) + if (spi->cmd == SPI_RX) { tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOB); - else + } else if (spi->cmd == SPI_TX) { + tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN); + } else { /* SPI_DUPLEX */ tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN); + tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK); + } } /* create the dma tre */ From patchwork Wed Apr 6 13:25:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 12803673 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 B6098C4321E for ; Wed, 6 Apr 2022 15:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236677AbiDFP6c (ORCPT ); Wed, 6 Apr 2022 11:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237538AbiDFP6O (ORCPT ); Wed, 6 Apr 2022 11:58:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE91B2E9115; Wed, 6 Apr 2022 06:25:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7A7F860BBC; Wed, 6 Apr 2022 13:25:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 663EAC385A8; Wed, 6 Apr 2022 13:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649251526; bh=hTm2T0pdYDtFq2HDDGIY0S7joOuEyR0hSrSZNJKq0oI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=REZhUJMpmud3BuPyrnUP3oExqT2dwMzk4Yubx1hbmiyipl28W+l/Z4CNtxC7nMw0G Nq3bAwTdrlclkNnFTmmNPcUcTwSDAIQ6Z5L9sZOGJNSPRup8mQc+sbnDs46aqscjo1 SG74enTTeyBOHe/HyRST+bXXp2xg5Gd+5YPMjWtioIskeOjMOv5321Tk2a8qu7L+FC Rhgqk1iAyMY/IzzJbS7hM15FDQXJBoqJmADNURkO1jZGZgSgdHUGI/RxM2kR6/OuAw 9IIbNnEF5bi2O+k57SUe9Joa4Cv2+EKj0nEt+6nbR39TOBtKrwTyGJT+SljhOZFzHP NOXIaRvv27Ekg== From: Vinod Koul To: Vinod Koul Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Subject: [PATCH 2/3] dt-bindings: dmaengine: qcom: gpi: add compatible for sm8350/sm8350 Date: Wed, 6 Apr 2022 18:55:07 +0530 Message-Id: <20220406132508.1029348-2-vkoul@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220406132508.1029348-1-vkoul@kernel.org> References: <20220406132508.1029348-1-vkoul@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the compatible for newer qcom socs with gpi dma i.e qcom sm8350 and sm8450. Signed-off-by: Vinod Koul Acked-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson --- Documentation/devicetree/bindings/dma/qcom,gpi.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml index e614fe3187bb..67f046a4a442 100644 --- a/Documentation/devicetree/bindings/dma/qcom,gpi.yaml +++ b/Documentation/devicetree/bindings/dma/qcom,gpi.yaml @@ -22,6 +22,8 @@ properties: - qcom,sdm845-gpi-dma - qcom,sm8150-gpi-dma - qcom,sm8250-gpi-dma + - qcom,sm8350-gpi-dma + - qcom,sm8450-gpi-dma reg: maxItems: 1 From patchwork Wed Apr 6 13:25:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 12803672 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 37D6DC433EF for ; Wed, 6 Apr 2022 15:56:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236503AbiDFP6a (ORCPT ); Wed, 6 Apr 2022 11:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237539AbiDFP6O (ORCPT ); Wed, 6 Apr 2022 11:58:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D7613DFF; Wed, 6 Apr 2022 06:25:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C87F96152F; Wed, 6 Apr 2022 13:25:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78B4DC385AA; Wed, 6 Apr 2022 13:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649251529; bh=NZuFXM3zqS91214yNiugl+PV0SUW+INnvg+0l8KGQ2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7hIVXjO8JIfjb8oqfshU57Clp3/ThSRPXcXZ21/OMEq7lCJxrkgyrQmgut1J8DC9 9R637NI/wj8sryhCNbyrpqEtW4zHrrJ0tMI4/m2T1sGqMvEXKXc962WIVLINpF77D5 oSOL52BCtccx0EgXpgTlKI9Z92ZiDlIPSgYroaHHruZw2L+McYa1p3B3+mhXPtpnk8 O0Js3em3qzq6LxsmzX+wFbWG/XRY9v/WMV/m0mcAoTVRgI2wZNZ99rEsVFSkqou1Xe FQbhSnNXiphRwzEygoHIfX6eCBD3SHOL/sJCQnkC7sYVJf5syNNKOyJqbK1tV3c8Gz h2u2/JR1SQezA== From: Vinod Koul To: Vinod Koul Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] dmaengine: qcom: gpi: Add support for ee_offset Date: Wed, 6 Apr 2022 18:55:08 +0530 Message-Id: <20220406132508.1029348-3-vkoul@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220406132508.1029348-1-vkoul@kernel.org> References: <20220406132508.1029348-1-vkoul@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Controller on newer SoCs like SM8450 have registers at at offset. Add ee_offset to driver_data and add this compatible for the driver. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson --- drivers/dma/qcom/gpi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c index 3429ceccd13b..0b402d923eae 100644 --- a/drivers/dma/qcom/gpi.c +++ b/drivers/dma/qcom/gpi.c @@ -2152,6 +2152,7 @@ static int gpi_probe(struct platform_device *pdev) { struct gpi_dev *gpi_dev; unsigned int i; + u32 ee_offset; int ret; gpi_dev = devm_kzalloc(&pdev->dev, sizeof(*gpi_dev), GFP_KERNEL); @@ -2179,6 +2180,9 @@ static int gpi_probe(struct platform_device *pdev) return ret; } + ee_offset = (uintptr_t)device_get_match_data(gpi_dev->dev); + gpi_dev->ee_base = gpi_dev->ee_base - ee_offset; + gpi_dev->ev_factor = EV_FACTOR; ret = dma_set_mask(gpi_dev->dev, DMA_BIT_MASK(64)); @@ -2282,9 +2286,10 @@ static int gpi_probe(struct platform_device *pdev) } static const struct of_device_id gpi_of_match[] = { - { .compatible = "qcom,sdm845-gpi-dma" }, - { .compatible = "qcom,sm8150-gpi-dma" }, - { .compatible = "qcom,sm8250-gpi-dma" }, + { .compatible = "qcom,sdm845-gpi-dma", .data = (void *)0x0 }, + { .compatible = "qcom,sm8150-gpi-dma", .data = (void *)0x0 }, + { .compatible = "qcom,sm8250-gpi-dma", .data = (void *)0x0 }, + { .compatible = "qcom,sm8450-gpi-dma", .data = (void *)0x10000 }, { }, }; MODULE_DEVICE_TABLE(of, gpi_of_match);