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);