From patchwork Fri Dec 16 17:43:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 3032 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1108654wrn; Fri, 16 Dec 2022 09:51:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXunJaaLRawSpZaovGEXxAftgo6tvFoLw0ytc2o5UK3K1wI/jfjSaVrW+DKogmIIqWZnH5Jr X-Received: by 2002:a05:6402:1f05:b0:475:32d2:7992 with SMTP id b5-20020a0564021f0500b0047532d27992mr4243704edb.12.1671213107844; Fri, 16 Dec 2022 09:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671213107; cv=none; d=google.com; s=arc-20160816; b=k/aMtEBYMzcaL0tDoiJo2lIlLY6WmvbC0UTKYP2pf7VN4rgRmMmoc6FWwtuJmoZruL 5paH4VfkpIzdWvmcdFUdqI6MAPni2g2qQ2eMQeO0/+ljrvweZoWbxakWJDMPh+10jFP9 KDRPO5u4BSEGI6y5eB0Zi59DGyDsdc/FLCnRIIVFf4crp8J+YbsdNmn4S6VGoT09WaHT JevWOhtEqrcG4syQKf2qqgpJbkXF9iSoduQ9LvGQ3A+UnqTjRbB7+PKzQYN/sE3g+0I7 EvLmLN0jJpKAB9/GNNxkQUO6nqX5oXH8FdvrLsnQvTKO7w+MBIKRbKatdxOalA0DROYz MYoQ== 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=MCcVOkRSymvXxWC37Ec62dZO+I/+VLBAoTYDVT638DU=; b=cU3p4AsHYzhUbX9uzNjc/jMilbAl/VnlFWhvD2nqkeqKpcY6NOeAKqD6735coytOrX vXecbTB1wovw4+jyN/zxGeyOH73ki475aFTBixIcKaLQYmd2yU4JN5haLHltrc1TbVqU zw3xIdEoHe/hxqs/iMEKb54hLAyjoEfT+kgcrqRH9zrqQNrZYXrTJTACGSc+e0cQxTwi ylmYCiVNs2u1lMds4zuOPndi11Ld2hdZdfrjDtMF2Vr+XlneE3ImQi+RUbQ1Jt34mKOH of00EPpQkx2pF1h/fz3BbkiLfrMjX4IuB0ME0pYqMFJaglFgfJnXOW3+oPQ6PwVIg12h Suhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=7vOsTS61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a0564021f8d00b00469dd6e394asi2858602edc.579.2022.12.16.09.51.24; Fri, 16 Dec 2022 09:51:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=7vOsTS61; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229547AbiLPRoM (ORCPT + 99 others); Fri, 16 Dec 2022 12:44:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbiLPRoB (ORCPT ); Fri, 16 Dec 2022 12:44:01 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32B346F0DD; Fri, 16 Dec 2022 09:44:00 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGD3FLH030740; Fri, 16 Dec 2022 18:43:41 +0100 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=MCcVOkRSymvXxWC37Ec62dZO+I/+VLBAoTYDVT638DU=; b=7vOsTS610mpH+u56CpviU+oNiRU3FIKCg4eQ4G3XaV/uoEvAHYoWhcQBYWZhOc7uVkQH +CJULM0I/qrWvg3jgtnf4ujwJm98wK3jqnG4pYmFYP6aRc7WIgR9WG8zxQ0lrpf6QQQL pGAkbXxqvH7DQQspAj/kKmjoSd2Cj8z9l5AlX3JC431JlqZ3h1m/G/u7g4cRpO+Z51HQ GwqEandcRSau0rxNZbGWJNE8MypqmpXAj/oKa4Jx9AFaUG8kIBcEw2T0MwZ2N3VJn+Ad 9vBanHEJ038Fdy7ZaRwm+vONUsZoXtcfqtt2/g14cD1BXr3On0MzxjPVKjG4+BD1UxhK PA== 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 3mf6utkhx6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 18:43:41 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A6FFF10002A; Fri, 16 Dec 2022 18:43:35 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A0C2522D19D; Fri, 16 Dec 2022 18:43:35 +0100 (CET) Received: from localhost (10.48.0.157) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Fri, 16 Dec 2022 18:43:35 +0100 From: Patrick Delaunay To: Alexandre TORGUE , Rob Herring , Krzysztof Kozlowski , Maxime Coquelin , Srinivas Kandagatla CC: Fabrice GASNIER , Amelie DELAUNAY , Lionel DEBIEVE , Etienne CARRIERE , Patrick Delaunay , , , , Subject: [PATCH v3 0/3] nvmem: stm32: add OP-TEE support for STM32MP13x Date: Fri, 16 Dec 2022 18:43:26 +0100 Message-ID: <20221216174330.1506454-1-patrick.delaunay@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.48.0.157] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_12,2022-12-15_02,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752393872214669508?= X-GMAIL-MSGID: =?utf-8?q?1752393956097376842?= This serie update the NVMEM BSEC driver to be compatible with STM32MP13x SoC and the trusted application STM32MP BSEC in OP-TEE This serie solve issue in initial support of STM32MP131 (using BSEC STM32MP15 compatible) and so it break the STM32MP13x DTS compatible. I create this serie for more efficient review, including support for STM32MP15x. The first patches of the V1 series is already merged: "dt-bindings: nvmem: add new stm32mp13 compatible for stm32-romem" This STM32MP13x DTS break is acceptable as - the STM32MP13x SoC is not yet available outside STMicroelectronics (not official) - the same patch is already integrated or modifications are in progress in the other users (arm-trusted-firmware/TF-A, OP-TEE and U-Boot) of stm32mp131 device tree. It is the good time to correct this issue before the real availability of the SoC and before full support of STM32MP13x SoC in Linux kernel. Regards Patrick Changes in v3: - add a separate file stm32-bsec-optee-ta.c with STM32MP BSEC TA communication functions to avoid #if in romem driver. - use of_find_compatible_node in optee_presence_check function instead of of_find_node_by_path("/firmware/optee") Changes in v2: - rebase series on linux-next/master - minor update after V1 revue Changes in v1: - update commit message to indicate DTS break reason. Patrick Delaunay (3): ARM: dts: stm32mp13: fix compatible for BSEC nvmem: stm32: add OP-TEE support for STM32MP13x nvmem: stm32: detect bsec pta presence for STM32MP15x arch/arm/boot/dts/stm32mp131.dtsi | 2 +- drivers/nvmem/Kconfig | 11 + drivers/nvmem/Makefile | 1 + drivers/nvmem/stm32-bsec-optee-ta.c | 298 ++++++++++++++++++++++++++++ drivers/nvmem/stm32-bsec-optee-ta.h | 80 ++++++++ drivers/nvmem/stm32-romem.c | 84 +++++++- 6 files changed, 472 insertions(+), 4 deletions(-) create mode 100644 drivers/nvmem/stm32-bsec-optee-ta.c create mode 100644 drivers/nvmem/stm32-bsec-optee-ta.h