From patchwork Thu Nov 19 15:52:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 328429 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp471680ejb; Thu, 19 Nov 2020 07:54:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVBm+tV57oJvkiCElfJLwzNG7wuDrjJHK7Z1werBp5yh5fMeRPaEtJ5J2TjojLtRryPAID X-Received: by 2002:a17:906:a996:: with SMTP id jr22mr29571508ejb.463.1605801252441; Thu, 19 Nov 2020 07:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605801252; cv=none; d=google.com; s=arc-20160816; b=DDgHwZ3qUhyTE6DsNYH/43Q6zKCnQX+ty/Og0rPWiJmywyteeeFww/eZXeApnx+hJB i6HL1zpcJtxr2Y3WSrOV549sXb6KUjAPKZfnOWHIqKwhsyZIceoQW+fAbD1Hy5V23l2k Pp4vnAr3dqfcxGSdLSBvcD05Bkr9JICqTT3Rd/KFvRDZ+5cb0hSI1E3p189PsLhKa1JF Vz4t60eKtGWrA0m+0pVklfZMnDGO9QQU1oPARKHU4Oszy+AYWtQit2/534uSNFBK70ga TCi2z8iGfKS040tQ7qW+PtrFkSgxjgQUsp1whNvqCVyZt/34Ryc0hyGsqDppZG55YQh/ NwAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4MCvCRmAMrx9hEGjjAJklgqSdTLavuT99AZ/bugFCos=; b=JQXHcmdiqYdexVi8aUHIOlpVd1SVZpSBDIXKMuz8Vwolw2fhHRqyYqOvmj0OO7723/ F9TNe3gajPnQ/RxMfnQrmQZLnM26j6igFZRMeDNg+Dsaxx9hh6luY4vfS0+VnH8V+luq 0z2kjWc2LN1iEFfKjK2oGKZTJawS4pfAua+VV28PVraSFtTi/GCvKettZvhAymY7pxAl QYGdWvaSom4gGmo+GxpEKs+IHF99Xhw+IpOiDFOn/oBSUk2HSiT2IPP6qgfKG1sRL6CL pcWsq+rbdZ/NjsL1OW/2JLBxGGswpiDkA6e4NXZyU2SdHZ8pX6XxIFA9fJLqzvn+lXJA vXhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A331nUgW; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ok23si67063ejb.243.2020.11.19.07.54.12; Thu, 19 Nov 2020 07:54:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A331nUgW; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728919AbgKSPwl (ORCPT + 2 others); Thu, 19 Nov 2020 10:52:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728905AbgKSPwk (ORCPT ); Thu, 19 Nov 2020 10:52:40 -0500 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF73C061A04 for ; Thu, 19 Nov 2020 07:52:38 -0800 (PST) Received: by mail-qv1-xf43.google.com with SMTP id z17so3045976qvy.11 for ; Thu, 19 Nov 2020 07:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4MCvCRmAMrx9hEGjjAJklgqSdTLavuT99AZ/bugFCos=; b=A331nUgWpYis9cgDM+H9IflfmtXE8u7sy5s92VZ6qlPcq3ZPDIlJsHqw1/ta/Y2qN+ 9uDbQikKonrGHPWZQs8GljIwkUssWr8JAhYELG0zYCgATDn2+N2mr6Ab5Lt69OLvZBwq DDe9BHj0r+7d4AxKDQp5badoafP9TPsKZIR62l1ACovFvtX/ALLbj57OaqbV/8tck0nv lrptbm9LgZ4t3S9aNEn6RAz3nCRI4wA6pWOujVakHNQmW7guGiVPLk7gCaBY0Zi3I+Zr eBI6gBI4O4UtDVrUuiQOUbli0S2LUcktQyDh8PfubJHRD7nCqAygCSINMcN7qYOXSc9R T65w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=4MCvCRmAMrx9hEGjjAJklgqSdTLavuT99AZ/bugFCos=; b=RFD0nuOsY1I24MwqpCVWspdZFDwLcp8ytKBhuP3Ern0xFofBWyehci6x3t7ZPLy9bZ UXr9jX7ozf4bJjXsJYhf7aR2FJmHM88LXYLDrdnkxBIc8ybhRJS1voyosMgA0otQMcv2 FmMSHjbAhGv7DTIgnTLzIPaPIVORZ7BwJyaB4s/pW9vWkuLwzXhX6Sz8cf4P2ttqqIGQ 2Npkx1djeob+BuFo70HXDu+qulZud+s3vgMVBDsYifus1wfSivVvJRzQPZVWHEEYAbf8 ogMebcqQcu7Pdd6HX9BI92X8lJZJAwdJ2F4hJmQZMghde8mHnaySqPr+BioOCsIK8R/n 6Ojw== X-Gm-Message-State: AOAM532bCseHDbUC398n7oOwDTPZptYI6+6nUgOIH4N0Nb98ARvgVVMU FyDVxc8ix2cBJJqI79mo/Qh0IQ== X-Received: by 2002:a0c:c984:: with SMTP id b4mr11609562qvk.10.1605801157619; Thu, 19 Nov 2020 07:52:37 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id g70sm127290qke.8.2020.11.19.07.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 07:52:36 -0800 (PST) From: Thara Gopinath To: agross@kernel.org, bjorn.andersson@linaro.org, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845. Date: Thu, 19 Nov 2020 10:52:29 -0500 Message-Id: <20201119155233.3974286-3-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201119155233.3974286-1-thara.gopinath@linaro.org> References: <20201119155233.3974286-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Qualcomm CE clock resource that is managed by BCM is required by crypto driver to access the core clock. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- drivers/clk/qcom/clk-rpmh.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index e2c669b08aff..7e2a4a9b9bf6 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -349,6 +349,7 @@ DEFINE_CLK_RPMH_VRM(sdm845, rf_clk2, rf_clk2_ao, "rfclka2", 1); DEFINE_CLK_RPMH_VRM(sdm845, rf_clk3, rf_clk3_ao, "rfclka3", 1); DEFINE_CLK_RPMH_VRM(sm8150, rf_clk3, rf_clk3_ao, "rfclka3", 1); DEFINE_CLK_RPMH_BCM(sdm845, ipa, "IP0"); +DEFINE_CLK_RPMH_BCM(sdm845, ce, "CE0"); static struct clk_hw *sdm845_rpmh_clocks[] = { [RPMH_CXO_CLK] = &sdm845_bi_tcxo.hw, @@ -364,6 +365,7 @@ static struct clk_hw *sdm845_rpmh_clocks[] = { [RPMH_RF_CLK3] = &sdm845_rf_clk3.hw, [RPMH_RF_CLK3_A] = &sdm845_rf_clk3_ao.hw, [RPMH_IPA_CLK] = &sdm845_ipa.hw, + [RPMH_CE_CLK] = &sdm845_ce.hw, }; static const struct clk_rpmh_desc clk_rpmh_sdm845 = { From patchwork Thu Nov 19 15:52:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 328425 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp471579ejb; Thu, 19 Nov 2020 07:54:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUPWj4e489YuQJONTyhqUpS8pE/vH+t+EndaIPixVNHdlUd+Oj4MSI2WPCQ4uWm8n/BJrH X-Received: by 2002:a17:906:178b:: with SMTP id t11mr20392585eje.152.1605801245205; Thu, 19 Nov 2020 07:54:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605801245; cv=none; d=google.com; s=arc-20160816; b=LJh/HUW6wrT4ZVoVX8RL2Ca9Y0QOnxWCR0TNlkCjX75Ng6WxiMy2aB4V/moPbzMz3N DlRJLM0a3QW4H/DIGEgI5ER7kIPSmIuqCift24Lby6aKpNiVNV7WSxtLKH2aJyE0HoPM ECSF7H1VD7naH5+PLYWG/dOclyfoYwEP248zk2k6nZFwjyXLmkgHOd/aC/4KV81uC/6O v3JAzH2Egqgz20rsfwJfkpslzeYk125nzkexJvUBoa4GQU3K3qmORB612jox2tEzvDUh 8l2i51/wNbXwMO8oUqFMQAvVaDmySHVFwHa7t72szNEcQtmuhziVcZr6OyB6knovYlLj 1/ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WK7dbS/2WIcf7lppGbM/SVGTBQiYrXQBAamVJT++jdI=; b=J8qs6jVUHM/6N5htVqYSHnL02r+h/PFZnaICbjFASLj/d8RDvG0kcDSjrEoYGNYSI5 zEKedL2s1vnbIftpeNheKlHNd37wCki1DRcaok/Q0mRH+0xOA96MsmiNbs2OLmL02Pub 50zA9UH6eJn0Wikok1jJVbF9kfi0ChyrnAfaKPUbYa89tLqXmix0/DIlCZpxK+DT25IX l8ge5CHKnBdqFikmrIF3W1Qq7dXgR/ss/kMrQoq0I6bQxEVotqXJNbzMvoDRpiAZAXVi WpMzULnxYI6TCau+nOQqVJ/tluwkM4FJgn7UDpOmmOsds+oLbRw+tgCzVjtEsgdoTpQW QmQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ietn0vzu; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ok23si67063ejb.243.2020.11.19.07.54.05; Thu, 19 Nov 2020 07:54:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ietn0vzu; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgKSPwl (ORCPT + 2 others); Thu, 19 Nov 2020 10:52:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728907AbgKSPwk (ORCPT ); Thu, 19 Nov 2020 10:52:40 -0500 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE2B5C0613CF for ; Thu, 19 Nov 2020 07:52:39 -0800 (PST) Received: by mail-qt1-x842.google.com with SMTP id g17so4681058qts.5 for ; Thu, 19 Nov 2020 07:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WK7dbS/2WIcf7lppGbM/SVGTBQiYrXQBAamVJT++jdI=; b=Ietn0vzuyHymF+fGLpMED5gPejOJx5P9PsMQ9QZfIf/wzyM1FEyilGjb3Dq1VORSyu IcqI45ReNY1xEI/igFPRVwVYyhZ8mdbCKPvufR3ia25oIq2M9rB9vjloVAWzsd83//2P XF1VGcmFA2KVWMgvGLfHGSaBBgn0NiLfpDBO9SnALlYew2c5xzQVv2I7bO+VFyj6pfGI CZ6v49PaCRj2t4atGj5HcPptxxaunnlvtR5YnUF3Tl1QPDak7R/+0RafesR9OKED/aX5 92VThVXyQyW79fWALN/m0wrLttVwkmsh4dvP7mJ2vwlcTvfTbLIbXPqh4PRq2rQ/crr9 PlRw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WK7dbS/2WIcf7lppGbM/SVGTBQiYrXQBAamVJT++jdI=; b=NOQmxNA/KHHFyaV1AJKuCc1TNpGcuOVjHWvDgnRG4MiTgSM0iL+2CDY3b9eLll2n4E dYiC0Abbwz5Pr524LzTT1/axpBzbYs1E/Qyl6n2bicBt/hENCMPdvw7NQKghDtXuThce smL059Fm90QNo++TuU316KLkNXxIap1dE0QrFM49o+y9Jotn+dVvxT/JveJFMIuagYoi ozw9S+TJvg83RG1TvS9AO5gmcuv+x3SGwrDlILD/DN4qrRPTOYL8uS7jM31CTztm5IxR z4nqUiL72643KrmK0R1T1x9JngAzuGQRh1nXPBLPvwukXAldEd1pMvPYIE41+E0pttQd LPiA== X-Gm-Message-State: AOAM5321WRu8brtu03+SqMmA4Ahz4tCk6uBwxgtqfNzvoRBv0YXiep+e TpPUOQwmyT5JZk5jz9HI8ZuZYA== X-Received: by 2002:ac8:ec8:: with SMTP id w8mr6998038qti.371.1605801159080; Thu, 19 Nov 2020 07:52:39 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id g70sm127290qke.8.2020.11.19.07.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 07:52:38 -0800 (PST) From: Thara Gopinath To: agross@kernel.org, bjorn.andersson@linaro.org, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [Patch v2 3/6] drivers: crypto: qce: Enable support for crypto engine on sdm845. Date: Thu, 19 Nov 2020 10:52:30 -0500 Message-Id: <20201119155233.3974286-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201119155233.3974286-1-thara.gopinath@linaro.org> References: <20201119155233.3974286-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add support Qualcomm Crypto Engine accelerated encryption and authentication algorithms on sdm845. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- drivers/crypto/qce/core.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index ea616b7259ae..67c3ca13e55b 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -160,7 +160,21 @@ static int qce_check_version(struct qce_device *qce) return -ENODEV; qce->burst_size = QCE_BAM_BURST_SIZE; - qce->pipe_pair_id = 1; + + /* + * Rx and tx pipes are treated as a pair inside CE. + * Pipe pair number depends on the actual BAM dma pipe + * that is used for transfers. The BAM dma pipes are passed + * from the device tree and used to derive the pipe pair + * id in the CE driver as follows. + * BAM dma pipes(rx, tx) CE pipe pair id + * 0,1 0 + * 2,3 1 + * 4,5 2 + * 6,7 3 + * ... + */ + qce->pipe_pair_id = qce->dma.rxchan->chan_id >> 1; dev_dbg(qce->dev, "Crypto device found, version %d.%d.%d\n", major, minor, step); @@ -261,6 +275,7 @@ static int qce_crypto_remove(struct platform_device *pdev) static const struct of_device_id qce_crypto_of_match[] = { { .compatible = "qcom,crypto-v5.1", }, + { .compatible = "qcom,crypto-v5.4", }, {} }; MODULE_DEVICE_TABLE(of, qce_crypto_of_match); From patchwork Thu Nov 19 15:52:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 328539 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 17984C83017 for ; Thu, 19 Nov 2020 15:52:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADF5E246E0 for ; Thu, 19 Nov 2020 15:52:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="X2CLndD6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727435AbgKSPwx (ORCPT ); Thu, 19 Nov 2020 10:52:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728924AbgKSPwl (ORCPT ); Thu, 19 Nov 2020 10:52:41 -0500 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312F8C0613CF for ; Thu, 19 Nov 2020 07:52:41 -0800 (PST) Received: by mail-qk1-x744.google.com with SMTP id d28so5720287qka.11 for ; Thu, 19 Nov 2020 07:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B4eYZ8BtJ+Xv96s0vkBJN4bKwPI1mGpKSPj/atTPTao=; b=X2CLndD6x4dO4Y8ww/vjWOI2kjcDiGOnEue+rJYwfeW/8WYoST1Vap22OCgDFC3xjg IzQAsiROeT7WX47nc/cJida59ADdsovdlPvUj+nBmphV6LEUEVBb5pGMTKrT3zE/q4uR F/ht3F6Aw7D8dryDdAVxYpwP6Zkvf680g47LLROF/o/o0stekOh0OZp5i0ebMRzmhKc7 jbdQBNTkYsUAtf5HT5mvOmhJMR27P771vcfiGXagX0YZATIeHO4Z60vxO8rGV1/ccYvK qj6I1MCoBohQrYd1JzslnVrT0p7g+UPcZ74j5ag3oiGTQXUzfQpRzHeqfgIxAcSLICff hdPw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=B4eYZ8BtJ+Xv96s0vkBJN4bKwPI1mGpKSPj/atTPTao=; b=bMQtB9tCATrEHeW5kSY0eCGR4WxrzBUuOrRkE9WUwe9YZj0A9HBwWjZ9hRTgCGJuDC /0AAEMmvlDO6kJA0Cf603EH/yH0TvLa4yqsLosbV++pJYpCjVGMhHxayLkTWp/O9aDrv p3YpIjgrqJb5MbYkEi//bIzssSWljflKIPk8jUirrwikPHqwNMaYfpklyyGZqSNefG+y lpLIDPxknhQbduac/bRR5E2/OJlxDcYZ5CmqtmqeyeNlDA+QIsrj7EtETs5IwjjTo8va cfgjiJKSf0OSD/gH1sZHwSUco8AwOisLaJSBnczxt4wtEJvl8Hdg8DQCFa9YHzxWmOLx 4iPw== X-Gm-Message-State: AOAM5325B8mVbqzOmCrCjrgHU98VZ4K60KPRRt8PH8xJfJ2nqPI3yRuH S9Kghvd7jEbxCJHqADYR4Pv4MQ== X-Google-Smtp-Source: ABdhPJz7szSCWmAcq2earjWNlZVZJgPNsWShDopwk6UN17GSGSj07ZyEDiGS/UuVYTVdcx34nGO4mA== X-Received: by 2002:a05:620a:5f6:: with SMTP id z22mr11361053qkg.211.1605801160386; Thu, 19 Nov 2020 07:52:40 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id g70sm127290qke.8.2020.11.19.07.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 07:52:39 -0800 (PST) From: Thara Gopinath To: agross@kernel.org, bjorn.andersson@linaro.org, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues. Date: Thu, 19 Nov 2020 10:52:31 -0500 Message-Id: <20201119155233.3974286-5-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201119155233.3974286-1-thara.gopinath@linaro.org> References: <20201119155233.3974286-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Partial hash was being copied into the final result buffer without the entire message block processed. Depending on how the end user processes this result buffer, errors vary from result buffer corruption to result buffer poisoing. Fix this issue by ensuring that only the final hash value is copied into the result buffer. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- drivers/crypto/qce/sha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index 87be96a0b0bb..61c418c12345 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c @@ -48,7 +48,7 @@ static void qce_ahash_done(void *data) dma_unmap_sg(qce->dev, &rctx->result_sg, 1, DMA_FROM_DEVICE); memcpy(rctx->digest, result->auth_iv, digestsize); - if (req->result) + if (req->result && rctx->last_blk) memcpy(req->result, result->auth_iv, digestsize); rctx->byte_count[0] = cpu_to_be32(result->auth_byte_count[0]); From patchwork Thu Nov 19 15:52:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 328540 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 BB15BC83012 for ; Thu, 19 Nov 2020 15:52:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54C25246D1 for ; Thu, 19 Nov 2020 15:52:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Dwn1JI3I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727962AbgKSPwv (ORCPT ); Thu, 19 Nov 2020 10:52:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728938AbgKSPwn (ORCPT ); Thu, 19 Nov 2020 10:52:43 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9583C061A04 for ; Thu, 19 Nov 2020 07:52:42 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id 11so5779519qkd.5 for ; Thu, 19 Nov 2020 07:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ncm4tg3t1i7YF0Acj05l9+ZFtRqok/Gt9GCUMfnO+SI=; b=Dwn1JI3IGVVrz9y1hJnMh9HlIiQF+/UE4yWOgcnTq+QHQ0LRgSEKDOa17UhFgxvw5W sfrnXKLoLKvWfb3hD8atziUk3EsE1xbMU/Paxw0f04Jrx9FaVGupvJVC8PtlLpAz9mTT YZNyEHaqD1c1sHi+lAHPsqQjYNB2C7hVqGlHXZ346pyCia0Td+Bn9V2H9gMwvS3F3cE+ /sXSXGVVWvDmDNU98wXz3r+hkVy1GpHWJZfSnFhTybRekpDX3GQiha9tvuFs2S1EoNH5 NtNal34ErNuxWUva/p0UbDHeDlh7hwO4BxyWAjjyqCuHOohH8T6OZelQaslPySs52tMO kVFA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ncm4tg3t1i7YF0Acj05l9+ZFtRqok/Gt9GCUMfnO+SI=; b=XJneSHif1b4GB7rl+P2FievbMHWc7SfT5S/j8G300U/zo3qtqbbAyUZgbbU9OlSP4v yB1Z+/t3EMqMPa4w2yGcUtT3oROKGD3o9wqg/3LiAzZqgmYKda0/nGW96guGV1Lef2Tw 4w+RNUSBwBb/VYAOj7Zu+pcCQHXkI7TOCikwPNE5cZHI8hKVheDAWUh+toTUa3AiUtMs rywajxPPdmAyRj+axHHpyFNyGjiN/Wchzi1ewS0JsfT/MMZVZ4JP1YhHjqRiaZqHJtnL fSwd6zDHszlq14kTV6qEzsNQ1r9PVkqmmfPe7R9yKVBSCXP5GtQQbxg0Skw0qGbnLNNY 3EAA== X-Gm-Message-State: AOAM530KJKNYPBVmJZib2dpC75Y339D8CtzbpvLFH4FDCztvn/WjhFVW hgZ8VMoxfKqRD4UzO7en5CcpKQ== X-Google-Smtp-Source: ABdhPJzBzlC9keR57VmYhsWPTNkQgkbnigWXOFO/CWaItdZnYLjbu3+faOf09WY8SRnpqH5zJU98Ww== X-Received: by 2002:a05:620a:d41:: with SMTP id o1mr11295674qkl.338.1605801161839; Thu, 19 Nov 2020 07:52:41 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id g70sm127290qke.8.2020.11.19.07.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 07:52:41 -0800 (PST) From: Thara Gopinath To: agross@kernel.org, bjorn.andersson@linaro.org, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [Patch v2 5/6] dts: qcom: sdm845: Add dt entries to support crypto engine. Date: Thu, 19 Nov 2020 10:52:32 -0500 Message-Id: <20201119155233.3974286-6-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201119155233.3974286-1-thara.gopinath@linaro.org> References: <20201119155233.3974286-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add crypto engine (CE) and CE BAM related nodes and definitions to "sdm845.dtsi". Signed-off-by: Thara Gopinath --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index 40e8c11f23ab..b5b2ea97681f 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -2138,6 +2138,36 @@ ufs_mem_phy_lanes: lanes@1d87400 { }; }; + cryptobam: dma@1dc4000 { + compatible = "qcom,bam-v1.7.0"; + reg = <0 0x01dc4000 0 0x24000>; + interrupts = ; + clocks = <&rpmhcc RPMH_CE_CLK>; + clock-names = "bam_clk"; + #dma-cells = <1>; + qcom,ee = <0>; + qcom,controlled-remotely = <1>; + iommus = <&apps_smmu 0x704 0x1>, + <&apps_smmu 0x706 0x1>, + <&apps_smmu 0x714 0x1>, + <&apps_smmu 0x716 0x1>; + }; + + crypto: crypto@1dfa000 { + compatible = "qcom,crypto-v5.4"; + reg = <0 0x01dfa000 0 0x6000>; + clocks = <&gcc GCC_CE1_AHB_CLK>, + <&gcc GCC_CE1_AHB_CLK>, + <&rpmhcc RPMH_CE_CLK>; + clock-names = "iface", "bus", "core"; + dmas = <&cryptobam 6>, <&cryptobam 7>; + dma-names = "rx", "tx"; + iommus = <&apps_smmu 0x704 0x1>, + <&apps_smmu 0x706 0x1>, + <&apps_smmu 0x714 0x1>, + <&apps_smmu 0x716 0x1>; + }; + ipa: ipa@1e40000 { compatible = "qcom,sdm845-ipa"; From patchwork Thu Nov 19 15:52:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 328427 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp471603ejb; Thu, 19 Nov 2020 07:54:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQS24ccpTNQNLOz1CMceQVFZ9tFQgF3vVYIQDPdlprcEJe03w8fYmpb7SPbB+wfR7JmG61 X-Received: by 2002:aa7:d891:: with SMTP id u17mr22154246edq.180.1605801246819; Thu, 19 Nov 2020 07:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605801246; cv=none; d=google.com; s=arc-20160816; b=xc+kGiUVtZHQyMPMXHjjcOlo5MqZwkx5Km2jpL3nF/IvRPWg2xFPNqrf1+ogfZNmoE GRD5E7pI3WS7Pth8x+7hCBNibx+/oz7GbI8U7tf2qpaZnAfF7s/Fofl2gEwCizuBT8kP 4jzH2SLFBOCGd6B08LESmgRvnb/jTWW7nsi5eQ171DJZhKkN7ow1GKFzDgrdD0CqcBoK hFWraMiJ/x0CiOvjXikS5/vHLN8ojXUCRaFAtDpZhOTGWqfNMeOqgYERpQ6AptLgyiPC wPSwNvkK0n1rQI/Z/7BtxnkidchFEPMTHRyd3AL/lTR+iwNL5x8WG6o66+c96163bNNs 2CoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iS4PFF4afNVE7r1m6FFtegXe9ReuZEWdknfJDOJxxsY=; b=Hpc/NBQgvdot0X4Jart4bjzGdgp9vGoyyIjcPbbBUqumk+EC/ex6bOzhkxQTdFHZ+c Mhuq3YvjpS9lkNOc8bxfry/CDJGy3o4Ibx2ruU4CD4e7mlRZ0gNd2F0xhoS9LVUXs5KD IhbBx2G8rwjZTivAwJri9GvI7FYstQwq+lebLdfXglz5ITkmsP4d25pwSNkX/ukuzJ93 TczmejaPD2XSph7YDOZ6rSOLVjS739RBn5q8I56/sgnkuedLtJ7ctC4Gmz7BgK5j7S+i nUq71SFO3JxjS8jbViUAy32iO6LFdS23TzYE1Np+m5quGmymZk2gCcEYbsXP3JdzDW8C p9wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ogRs7aHV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ok23si67063ejb.243.2020.11.19.07.54.06; Thu, 19 Nov 2020 07:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ogRs7aHV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728954AbgKSPwo (ORCPT + 2 others); Thu, 19 Nov 2020 10:52:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728944AbgKSPwn (ORCPT ); Thu, 19 Nov 2020 10:52:43 -0500 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85526C0613D4 for ; Thu, 19 Nov 2020 07:52:43 -0800 (PST) Received: by mail-qk1-x743.google.com with SMTP id v143so5793191qkb.2 for ; Thu, 19 Nov 2020 07:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iS4PFF4afNVE7r1m6FFtegXe9ReuZEWdknfJDOJxxsY=; b=ogRs7aHVgPAe9BFPnptBBpgxHJY2yTOCZkeVo9BIdOoGrIr47GvR7a4/SOKPKeXlz7 N9hh27I3m3pqEEFW4SA/IirxvRS7+Uve3ZuaoQin3LNcceQO08qYMn92+YDYjVTybV7j bSIzxWcAQQJ1XcUKoeRemnMcO4PLgEUPDhV6TrTxNcyUW4Sx/hMjOXHvB5Q29nxFjdw9 h+VnR8oEuBh5FV6QRfbJQuDhtwaatGpvwneia6taGDiJAMjegXWq5/MEPLinlC2OvfIS 5r7gJNdpUtLi22yEuDSs6g9KfyI47VLO44gBTSnbRlonevCZrbfqQxE+doXbWaAEobcX ThBg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iS4PFF4afNVE7r1m6FFtegXe9ReuZEWdknfJDOJxxsY=; b=nbb6R1NziOfCobMwCOYWHMtf4KhernMjxmGOsqD+txc/Uq9cSiP4dXuMFWnd3HfjmC X+7jXKzYVGbz17Jmvd0r7YJ9m679T42G1rYSU6PZNgLodtWMsKsX4Q22AQnbqYHiFdmc xW8XEozbTAUymq64b00C5lBEpfAiFlsFiRVvuIHP+bwHv2xJOb+eLWLAvgj3wSPlDVMH xDhug6uPNMzYUyRGg4ZTugsrefIBmHPg3qTWwPmSTFUSrPtqN36bAVVk+ay4hBU554Rq 4KDfg6+gAF6wADfX3ou5s9M1WaYwLW3Ny7K8/9OHVmtolakuXdd6eihRcZr8noqexCcg BJzQ== X-Gm-Message-State: AOAM5313HGPUXKDYE6FsLOkfWrMGApw7/+2BZN3KBRtCb0jhSqLPd3Gx JwNxth7/qEjf9gFTIr+cwD8dxA== X-Received: by 2002:a37:e207:: with SMTP id g7mr11719107qki.44.1605801162795; Thu, 19 Nov 2020 07:52:42 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id g70sm127290qke.8.2020.11.19.07.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 07:52:42 -0800 (PST) From: Thara Gopinath To: agross@kernel.org, bjorn.andersson@linaro.org, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com Cc: linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding Date: Thu, 19 Nov 2020 10:52:33 -0500 Message-Id: <20201119155233.3974286-7-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201119155233.3974286-1-thara.gopinath@linaro.org> References: <20201119155233.3974286-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add compatible string to support v5.4 crypto engine. Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson --- Documentation/devicetree/bindings/crypto/qcom-qce.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.txt b/Documentation/devicetree/bindings/crypto/qcom-qce.txt index fdd53b184ba8..ed1ede9c0acc 100644 --- a/Documentation/devicetree/bindings/crypto/qcom-qce.txt +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.txt @@ -2,7 +2,9 @@ Qualcomm crypto engine driver Required properties: -- compatible : should be "qcom,crypto-v5.1" +- compatible : should be + "qcom,crypto-v5.1" for ipq6018 + "qcom,crypto-v5.4" for sdm845 - reg : specifies base physical address and size of the registers map - clocks : phandle to clock-controller plus clock-specifier pair - clock-names : "iface" clocks register interface