From patchwork Tue Jan 10 19:19:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13095579 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 C07A2C54EBC for ; Tue, 10 Jan 2023 19:21:22 +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:Cc:To:MIME-Version:Message-Id:Date: Subject: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=AsRxJplSofaqhis3vO56V99/HsFlDj52wEUwHCV6qXQ=; b=iMs3QwLid+9Nd2 JhLcWobGAlSzEzJurbUBzoctiMTH+7yLHApUqpTTm7LUEu8+YjHiwarHK/1Fx5n4O+oJZmxsjDEYo 44x1RNcUjRkGzlarWhCvyA2c2hxK+vVWVsvOhNWExStpsyOOh/zMUS+wiMS8kd096FTfYdx57bk8w zzGR21VraWxMX0t4FCOFphqVXyxGfDHS1LCFlBhQAaOXfNCaXVIEkOjSZ8uLbxIx6kgi/HzSSnkGF HlZNAvzxcTu6AoTbY7Qxpen6XlDRj9pIbOupUICUwQGsTIPHpPzTKuhHsvAl3MyDggR/iayKXDAYr 1RTsimZSWb8sPeLtfGRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFKAQ-008FS3-E1; Tue, 10 Jan 2023 19:20:14 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFK9r-008FI8-I2 for linux-arm-kernel@lists.infradead.org; Tue, 10 Jan 2023 19:19:41 +0000 Received: by mail-lf1-x132.google.com with SMTP id bt23so19981666lfb.5 for ; Tue, 10 Jan 2023 11:19:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=/o0PiJuOvWG4Quan3s3nxBl5R0QTcNbdsB/Kd9BP1AQ=; b=QvzRMTn4hye8yVLEuaUkyDFux8Hpv0eajm0LJm8GMTintGJx+1ujiclNrF/I6qEjJU dOs8yppVqBnHrv1mx2QAR6aePZxGxJxGTx1kMx2/NuONqaB3kaoyEgb1/R1O0cbmlqq2 MtLTJ3vRqkxhzKkZS8c4etDgliJhzAXncvhubP6lkn11eNlyzHzV9gmIXnGoraF0dHuE omYXoRbzy0s3gLJEsdyKhI5BjryhaKblv09V7MQ+nrfi2jDCG0iIUbVEDetBsJBm5W8i txmuARCMDcCayPSmkKW00ELukdHIX40msCknwZCd3F92GI1fHpYKdcagynhNhw837Tvo MXFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/o0PiJuOvWG4Quan3s3nxBl5R0QTcNbdsB/Kd9BP1AQ=; b=vB6/B/5TcFq56Sez5HEaN6BR/iE+ETs5qvj5T0u0T6GrZuYA2Gw/3ax2JYq0ZG4XKA 4nUt+o4v4jke7gmoPJ3kz6vnss2prF8I9o69/77YmosxQpJF+TkEAfba2jsLY86KqQv4 iD6FwRTEfr3DmXHF9OEvEmR2eMSrRMEpFIKol9FBneEbUzM7s+6WvMfg8ViKI2KxD3zz ECIGM2zgQ+Vsx8tiguMWFqhhWNkLXCIg10bKiJAwuPRpiMLq8zJ76Ym1wkwrIQ/w1hY5 A3r2gnv2j2uumX5QGbaQAdNQ7zFG3Y3XzRhSXxN3Nx7hdt8rcG5tTPeLw2EL+tPkiV/h sNYw== X-Gm-Message-State: AFqh2kpsqklfgJyLMuVhInr6aHYilASuBV35v3dHWR1aKWp9eWdsKC/i USK9frylU6b4ZOORqyF4Op/+/A== X-Google-Smtp-Source: AMrXdXs6/SKNTCtGaClH++pUygPpcPqjxV2jEl7EmmiQq3LniMkvdIeZ5Ilrb8zDWZHWjgRBe05fTw== X-Received: by 2002:a05:6512:693:b0:4cc:96fc:7b5d with SMTP id t19-20020a056512069300b004cc96fc7b5dmr78374lfe.52.1673378373701; Tue, 10 Jan 2023 11:19:33 -0800 (PST) Received: from Fecusia.local (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id x28-20020a056512131c00b004b549ad99adsm2297725lfu.304.2023.01.10.11.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 11:19:33 -0800 (PST) From: Linus Walleij Subject: [PATCH v2 0/6] crypto: stm32 hash - reuse for Ux500 Date: Tue, 10 Jan 2023 20:19:12 +0100 Message-Id: <20221227-ux500-stm32-hash-v2-0-bc443bc44ca4@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADC6vWMC/32OQQ6CMBREr0K6tqb9IIgr72FYlPKhTbQl/ZVAC He3oGuXbzIvMysjDBaJ3bKVBZwsWe8SwClj2ig3ILddYgYCQAJU/D1fhOAUXzlwo8jwGhHKa15A DT1LWqsIeRuU02YXv/2IFH+SDsu498aAvZ2P6UeT2FiKPizHk0nu6Z/RSXLB2zKvlC50p4S8P61 TwZ99GFizbdsHIyAPqtkAAAA= To: Herbert Xu , "David S. Miller" , Rob Herring , Krzysztof Kozlowski , Maxime Coquelin , Alexandre Torgue , Lionel Debieve Cc: linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.11.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230110_111939_626252_ABA5A3D5 X-CRM114-Status: GOOD ( 15.22 ) 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 By taking some small portions of the Ux500 HASH driver and adding to the STM32 driver, it turns out we can support both platforms with the more modern STM32 driver. The STM32 driver is more modern and compact thanks to using things like the crypto engine. We add a polled mode since the Ux500 does not have any interrupt. Incidentally, this could perhaps be re-used to implement synchronous mode, if this is desireable. To: Herbert Xu To: "David S. Miller" To: Rob Herring To: Krzysztof Kozlowski To: Maxime Coquelin To: Alexandre Torgue To: Lionel Debieve Cc: linux-crypto@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Linus Walleij --- Changes in v2: - Use an else-clause in the DT bindings. - Fix up issues pointed out by Lionel in the driver extension. - Dropped the patch converting dma_mode to a bool after Lionel explained how this works. - Link to v1: https://lore.kernel.org/r/20221227-ux500-stm32-hash-v1-0-b637ac4cda01@linaro.org --- Linus Walleij (6): dt-bindings: crypto: Let STM32 define Ux500 HASH crypto: stm32/hash: Simplify code crypto: stm32/hash: Use existing busy poll function crypto: stm32/hash: Wait for idle before final CPU xmit crypto: stm32/hash: Support Ux500 hash crypto: ux500/hash - delete driver .../devicetree/bindings/crypto/st,stm32-hash.yaml | 23 +- drivers/crypto/Kconfig | 10 - drivers/crypto/Makefile | 1 - drivers/crypto/stm32/stm32-hash.c | 243 ++- drivers/crypto/ux500/Kconfig | 22 - drivers/crypto/ux500/Makefile | 7 - drivers/crypto/ux500/hash/Makefile | 11 - drivers/crypto/ux500/hash/hash_alg.h | 398 ---- drivers/crypto/ux500/hash/hash_core.c | 1966 -------------------- 9 files changed, 227 insertions(+), 2454 deletions(-) --- base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2 change-id: 20221227-ux500-stm32-hash-9ee26834292f Best regards,