From patchwork Tue Nov 17 13:47:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 325460 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp4182173ils; Tue, 17 Nov 2020 05:49:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMDGgL2kdXJaj2GbRLzip3LKf6NcYxF44aSp+Y21kbG9IVNO+pzhq9I8hG2y7+yTUyEEme X-Received: by 2002:a05:6402:22c6:: with SMTP id dm6mr20935690edb.139.1605620941914; Tue, 17 Nov 2020 05:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620941; cv=none; d=google.com; s=arc-20160816; b=Dc/YLsj8Z181sRddNVdyxYSDNEADaalVhgCe5ArLVri8amgGaunJ7sjeWQQUba5uk0 lKINwWDzE0zOkcpefWUjkYHUgXH+8YZ3OZZp8xU/2nsuHajSlq2HKo1awrhHSWv4ALki eTvR/vnkflN+j/oRWVf2sQ2y6yAIZSIXUjkx0S/sclPbSv0/eTHwjd+pNWNrfDdm2C5W tW23H8bXtKlFsB/MFLZRURXow9P2wWQ6g8UqYT4isJkPQqd8x8S8Vx+Lz4G/Vv0um6aI XCy/MvSnC4EKxe31Mp4OASg6T8BAiqxnBYHOvS3wjwyxiMDqB4lQ9WaylXN2tBIu2KuN /N/w== 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=5QU426516gN5B7sidkCWDZ3OKQOV/oU0oHJW0VHpSkg=; b=CP/+CxvIolbHsJ/NodzFWNnQvKx7WffsJWIuFegxx1+KCZ/7pTWLim+kCY0MjCzCWH U1/ucJcC0gQyH4NmrK5xgm3Z/53UqdIMGUzQwYXK4V/F8pVksT5Q8lampoRrtcCmXJnq AKf36KC1POdzvkHCd0WVm87YWXfkCmFeX1iyL+5uz7/o0surxezgcd8KG/vIDAd00cHm WnfEyp2WB2+idU0x5iX61OITp6tSYtHXZLRfMHVcidrnmlAgnfbwY7IeHvUBjuGWp8To 1JfprLIGOUm5o96tTfH9mc4FcqUCgC7awyiiJa6bwh3XEp0X8XbcMqIk/SWL3Ck0hj1L 2Dow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rwMZLeyL; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 b26si14421865edy.172.2020.11.17.05.49.01; Tue, 17 Nov 2020 05:49:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-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=rwMZLeyL; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1732312AbgKQNrY (ORCPT + 15 others); Tue, 17 Nov 2020 08:47:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732786AbgKQNrV (ORCPT ); Tue, 17 Nov 2020 08:47:21 -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 5B3E2C061A4D for ; Tue, 17 Nov 2020 05:47:20 -0800 (PST) Received: by mail-qk1-x743.google.com with SMTP id y197so20302993qkb.7 for ; Tue, 17 Nov 2020 05:47:20 -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=5QU426516gN5B7sidkCWDZ3OKQOV/oU0oHJW0VHpSkg=; b=rwMZLeyLWttxc4XDjPnukiljhxU6HO3ndxtJOhGkDy8LDVIdx4DadyIdeZojxsuUDn KCrLXLoxruP5kULRvPuTwyt95lKqokIZq8M/ifyDy3PL15YgwVOPNK/i614h62o1x8CG /0qzdeWOJJb8Iz41v/PP7p78hdDdWUFQ3nSEWp4q7BKGOWLOjPk5uU9ZuLzsoeatHEru HrJNpafaix2c82oPFeM6675vuqdjyC0N0kYum1G60R614a4Gtlgb+hPpNNxZRMUn4wfw +eaDq/TtS9z97xWmDELh2yhTyQvMssgxjXvmKByEtIw12UjAy2zig7SwrIbtl0fQ6Pmh 9YDw== 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=5QU426516gN5B7sidkCWDZ3OKQOV/oU0oHJW0VHpSkg=; b=VXJpbesO+hQZCW7UihlvPBSxItdx7g7wZeIPl2eUn5f0dGvkdhqV1p5LNN2GQQDxSv /PJ5xPzv5GUjXEOuSIpQxaZYNgmgU5CbPjPz3RH57Av1mWxDVeO7SPhhd3fleA/ztktw ud86sej0o3eFiLqML3WvBcSeeTkfKY/GF+ZLf2qHnfiKNpqRm1JumamhiEwPKp+n5m1J h+mey32koKrhalK9MkGbyUrHAuCHxLQWeMMLkcSUnc9P7yT8WFlbkN1Ng/r6Jsf+cS8Z hqQVNmQ/Pk6coHQPZoX64TXxE8puOpJx0OYtJifmaCrGSpzR9SymWd7WgrUgSX0ovLQU +yIg== X-Gm-Message-State: AOAM530pwK8l8LFOd9TiTcyGkFv5Yxi2/xHrw3NlNXWnkaXPdDvbKX3D zFcY5P9EwR0gvVbiSDANL92sKA== X-Received: by 2002:a37:8c03:: with SMTP id o3mr3914007qkd.41.1605620839526; Tue, 17 Nov 2020 05:47:19 -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 t133sm14607355qke.82.2020.11.17.05.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:47:18 -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 3/6] drivers:crypto:qce: Enable support for crypto engine on sdm845. Date: Tue, 17 Nov 2020 08:47:11 -0500 Message-Id: <20201117134714.3456446-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201117134714.3456446-1-thara.gopinath@linaro.org> References: <20201117134714.3456446-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add support Qualcomm Crypto Engine accelerated encryption and authentication algorithms on sdm845. Signed-off-by: Thara Gopinath --- drivers/crypto/qce/core.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Bjorn Andersson 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 depended 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);