Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1755021pxj; Wed, 19 May 2021 13:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZlDB+VT9lxtfqQoOcM67C2/pxX1qjPrUPwkKYj+CRWaDigx++lPJe1cievYhYKN0ts0b/ X-Received: by 2002:a92:1e0f:: with SMTP id e15mr959598ile.265.1621454977343; Wed, 19 May 2021 13:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621454977; cv=none; d=google.com; s=arc-20160816; b=HeyReCNZuDSXht+uPfzy/5F2mjgtVa37QPDzIdO1wG7+iRgAHCS3ICSi7fd/Ym195s Q2Hp0iXzCBDRYaDefCk9dGyr3ytEAyD8Xtjz2NYktgqM/ktu2jWyMO2ds1LJVPrhF5jd pY7IDY0dtbnajvN522W3GZyMnl6ep3d97mV2hgRNDpGdoCbJYdp/r9CG8OYI1cjDTAHE JnN+lPRjOml/i0xQScMC+Koi5Bauw8JtOf34I+3n8Q2UjnB1qEyEwzZl7SU8H6/cynuL 2b4zuDAM/07Kxvr1HVWbjxBy+xnH0BzMUlQjDuQkjcNb2wbyEi9gxgQZTaDgREFrt/ou Tu6Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=nZMq8xWSXZHjYFFX9U2EDQv78qoTWHbTqwBMbdQQv0s=; b=XQ3yPy92GlAibo30tMuh7GFSLuO3GaolET02G6NdWC+vUBMhCoGnYvq0WHtoqM/37k U2SncBeYee8BxgAwkunDirgbNTmqWFjVYTF3y36UkE2+0G3cJjN7TpfMcgk4vsZxAQAS bPCsq7a+0vtswHJyWto7x3WflsKrwkDw+xQSDa2gf8oW9tNnFCRjGpjJAY6xmEFULYgG HullR6/SHQSxgyngn2ScO8CUw6XUyP1/sMtRyI4hp/LP3JcXYNkOcqSKTDT2RA2EYyos mwZIShPck3iyDDCyrRu+jU0TkgZdhewGQtmKkiaexaCt3WnbTE93bq8wO3dxsfhi6r9P MleA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lVsbFM6a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 v6si325892jas.16.2021.05.19.13.09.24; Wed, 19 May 2021 13:09:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=lVsbFM6a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1347786AbhESOip (ORCPT + 99 others); Wed, 19 May 2021 10:38:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242135AbhESOio (ORCPT ); Wed, 19 May 2021 10:38:44 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C195C061761 for ; Wed, 19 May 2021 07:37:24 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id p6so7135637plr.11 for ; Wed, 19 May 2021 07:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nZMq8xWSXZHjYFFX9U2EDQv78qoTWHbTqwBMbdQQv0s=; b=lVsbFM6aeHV9QO0yMWIoUEsFvuZICTWzjhH06XiLX53vIJd5fOltlBQU1AsHgkhC7b GU7k6gSGN0lQBG7GaWR3AXAnUcQMwsq433ErObGTb6pDseELCOfit4GmF45i6IK022NF M+m7ctX0SDRhPS+HjsgbUljOhedYqSDTR0Pi7DN1iY821hWBTzJRccUOL7JfRceTEhVm WiUIbNY+lmeBWXgJiDm5Bwzu0VW1qgp0cDMdjjim4TeuzJzCwjGTtf4WhgkqrvH6NwRG gT/bcRL0+NO+q5WxqSE5QH4O5aVBTDe0mV1ytUVtiFZLkjVcha+EmZ/cETYMz3SYJzbG gh5w== 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:mime-version :content-transfer-encoding; bh=nZMq8xWSXZHjYFFX9U2EDQv78qoTWHbTqwBMbdQQv0s=; b=ODzYSwFmF5SxnU31eYHP7/SXHb0ufS2KdW64XcLhkS/yWBjqkyM4Ud2Djqh3yJ/cf6 3QsoIOCj1dZF+PNJ0WVewg99ZKgamYj5L7lyngROWwQZ4ppC7z3jiv12b4jgW3NHSekN SLysUTOZjBM1oftIvOOrb5xDC/Sq0n5dEIenW/wZlZsmSdYiJMt0pUGWjxkLVXtQMW0k dOF+WVwY0IrtMCLXgv3ElU+9g/hvu3dzCKbXuMt5W4hAhQpSolBLu8GVWYCTcfAwOrd9 Hh3KsZIkx/fkFIVp8SkOVme1Vf8GGio5YFJwhtPdbZFcay5VI3Lh23h24Htb6GOcpyAu sEJA== X-Gm-Message-State: AOAM5331pUVWSUdyLyBeA1ficHfQusUejzByqUH6b/4lgT1/rOFT20ul 9cdDslbWpZZr5oaVxtXHX5l4PLUloE8o8Q== X-Received: by 2002:a17:90a:f87:: with SMTP id 7mr12090307pjz.38.1621435043946; Wed, 19 May 2021 07:37:23 -0700 (PDT) Received: from localhost.localdomain.name ([122.177.135.250]) by smtp.gmail.com with ESMTPSA id o24sm9239515pgl.55.2021.05.19.07.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 07:37:23 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, Thara Gopinath , Bjorn Andersson , Rob Herring , Andy Gross , Herbert Xu , "David S . Miller" , Stephen Boyd , Michael Turquette , Vinod Koul , dmaengine@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com Subject: [PATCH v3 00/17] Enable Qualcomm Crypto Engine on sm8250 Date: Wed, 19 May 2021 20:06:43 +0530 Message-Id: <20210519143700.27392-1-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v2: ================= - v2 can be seen here: https://lore.kernel.org/dmaengine/20210505213731.538612-1-bhupesh.sharma@linaro.org/ - Drop a couple of patches from v1, which tried to address the defered probing of qce driver in case bam dma driver is not yet probed. Replace it instead with a single (simpler) patch [PATCH 16/17]. - Convert bam dma and qce crypto dt-bindings to YAML. - Addressed review comments from Thara, Bjorn, Vinod and Rob. Changes since v1: ================= - v1 can be seen here: https://lore.kernel.org/linux-arm-msm/20210310052503.3618486-1-bhupesh.sharma@linaro.org/ - v1 did not work well as reported earlier by Dmitry, so v2 contains the following changes/fixes: ~ Enable the interconnect path b/w BAM DMA and main memory first before trying to access the BAM DMA registers. ~ Enable the interconnect path b/w qce crytpo and main memory first before trying to access the qce crypto registers. ~ Make sure to document the required and optional properties for both BAM DMA and qce crypto drivers. ~ Add a few debug related print messages in case the qce crypto driver passes or fails to probe. ~ Convert the qce crypto driver probe to a defered one in case the BAM DMA or the interconnect driver(s) (needed on specific Qualcomm parts) are not yet probed. Qualcomm crypto engine is also available on sm8250 SoC. It supports hardware accelerated algorithms for encryption and authentication. It also provides support for aes, des, 3des encryption algorithms and sha1, sha256, hmac(sha1), hmac(sha256) authentication algorithms. Tested the enabled crypto algorithms with cryptsetup test utilities on sm8250-mtp and RB5 board (see [1]) and also with crypto self-tests, including the fuzz tests (CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y). While at it, also make a minor fix in 'sdm845.dtsi', to make sure it confirms with the other .dtsi files which expose crypto nodes on qcom SoCs. Note that this series is rebased on AEAD fixes from Thara (see [2]). This is required for all of the fuzz tests to work. [1]. https://linux.die.net/man/8/cryptsetup [2]. https://lore.kernel.org/linux-crypto/20210429150707.3168383-5-thara.gopinath@linaro.org/T/ Cc: Thara Gopinath Cc: Bjorn Andersson Cc: Rob Herring Cc: Andy Gross Cc: Herbert Xu Cc: David S. Miller Cc: Stephen Boyd Cc: Michael Turquette Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: linux-crypto@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: bhupesh.linux@gmail.com Bhupesh Sharma (14): dt-bindings: qcom-bam: Convert binding to YAML dt-bindings: qcom-bam: Add 'interconnects' & 'interconnect-names' to optional properties dt-bindings: qcom-bam: Add 'iommus' to required properties dt-bindings: qcom-qce: Convert bindings to yaml dt-bindings: qcom-qce: Add 'interconnects' and move 'clocks' to optional properties dt-bindings: qcom-qce: Add 'iommus' to required properties arm64/dts: qcom: sdm845: Use RPMH_CE_CLK macro directly dt-bindings: crypto : Add new compatible strings for qcom-qce arm64/dts: qcom: Use new compatibles for crypto nodes crypto: qce: Add new compatibles for qce crypto driver crypto: qce: Print a failure msg in case probe() fails crypto: qce: Convert the device found dev_dbg() to dev_info() crypto: qce: Defer probing if BAM dma channel is not yet initialized arm64/dts: qcom: sm8250: Add dt entries to support crypto engine. Thara Gopinath (3): dma: qcom: bam_dma: Add support to initialize interconnect path crypto: qce: core: Add support to initialize interconnect path crypto: qce: core: Make clocks optional .../devicetree/bindings/crypto/qcom-qce.txt | 25 ---- .../devicetree/bindings/crypto/qcom-qce.yaml | 92 +++++++++++++++ .../devicetree/bindings/dma/qcom_bam_dma.txt | 50 -------- .../devicetree/bindings/dma/qcom_bam_dma.yaml | 110 ++++++++++++++++++ arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 28 +++++ drivers/crypto/qce/core.c | 110 ++++++++++++------ drivers/crypto/qce/core.h | 3 + drivers/dma/qcom/bam_dma.c | 10 ++ 10 files changed, 322 insertions(+), 114 deletions(-) delete mode 100644 Documentation/devicetree/bindings/crypto/qcom-qce.txt create mode 100644 Documentation/devicetree/bindings/crypto/qcom-qce.yaml delete mode 100644 Documentation/devicetree/bindings/dma/qcom_bam_dma.txt create mode 100644 Documentation/devicetree/bindings/dma/qcom_bam_dma.yaml -- 2.31.1