Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3868550pxb; Tue, 17 Nov 2020 05:48:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAj2dekurQ2lQtw55Dec+KRAc5nawHsOxqVcPAln3g2RUhtuQPtAK8/HKx9g2mtFrpnjNa X-Received: by 2002:a17:906:14d:: with SMTP id 13mr19346023ejh.516.1605620924044; Tue, 17 Nov 2020 05:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620923; cv=none; d=google.com; s=arc-20160816; b=Y729jCHjovpFklgsK7hY1nPZkZFllqHO5tWSSwwge803kYXSm7JGQx1h5kNwizQ/Dy xALD4N8KEt0XAOhNC2QJTPcc6Xzh97oHaAf2J7u6go/dCuPFq+cTGdn9aeKd81Kd2tBq MMiUSC4sUeLb0Ue69WFwnUrN6+cODsTJjrtqNZzytnjwwajN5xNIMPutAtgSno+0ZSP0 Guj04uvRt6pvKBfHg4QAWadUaZF/C/3qXMvKRlP/k84ICebO3m4vC5V0pU26rG3UH/eZ qDBu9GKvdI6qpizWo9jeJ9XXxSt88CC+r5T2oDZ/1ezDz1mbVT2FZB+xeGTj8CmdCrdE kr4w== 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=Z6tK493h8SVYg3MH2kyJOsUwbv6XWaVOBoisNMADa1mWj0+nlO7K1HnqcSyBWKPDDf J+zDTQ7PZR3n9Xh0wYVdDzEPCp7w48EiVeXh+vStb04G8JrdF7sdjjZgHqwEgvRhFglB gTpaX1npKdwjWrss3wJnr+J0Ixu9qptmNloRUDVhO4VAcTBjTnj5TCR7s07j/d5woGwt CW/ppbr4ulN8pmVme7wSOWrS17VU9oMHsJrJvbrDNCeYS2fN22P0RSygiq9CrDUUm5Jl fck9pJZn/uKvaAKXTEx/5QSP8CVKE7A3n/d1Fuescx7BcUxOMpMn6Z5yo4lWWPMiF4zO mIoQ== 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-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 a3si14360354edq.430.2020.11.17.05.48.20; Tue, 17 Nov 2020 05:48:43 -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=rwMZLeyL; 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 S2387712AbgKQNrk (ORCPT + 99 others); Tue, 17 Nov 2020 08:47:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387714AbgKQNrW (ORCPT ); Tue, 17 Nov 2020 08:47:22 -0500 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D032C061A52 for ; Tue, 17 Nov 2020 05:47:20 -0800 (PST) Received: by mail-qk1-x742.google.com with SMTP id q22so20332289qkq.6 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=UkrPuHwZNdIIqBcIFo2NRUzcM6QA/guRBeUtyny71o77OPDfn+awF1REvYXEchQ6wu rjjZAJYNPAh9Oc+ZxxPg6BuJyqRWZpjcfWqBn1C1jADfdjMbJyKGj9ivaMBU0CwlehOz AtlXPgW1z/1ptQWTFuPUtZxmU+WUZW15V30fhQijpOduNs8Mqac0PaBU+ilsCYl9qp14 lqMl2xyPNkuV6FvrZ0XNFNjsj1HWi8Pa6z3RT2EvZSMZHvJoEolkVSc4gXbe/lcpX5hF 5dXcg0x4QFJZ73/QIH+anQjBHcGw2vxmvMPyQz+C8jW22k6N7cWwssSCpD83qz7eiTDY sedw== X-Gm-Message-State: AOAM532JEa0dIIZosDbVa/mf10R1izyFWOGg5Abfv9F1ndAtVeCLF7xh hp89VOiSKhUmjeeZHehmwiQDzQ== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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(-) 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); -- 2.25.1