From: Sascha Hauer <s.hauer@pengutronix.de>
To: Pankaj Gupta <pankaj.gupta@nxp.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/5] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Fri, 24 May 2024 12:47:17 +0200 [thread overview]
Message-ID: <ZlBwNbkFV1fcnPKE@pengutronix.de> (raw)
In-Reply-To: <20240523-imx-se-if-v2-4-5a6fd189a539@nxp.com>
On Thu, May 23, 2024 at 04:19:35PM +0530, Pankaj Gupta wrote:
> 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 on a dedicated messaging unit(MU)
> based interface(s) with application core, where kernel is running.
> It exists on specific i.MX processors. e.g. i.MX8ULP, i.MX93.
>
> This patch adds the driver for communication interface to secure-enclave,
> for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock
> Enclave (ELE) from Kernel-space, used by kernel management layers like
> - DM-Crypt.
>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
> ---
> drivers/firmware/imx/Kconfig | 12 +
> drivers/firmware/imx/Makefile | 2 +
> drivers/firmware/imx/ele_base_msg.c | 286 +++++++++++++++++++
> drivers/firmware/imx/ele_base_msg.h | 92 +++++++
> drivers/firmware/imx/ele_common.c | 239 ++++++++++++++++
> drivers/firmware/imx/ele_common.h | 43 +++
> drivers/firmware/imx/se_ctrl.c | 531 ++++++++++++++++++++++++++++++++++++
> drivers/firmware/imx/se_ctrl.h | 99 +++++++
> include/linux/firmware/imx/se_api.h | 14 +
> 9 files changed, 1318 insertions(+)
>
> +static int imx_fetch_se_soc_info(struct device *dev)
> +{
> + struct se_if_priv *priv = dev_get_drvdata(dev);
> + struct imx_se_node_info_list *info_list;
> + const struct imx_se_node_info *info;
> + struct soc_device_attribute *attr;
> + struct soc_device *sdev;
> + u64 serial_num;
> + u16 soc_rev;
> + int err = 0;
> +
> + info = priv->info;
> + info_list = (struct imx_se_node_info_list *)
> + device_get_match_data(dev);
> +
> + /* This function should be called once.
> + * Check if the soc_rev is zero to continue.
> + */
> + if (priv->soc_rev)
> + return err;
> +
> + err = info->se_fetch_soc_info(dev, &soc_rev, &serial_num);
> + if (err < 0) {
> + dev_err(dev, "Failed to fetch SoC Info.");
> + return err;
> + }
This is called unconditionally but is not set for i.MX93. You should
either set it for i.MX93 or check it before calling it.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
WARNING: multiple messages have this Message-ID (diff)
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Pankaj Gupta <pankaj.gupta@nxp.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/5] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Fri, 24 May 2024 12:47:17 +0200 [thread overview]
Message-ID: <ZlBwNbkFV1fcnPKE@pengutronix.de> (raw)
In-Reply-To: <20240523-imx-se-if-v2-4-5a6fd189a539@nxp.com>
On Thu, May 23, 2024 at 04:19:35PM +0530, Pankaj Gupta wrote:
> 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 on a dedicated messaging unit(MU)
> based interface(s) with application core, where kernel is running.
> It exists on specific i.MX processors. e.g. i.MX8ULP, i.MX93.
>
> This patch adds the driver for communication interface to secure-enclave,
> for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock
> Enclave (ELE) from Kernel-space, used by kernel management layers like
> - DM-Crypt.
>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
> ---
> drivers/firmware/imx/Kconfig | 12 +
> drivers/firmware/imx/Makefile | 2 +
> drivers/firmware/imx/ele_base_msg.c | 286 +++++++++++++++++++
> drivers/firmware/imx/ele_base_msg.h | 92 +++++++
> drivers/firmware/imx/ele_common.c | 239 ++++++++++++++++
> drivers/firmware/imx/ele_common.h | 43 +++
> drivers/firmware/imx/se_ctrl.c | 531 ++++++++++++++++++++++++++++++++++++
> drivers/firmware/imx/se_ctrl.h | 99 +++++++
> include/linux/firmware/imx/se_api.h | 14 +
> 9 files changed, 1318 insertions(+)
>
> +static int imx_fetch_se_soc_info(struct device *dev)
> +{
> + struct se_if_priv *priv = dev_get_drvdata(dev);
> + struct imx_se_node_info_list *info_list;
> + const struct imx_se_node_info *info;
> + struct soc_device_attribute *attr;
> + struct soc_device *sdev;
> + u64 serial_num;
> + u16 soc_rev;
> + int err = 0;
> +
> + info = priv->info;
> + info_list = (struct imx_se_node_info_list *)
> + device_get_match_data(dev);
> +
> + /* This function should be called once.
> + * Check if the soc_rev is zero to continue.
> + */
> + if (priv->soc_rev)
> + return err;
> +
> + err = info->se_fetch_soc_info(dev, &soc_rev, &serial_num);
> + if (err < 0) {
> + dev_err(dev, "Failed to fetch SoC Info.");
> + return err;
> + }
This is called unconditionally but is not set for i.MX93. You should
either set it for i.MX93 or check it before calling it.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-05-24 10:47 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 10:49 [PATCH v2 0/5] Communication Interface to NXP secure-enclave HW IP like Edgelock Enclave Pankaj Gupta
2024-05-23 10:49 ` Pankaj Gupta
2024-05-23 10:49 ` [PATCH v2 1/5] Documentation/firmware: add imx/se to other_interfaces Pankaj Gupta
2024-05-23 10:49 ` Pankaj Gupta
2024-05-23 10:49 ` [PATCH v2 2/5] dt-bindings: arm: fsl: add imx-se-fw binding doc Pankaj Gupta
2024-05-23 10:49 ` Pankaj Gupta
2024-05-23 12:25 ` Rob Herring (Arm)
2024-05-23 12:25 ` Rob Herring (Arm)
2024-05-23 12:30 ` [EXT] " Pankaj Gupta
2024-05-23 12:30 ` Pankaj Gupta
2024-05-23 10:49 ` [PATCH v2 3/5] arm64: dts: imx8ulp-evk: add nxp secure enclave firmware Pankaj Gupta
2024-05-23 10:49 ` Pankaj Gupta
2024-05-23 10:49 ` [PATCH v2 4/5] firmware: imx: add driver for NXP EdgeLock Enclave Pankaj Gupta
2024-05-23 10:49 ` Pankaj Gupta
2024-05-23 13:23 ` Sascha Hauer
2024-05-23 13:23 ` Sascha Hauer
2024-05-23 13:43 ` [EXT] " Pankaj Gupta
2024-05-23 13:43 ` Pankaj Gupta
2024-05-23 18:35 ` Sascha Hauer
2024-05-23 18:35 ` Sascha Hauer
2024-05-24 9:07 ` Sascha Hauer
2024-05-24 9:07 ` Sascha Hauer
2024-06-14 8:56 ` [EXT] " Pankaj Gupta
2024-05-24 10:34 ` Sascha Hauer
2024-05-24 10:34 ` Sascha Hauer
2024-05-24 12:08 ` [EXT] " Pankaj Gupta
2024-05-24 12:08 ` Pankaj Gupta
2024-05-24 12:25 ` Sascha Hauer
2024-05-24 12:25 ` Sascha Hauer
2024-06-14 9:05 ` Pankaj Gupta
2024-05-24 10:47 ` Sascha Hauer [this message]
2024-05-24 10:47 ` Sascha Hauer
2024-05-24 12:08 ` [EXT] " Pankaj Gupta
2024-05-24 12:08 ` Pankaj Gupta
2024-05-23 10:49 ` [PATCH v2 5/5] firmware: imx: adds miscdev Pankaj Gupta
2024-05-23 10:49 ` Pankaj Gupta
2024-05-24 8:23 ` Sascha Hauer
2024-05-24 8:23 ` Sascha Hauer
2024-05-24 12:03 ` [EXT] " Pankaj Gupta
2024-05-24 12:03 ` Pankaj Gupta
2024-05-24 12:43 ` Sascha Hauer
2024-05-24 12:43 ` Sascha Hauer
2024-06-01 4:38 ` Pankaj Gupta
2024-06-01 4:38 ` Pankaj Gupta
2024-06-03 16:22 ` Amit Singh Tomar
2024-06-03 16:22 ` Amit Singh Tomar
2024-06-05 9:15 ` [EXT] " Pankaj Gupta
2024-06-05 9:15 ` 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=ZlBwNbkFV1fcnPKE@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pankaj.gupta@nxp.com \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.