mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pankaj Gupta <pankaj.gupta@nxp.com>
To: Krzysztof Kozlowski <krzk@kernel.org>, Frank Li <frank.li@nxp.com>
Cc: Jonathan Corbet <corbet@lwn.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [EXT] Re: [PATCH v20 3/7] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Fri, 12 Dec 2025 09:07:12 +0000	[thread overview]
Message-ID: <AM9PR04MB86046ACCE6AF2BE7099FD3AE95AEA@AM9PR04MB8604.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <48d5895d-fde0-4795-8049-788fa3171fde@kernel.org>

> >>> NXP hardware IP(s) for secure-enclaves like Edgelock Enclave(ELE),
> >>> are embedded in the SoC to support the features like HSM, SHE & V2X,
> >>> using message based communication interface.
> >>>
> >>> The secure enclave FW communicates with Linux over single or
> >>> multiple dedicated messaging unit(MU) based interface(s).
> >>> Exists on i.MX SoC(s) like i.MX8ULP, i.MX93, i.MX95 etc.
> >>>
> >>> For i.MX9x SoC(s) there is at least one dedicated ELE MU(s) for each
> >>> world - Linux(one or more) and OPTEE-OS (one or more).
> >>>
> >>> Other dependent kernel drivers will be:
> >>> - NVMEM: that supports non-volatile devices like EFUSES,
> >>>          managed by NXP's secure-enclave.
> >>>
> >>> Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
> >>> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> >>> ---
> >>>  drivers/firmware/imx/Kconfig        |  13 ++
> >>>  drivers/firmware/imx/Makefile       |   2 +
> >>>  drivers/firmware/imx/ele_base_msg.c | 269
> ++++++++++++++++++++++++
> >>> drivers/firmware/imx/ele_base_msg.h |  95 +++++++++
> >>>  drivers/firmware/imx/ele_common.c   | 333
> ++++++++++++++++++++++++++++++
> >>>  drivers/firmware/imx/ele_common.h   |  45 ++++
> >>>  drivers/firmware/imx/se_ctrl.c      | 401
> ++++++++++++++++++++++++++++++++++++
> >>>  drivers/firmware/imx/se_ctrl.h      |  86 ++++++++
> >>>  include/linux/firmware/imx/se_api.h |  14 ++
> >>>  9 files changed, 1258 insertions(+)
> >>>
> >>> diff --git a/drivers/firmware/imx/Kconfig
> >>> b/drivers/firmware/imx/Kconfig index 127ad752acf8..5fe96299b704
> >>> 100644
> >>> --- a/drivers/firmware/imx/Kconfig
> >>> +++ b/drivers/firmware/imx/Kconfig
> >>> @@ -55,3 +55,16 @@ config IMX_SCMI_MISC_DRV
> >>>       core that could provide misc functions such as board control.
> >>>
> >>>       This driver can also be built as a module.
> >>> +
> >>> +config IMX_SEC_ENCLAVE
> >>> +   tristate "i.MX Embedded Secure Enclave - EdgeLock Enclave Firmware
> driver."
> >>> +   depends on IMX_MBOX && ARCH_MXC && ARM64
> >>> +   select FW_LOADER
> >>> +   default m if ARCH_MXC
> >>> +
> >>> +   help
> >>> +     Exposes APIs supported by the iMX Secure Enclave HW IP called:
> >>> +     - EdgeLock Enclave Firmware (for i.MX8ULP, i.MX93),
> >>> +       like base, HSM, V2X & SHE using the SAB protocol via the shared
> Messaging
> >>> +       Unit. This driver exposes these interfaces via a set of file descriptors
> >>> +       allowing to configure shared memory, send and receive messages.
> >>> diff --git a/drivers/firmware/imx/Makefile
> >>> b/drivers/firmware/imx/Makefile index 3bbaffa6e347..4412b15846b1
> >>> 100644
> >>> --- a/drivers/firmware/imx/Makefile
> >>> +++ b/drivers/firmware/imx/Makefile
> >>> @@ -4,3 +4,5 @@ obj-$(CONFIG_IMX_SCU)               += imx-scu.o misc.o
> imx-scu-irq.o rm.o imx-scu-soc.o
> >>>  obj-${CONFIG_IMX_SCMI_CPU_DRV}     += sm-cpu.o
> >>>  obj-${CONFIG_IMX_SCMI_MISC_DRV}    += sm-misc.o
> >>>  obj-${CONFIG_IMX_SCMI_LMM_DRV}     += sm-lmm.o
> >>> +sec_enclave-objs           = se_ctrl.o ele_common.o ele_base_msg.o
> >>> +obj-${CONFIG_IMX_SEC_ENCLAVE}      += sec_enclave.o
> >>> diff --git a/drivers/firmware/imx/ele_base_msg.c
> >>> b/drivers/firmware/imx/ele_base_msg.c
> >>> new file mode 100644
> >>> index 000000000000..a070acbd895c
> >>> --- /dev/null
> >>> +++ b/drivers/firmware/imx/ele_base_msg.c
> >>> @@ -0,0 +1,269 @@
> >>> +// SPDX-License-Identifier: GPL-2.0+
> >>> +/*
> >>> + * Copyright 2025 NXP
> >>> + */
> >>> +
> >>> +#include <linux/types.h>
> >>> +
> >>> +#include <linux/completion.h>
> >>> +#include <linux/dma-mapping.h>
> >>> +#include <linux/genalloc.h>
> >>> +
> >>> +#include "ele_base_msg.h"
> >>> +#include "ele_common.h"
> >>> +
> >>> +#define FW_DBG_DUMP_FIXED_STR              "ELE"
> >>> +
> >>> +int ele_get_info(struct se_if_priv *priv, struct ele_dev_info
> >>> +*s_info) {
> >>> +   struct se_api_msg *tx_msg __free(kfree) = NULL;
> >>> +   struct se_api_msg *rx_msg __free(kfree) = NULL;
> >>
> >> No, don't use this syntax. This is explicitly discouraged.
> >>
> >> NAK

Accepted.
Will fix this in V21 patch-set.

> >
> > Add link for reference.
> >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > .kernel.org%2Fall%2FCAHk-
> %3DwhPZoi03ZwphxiW6cuWPtC3nyKYS8_BThgztCdgPWP
> >
> 1WA%40mail.gmail.com%2F&data=05%7C02%7Cpankaj.gupta%40nxp.com
> %7C10fcf6
> >
> 46c5424c32be3508de32934df5%7C686ea1d3bc2b4c6fa92cd99c5c301635
> %7C0%7C0%
> >
> 7C639003805451655771%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hc
> GkiOnRydWUsI
> >
> lYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3
> D%7C
> >
> 0%7C%7C%7C&sdata=qxkxvyfwzl970fCJNa6iMr1i1zWYIdCIg4AIQMowvX4%
> 3D&reserv
> > ed=0
> 
> This is since beginning documented in kernel, so contributor could read
> cleanup docs before using them. Above Linus remark is nothing new, he
> already wrote it ~2 years ago.
> 
> Best regards,
> Krzysztof

Best Regards
Pankaj

  reply	other threads:[~2025-12-12  9:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  6:48 [PATCH v20 0/7] firmware: imx: driver for NXP secure-enclave Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 1/7] Documentation/firmware: add imx/se to other_interfaces Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 3/7] firmware: imx: add driver for NXP EdgeLock Enclave Pankaj Gupta
2025-12-03  7:20   ` Krzysztof Kozlowski
2025-12-03 16:59     ` Frank Li
2025-12-03 17:42       ` Krzysztof Kozlowski
2025-12-12  9:07         ` Pankaj Gupta [this message]
2025-12-03 18:02   ` Randy Dunlap
2025-12-12  9:05     ` [EXT] " Pankaj Gupta
2025-12-09  8:08   ` Dan Carpenter
2025-12-12  9:04     ` [EXT] " Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 4/7] firmware: imx: device context dedicated to priv Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 5/7] firmware: drivers: imx: adds miscdev Pankaj Gupta
2025-12-04  4:28   ` kernel test robot
2025-12-03  6:48 ` [PATCH v20 6/7] arm64: dts: imx8ulp: add secure enclave node Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 7/7] arm64: dts: imx8ulp-evk: add reserved memory property Pankaj Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR04MB86046ACCE6AF2BE7099FD3AE95AEA@AM9PR04MB8604.eurprd04.prod.outlook.com \
    --to=pankaj.gupta@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®