From mboxrd@z Thu Jan 1 00:00:00 1970 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 57AB6C27C4F for ; Tue, 18 Jun 2024 21:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7R2zIVkttgawynmDjOMRLnd8AzpY7WCckj0OL06otS8=; b=ZpES7cpJtcWHgIqwX0cJhXmzKp Pph8mBM7t76kFG/4vCFehv/lHWfKazSWGnPhuybkZ5YJXGRlJb4aYWJflkdEFuj1ij0czmOHWgmRn vEr66eU+dnPu1FcC70ELQJHzlJhJl3DBBiWMv3xgUfwrkLXcPrscVLzRf1aG15sN0u/hce43SVxyv deNdxDQcaea80gNTOPpyIpp4nlCR4PltikNm3TssJ8yjO5fTrux/1I1neshzNpRZE+ziuYwHMLonX G2LZI0FIhQSxIzPaceS9EC8TjsB2YdeofbnL1I1sIjIT8oVMaEQvuuInBd0hXFFFS8KZYG7N9YnnH Y0jJjdgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJgNq-0000000Gfff-4198; Tue, 18 Jun 2024 21:28:54 +0000 Received: from [50.53.4.147] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJgNp-0000000Gff8-2UuT; Tue, 18 Jun 2024 21:28:53 +0000 Message-ID: Date: Tue, 18 Jun 2024 14:28:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/5] firmware: imx: adds miscdev To: Pankaj Gupta , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org References: <20240617-imx-se-if-v3-0-a7d28dea5c4a@nxp.com> <20240617-imx-se-if-v3-5-a7d28dea5c4a@nxp.com> Content-Language: en-US From: Randy Dunlap In-Reply-To: <20240617-imx-se-if-v3-5-a7d28dea5c4a@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 Hi-- On 6/17/24 12:29 AM, Pankaj Gupta wrote: > Adds the driver for communication interface to secure-enclave, > for exchanging messages with NXP secure enclave HW IP(s) like > EdgeLock Enclave from: > - User-Space Applications via character driver. > > ABI documentation for the NXP secure-enclave driver. > > User-space library using this driver: > - i.MX Secure Enclave library: > -- URL: https://github.com/nxp-imx/imx-secure-enclave.git, > - i.MX Secure Middle-Ware: > -- URL: https://github.com/nxp-imx/imx-smw.git > > Signed-off-by: Pankaj Gupta > --- > Documentation/ABI/testing/se-cdev | 42 +++ > drivers/firmware/imx/ele_common.c | 153 ++++++++- > drivers/firmware/imx/ele_common.h | 4 + > drivers/firmware/imx/se_ctrl.c | 694 ++++++++++++++++++++++++++++++++++++++ > drivers/firmware/imx/se_ctrl.h | 49 +++ > include/uapi/linux/se_ioctl.h | 94 ++++++ > 6 files changed, 1034 insertions(+), 2 deletions(-) > > diff --git a/Documentation/ABI/testing/se-cdev b/Documentation/ABI/testing/se-cdev > new file mode 100644 > index 000000000000..699525af6b86 > --- /dev/null > +++ b/Documentation/ABI/testing/se-cdev > @@ -0,0 +1,42 @@ > +What: /dev/_mu[0-9]+_ch[0-9]+ > +Date: May 2024 > +KernelVersion: 6.8 > +Contact: linux-imx@nxp.com, pankaj.gupta@nxp.com > +Description: > + NXP offers multiple hardware IP(s) for secure-enclaves like EdgeLock- for secure enclaves > + Enclave(ELE), SECO. The character device file-descriptors file descriptors and what is SECO? > + /dev/_mu*_ch* are the interface between user-space NXP's secure- userspace secure > + enclave shared-library and the kernel driver. shared library > + > + The ioctl(2)-based ABI is defined and documented in > + [include] > + ioctl(s) are used primarily for: > + - shared memory management > + - allocation of I/O buffers > + - get mu info - getting mu info > + - setting a dev-ctx as receiver that is slave to fw > + - get SoC info - getting SoC info > + > + The following file operations are supported: > + > + open(2) > + Currently the only useful flags are O_RDWR. > + > + read(2) > + Every read() from the opened character device context is waiting on > + wakeup_intruptible, that gets set by the registered mailbox callback typo in that name? or is it something that this patch series introduces? > + function; indicating a message received from the firmware on message- function, > + unit. > + > + write(2) > + Every write() to the opened character device context needs to acquire > + mailbox_lock, before sending message on to the message unit. mailbox_lock before > + > + close(2) > + Stops and free up the I/O contexts that was associated frees up that were associated > + with the file descriptor. > + > +Users: https://github.com/nxp-imx/imx-secure-enclave.git, > + https://github.com/nxp-imx/imx-smw.git > + crypto/skcipher, > + drivers/nvmem/imx-ocotp-ele.c -- ~Randy