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 2F9F0C27C4F for ; Tue, 18 Jun 2024 21:39:24 +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:References:Cc:To:From: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=o8G8ifLXVT/4fr2bGcys3dHGbQ+B9Z7Bqubv+Pu8ANc=; b=pAsymh9UeIJkLytd6tk3qrILtO PCYKGAZbcVoJQVSiDExkrNrDjwyoHbESgl4UcdIFRYFixmjWHwTbZAoU9fvby14oetR1gHPIZstCi oT7QKhi9b4WoC49I8MUSAbzrdwYUA4RGTdZmDH1IVq0UnTwCqbko1/w8Qo8pI1yuNsRQrKbXJpKe+ ZwDnBSqr/W9r5iEokV39nJEwI8cKvFRWTNUv9TB1egdhFHW7zhBff5Q/eNxMfVmCHRImMN7yHAQAf bWio0E8+3SKBRvZWlBkybCCPksWC9OJJrJ47ewF8D6UBt+FEgApMAT33kUqLCQ6sve7p6UZ3Gj7na BgYiSWTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJgXq-0000000GhYI-1rPo; Tue, 18 Jun 2024 21:39:14 +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 1sJgXo-0000000GhXx-3pHy; Tue, 18 Jun 2024 21:39:13 +0000 Message-ID: Date: Tue, 18 Jun 2024 14:39:11 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/5] firmware: imx: adds miscdev From: Randy Dunlap 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 In-Reply-To: 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 Sorry, I missed one comment here: On 6/18/24 2:28 PM, Randy Dunlap wrote: > 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 Documentation/process/coding-style.rst says not to introduce new uses of the word "slave": For symbol names and documentation, avoid introducing new usage of 'master / slave' (or 'slave' independent of 'master') and 'blacklist / whitelist'. Recommended replacements for 'master / slave' are: '{primary,main} / {secondary,replica,subordinate}' '{initiator,requester} / {target,responder}' '{controller,host} / {device,worker,proxy}' 'leader / follower' 'director / performer' >> + - 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