Re: [PATCH v14 4/6] firmware: imx: add driver for NXP EdgeLock Enclave
From: Frank Li
Date: Fri Apr 04 2025 - 12:50:23 EST
On Thu, Apr 03, 2025 at 05:02:08AM +0000, Pankaj Gupta wrote:
> On Wed, Apr 02, 2025 at 06:15:12AM +0000, Pankaj Gupta wrote:
> >> >> diff --git a/drivers/firmware/imx/se_ctrl.h
> >> >> b/drivers/firmware/imx/se_ctrl.h new file mode 100644 index
> >> >> 000000000000..177623f3890e
> >> >> --- /dev/null
> >> >> +++ b/drivers/firmware/imx/se_ctrl.h
> >> >> @@ -0,0 +1,84 @@
> >> >> +/* SPDX-License-Identifier: GPL-2.0+ */
> >> >> +/*
> >> >> + * Copyright 2025 NXP
> >> >> + */
> >> >> +
> >> >> +#ifndef SE_MU_H
> >> >> +#define SE_MU_H
> >> >> +
> >> >> +#include <linux/miscdevice.h>
> >> >> +#include <linux/semaphore.h>
> >> >> +#include <linux/mailbox_client.h>
> >> >> +
> >>
> >> ....
> >>
> >> >> +};
> >> >> +
> >> >> +struct se_if_defines {
> >> >> + const u8 se_if_type;
> >> >> + const u8 se_instance_id;
> >> Getting used at drivers/firmware/imx/se_ctrl.c:320
>
> > dev_info(dev, "i.MX secure-enclave: %s%d interface to firmware,
> configured.",
> > SE_TYPE_STR_HSM,
> > priv->if_defs->se_instance_id);
>
> > You only print value, don't actual use it. It should be safe remove it
>
> > Frank
>
> No, it is not just used for print.
> This variable is used to construct the device name as well, in 5/6 patch.
>
> Moreover, it is needed for other SoC like i.MX8DXL, i.MX95, i.MX94, there
> are multiple instances of same secure-enclave type.
> It will be used to identify the intended instance later.
But it all is 0 now. Add it back when it really need in future.
Frank
>
> >>
> >> > This is not used actually, you can remove it
> >> Getting used at drivers/firmware/imx/se_ctrl.c:347
> >>
> >> >> + u8 cmd_tag;
> >> >> + u8 rsp_tag;
> >> >> + u8 success_tag;
> >> >> + u8 base_api_ver;
> >> >> + u8 fw_api_ver;
> >> >> +};
> >> >> +
> >> >> +struct se_if_priv {
> >> >> + struct device *dev;
> >> >> +
>
>