From patchwork Fri Apr 1 20:17:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 12798719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8696CC43217 for ; Fri, 1 Apr 2022 20:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JkB2YXTX37vjLbO94MDUvFqnkIw2HSdERxsfD+8pYPk=; b=AaPKqYLkIXhT8U jIxuFu4wra5IeRitHJVzbc/ABudssG3cP3RhX89gEqSF7FELhZ54V1e9G6Njo0mcEJzPGgKFGf2jU 917Bx3RP38mPKnz+81t3UqgDrp+pFKESNr/V3ouRtOVzopZ5uCf5dXu4ZYAqLRVW8i/Qa9dtuy017 R2sz4mDy2t6LOJdo0now+RWIwddKPxw0HdejnlTLDANUPEkkgg6155J4O2jN+Z1OLnSCobIqu5JDC J4UZsizG1HG6S8KFq89zloyL7AwQcnG+XIhdP9d7ljQhEtZkW2bTEfo0rE3c0ooHbed+x2h5DzCre fmRPJOL9e7pZn2tNRMgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1naNjC-0075DS-LP; Fri, 01 Apr 2022 20:18:38 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1naNiq-0074r8-5L for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2022 20:18:18 +0000 Received: by mail-wr1-x429.google.com with SMTP id a1so5763969wrh.10 for ; Fri, 01 Apr 2022 13:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DGCkJrK8CjpNQTEj6b9xsgDCufMl9t/fhMg36upVCms=; b=38Mjyy4PUG1qifiYjaGuBmEDmQ4cmC1Vw4iv4rSOVWiedsiaKCAgQ52NExOc1pE49w Pfx10onQLS+nade8OH/OngJw8Mwhu+Igi6N4asQGVuij6Au/8vRUk1VPSSuCbGLTfMag yO9pXlNGNQDXIcumWVkPfzz9S6fw2nwZs+tWyF5SpuvGQap4ze8OGlDit23nsgXqoQGU 7sJqivbmofTw/UXVRw8mKCmrD7zdGL7U55yAaSrRoQqgNw2gp4CQeBGCDkPG2QRGFuaA ebz16tPUHI/5QrSQP+zwxqlOw1tT3YDc1PqdAPFPwHtoo6LUJ62j4p0UQF3FZg7ygBar 1Usg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DGCkJrK8CjpNQTEj6b9xsgDCufMl9t/fhMg36upVCms=; b=MiqhRG6qYyK+jUalTjVClGw9AiacMjSZmx6Fd0PCx28ftURSAakrxHoX/L3J7fkTgD SlhUXbA9RgRZOSEujDLFD30/CxuFKIeto679Z2vs+Ar8xTQ09V83WclG/yo+0pqZeeg4 7Nl0afJ2CjV9DMm9W3se1axxrjEmp9RLulrw4LwskHLAx4SPuyUAnkO2AvseUAevT62y fBMlJjIW1nTieY8UGs11GTc5A8ICJt26Ta+igBBVWeQUXfYtJ8mFdwhvdTEd3GpnEmZ9 qGDscs6SoYpLqC/bOur6sHaPwckV3YJtRWcoNT0TPIJ0kErm+AQqk9uNh91OB4lxk+ZY 8e/Q== X-Gm-Message-State: AOAM5305TaYEITUBb99g/rJyKSPDvKgLOs1qjlb5L7+bK8Zj619nvnei wGdRxNpsBHTo5+/zkJefHOXxHQ== X-Google-Smtp-Source: ABdhPJxCCclvL39vPD0mGH4xeRxi6oEYQtYAcXEue88joWnUg/FnejMfCx7WSBAmHhxBXfdea8nR1A== X-Received: by 2002:adf:d1e5:0:b0:205:85f5:656c with SMTP id g5-20020adfd1e5000000b0020585f5656cmr8795652wrd.65.1648844290722; Fri, 01 Apr 2022 13:18:10 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id j16-20020a05600c191000b0038ca3500494sm17823838wmq.27.2022.04.01.13.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 13:18:10 -0700 (PDT) From: Corentin Labbe To: heiko@sntech.de, herbert@gondor.apana.org.au, krzk+dt@kernel.org, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Corentin Labbe Subject: [PATCH v4 00/33] crypto: rockchip: permit to pass self-tests Date: Fri, 1 Apr 2022 20:17:31 +0000 Message-Id: <20220401201804.2867154-1-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220401_131816_389019_2FE82415 X-CRM114-Status: GOOD ( 16.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello The rockchip crypto driver is broken and do not pass self-tests. This serie's goal is to permit to become usable and pass self-tests. This serie also adds support for 2 more SoCs. This whole serie is tested on a rk3328-rock64, rk3288-miqi with selftests (with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y) The serie is also tested on a rk3399 by Hugh Cole-Baker and Igor Velkov , Thanks to them for testing. Regards Changes since v1: - select CRYPTO_ENGINE - forgot to free fallbacks TFMs - fixed kernel test robots warning - add the PM patch Changes since v2: - Added DMA clock back to 3288 since it dont work without it - fallback needed to select CBC and ECB configs - Added support for rk3399 - Added more patch (style, read_poll_timeout) Changes since v3: - full rewrite of support for RK3399 - splited dt-binding patch in two Corentin Labbe (33): crypto: rockchip: use dev_err for error message about interrupt crypto: rockchip: do not use uninitialized variable crypto: rockchip: do not do custom power management crypto: rockchip: fix privete/private typo crypto: rockchip: do not store mode globally crypto: rockchip: add fallback for cipher crypto: rockchip: add fallback for ahash crypto: rockchip: better handle cipher key crypto: rockchip: remove non-aligned handling crypto: rockchip: rework by using crypto_engine crypto: rockchip: rewrite type crypto: rockchip: add debugfs crypto: rockchip: introduce PM crypto: rockchip: handle reset also in PM crypto: rockchip: use clk_bulk to simplify clock management crypto: rockchip: add myself as maintainer crypto: rockchip: use read_poll_timeout crypto: rockchip: fix style issue crypto: rockchip: add support for rk3328 crypto: rockchip: rename ablk functions to cipher crypto: rockchip: rework rk_handle_req function crypto: rockchip: use a rk_crypto_info variable instead of lot of indirection crypto: rockchip: use the rk_crypto_info given as parameter crypto: rockchip: rename crypto_info to main in TFM context crypto: rockchip: store crypto_info in request context crypto: rockchip: Add support for rk3399 dt-bindings: crypto: convert rockchip-crypto to yaml dt-bindings: crypto: rockchip: convert to new driver bindings clk: rk3399: use proper crypto0 name ARM: dts: rk3288: crypto does not need reset-names anymore arm64: dts: rockchip: add rk3328 crypto node arm64: dts: rockchip: rk3399: add crypto node crypto: rockchip: Check for clocks numbers and their frequencies .../crypto/rockchip,rk3288-crypto.yaml | 117 ++++ .../bindings/crypto/rockchip-crypto.txt | 28 - MAINTAINERS | 7 + arch/arm/boot/dts/rk3288.dtsi | 1 - arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 + arch/arm64/boot/dts/rockchip/rk3399.dtsi | 18 + drivers/crypto/Kconfig | 15 + drivers/crypto/rockchip/rk3288_crypto.c | 505 ++++++++-------- drivers/crypto/rockchip/rk3288_crypto.h | 99 +-- drivers/crypto/rockchip/rk3288_crypto_ahash.c | 256 +++++--- .../crypto/rockchip/rk3288_crypto_skcipher.c | 571 ++++++++++-------- include/dt-bindings/clock/rk3399-cru.h | 6 +- 12 files changed, 959 insertions(+), 674 deletions(-) create mode 100644 Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml delete mode 100644 Documentation/devicetree/bindings/crypto/rockchip-crypto.txt