From patchwork Thu Sep 21 08:02:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gatien CHEVALLIER X-Patchwork-Id: 13393746 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 2CDECE706E3 for ; Thu, 21 Sep 2023 08:04:01 +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=XDw2/JmJislKyu9cdMx2t9bzaUlJp9GC1mq7WJlkSU0=; b=2hDYXTTKspXINT UOp04WLNglPzISWd7FbfsTgQQqaGulfdY0Oai94PhUR32xyvNwYjDHFXmdvIwyNxFpSbcfFQEvDWR y7aU3JqHzaNNDvKYqdhIOo3Z/Vzas9OzDOXGu5uM7BScJfUfYlORJqJg7+LsGoioUSnCIt24qweic OBvtwbLfdi9h1bxFLRGC4esKxW6IkJSdoFVsW3O/s9XiHDcfXXG6pt4scbQ1G1NYHVpfC7+ixnJ7n gBChpxBESnkucDU3/eHwA8+3oT9uR3vOQWPu7unU02kMuM88CVw+WawSsfmxYcwReLL7o5dcz67qJ Kxn6JviXCpeympuUIDsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjEet-005RRQ-07; Thu, 21 Sep 2023 08:03:35 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qjEeq-005RQ4-2E for linux-arm-kernel@lists.infradead.org; Thu, 21 Sep 2023 08:03:34 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38L52ATc018997; Thu, 21 Sep 2023 10:03:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=selector1; bh=xuMwQg6 e1Wn4J45HkR4xLWFNEWC3Wmj+tN4CFCgiioA=; b=3RU7hiF9MdRO82scr535kov XC1NRnLK3FUrv3mJ27BqDj2OHtrrwiQrJhA28/zPMrdqcDf4GjF6UnEiZ0Cp0dRp Da8fY3u9yXRrhz2V1BPoXZ7Pl7ew/jk8lYxBgzA2t1TClsvf19jbeGFxugYXmaMF PiMbnNYptMRKijM0BHrScp+EAx5rhwoyw2msVUDVjCsGiX/KtbTCsQhdynO4Y8HP x66iD3moQg0/ZXHUGV4qAl8FMqBoystoajnl/PCx9+EBsYIUc/TUj9Qnpe+1cUov 3BYqxa5RFCzsY0yyPhB/xO5SnJuu6fi1FOJ1W9YLwivECzjcAT/1ue6hzr25mBA= = Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3t7ybkm004-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Sep 2023 10:03:11 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EB06C100058; Thu, 21 Sep 2023 10:03:07 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E0A0320FA2A; Thu, 21 Sep 2023 10:03:07 +0200 (CEST) Received: from localhost (10.201.20.32) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 21 Sep 2023 10:03:07 +0200 From: Gatien Chevallier To: Olivia Mackall , Herbert Xu , Rob Herring , Krzysztof Kozlowski , Maxime Coquelin , Alexandre Torgue CC: Lionel Debieve , , , , , , Gatien Chevallier Subject: [PATCH v3 0/9] hwrng: stm32: support STM32MP13x platforms Date: Thu, 21 Sep 2023 10:02:52 +0200 Message-ID: <20230921080301.253563-1-gatien.chevallier@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.201.20.32] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-21_06,2023-09-20_01,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230921_010333_338852_4A6D7CBD X-CRM114-Status: GOOD ( 12.06 ) 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 The STM32MP13x platforms have a RNG hardware block that supports customization, a conditional reset sequences that allows to recover from certain situations and a configuration locking mechanism. This series adds support for the mentionned features. Note that the hardware RNG can and should be managed in the secure world for this platform, hence the rng not being default enabled on the STM32MP135F-DK board. Changes in V2: - Use pm_ptr() and add __maybe_unused on PM API - Correct bug using WARN_ON Changes in V3: - Squash of bindings patches - st,rng-lock-conf property declaration rework - Fix stm32_rng_pm_ops declaration in patch [5/9] Gatien Chevallier (9): dt-bindings: rng: introduce new compatible for STM32MP13x hwrng: stm32 - use devm_platform_get_and_ioremap_resource() API hwrng: stm32 - implement STM32MP13x support hwrng: stm32 - implement error concealment hwrng: stm32 - rework error handling in stm32_rng_read() hwrng: stm32 - restrain RNG noise source clock hwrng: stm32 - support RNG configuration locking mechanism hwrng: stm32 - rework power management sequences ARM: dts: stm32: add RNG node for STM32MP13x platforms .../devicetree/bindings/rng/st,stm32-rng.yaml | 20 +- arch/arm/boot/dts/st/stm32mp131.dtsi | 8 + drivers/char/hw_random/stm32-rng.c | 511 +++++++++++++++--- 3 files changed, 455 insertions(+), 84 deletions(-)