Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3108806rwb; Fri, 16 Dec 2022 10:09:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wqwiXbup9r9bEHWzi0nY4bbmPJDjJ3PGSJZeMzoNkuEzWVgSbCePpunxPPmkgnlG2pOip X-Received: by 2002:a05:6402:f0b:b0:46f:fe46:acec with SMTP id i11-20020a0564020f0b00b0046ffe46acecmr19434650eda.27.1671214198406; Fri, 16 Dec 2022 10:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671214198; cv=none; d=google.com; s=arc-20160816; b=JBGiVyrjr3DDkX/jDCDSERuDPlB4Lr/aDkXUVFoUwiHwNyJYLwqlw1PPisbZ2r0Ndv bGo4xnpmGtDtwD9EVkE+ycCNPMLwEMWDUP2b+xCUDChSD5AyoSaHaqX2BbmpICbl0yP/ X9KebCtYyFV3ksXaxLTUprR7GCgGb42nJM/cXBlTVBRrQbRPAiUEFRjj72Iw6mmqn659 no+FstASKO6fSuofqv9qx/tVM1d6t3PmeRlTJ6t0m5VVQGnYu4W2eYqBD+5EoAmiEe8n 21kFQSLxHdlGTZPwNovyRmv9m7nf1401p9e0+G1dwb5QOMiJYXBJ05pGunxsojga/X/5 mb1g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s29-20020a508d1d000000b0047012419bdcsi755921eds.517.2022.12.16.10.09.41; Fri, 16 Dec 2022 10:09:58 -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 + 68 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 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 -- 2.25.1