Re: [PATCH v5 10/11] firmware: imx: enclave api to read-common-fuses

Krzysztof Kozlowski
2023-08-24T18:39:36Z

On 23/08/2023 09:33, Pankaj Gupta wrote:
> Added an API to read the common fuses only accessible to
> enclave-firmware.
>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>

...

> +int read_common_fuse(struct device *dev,
> + uint16_t fuse_id, u32 *value)
> +{
> + struct ele_mu_priv *priv = dev_get_drvdata(dev);
> + int err;
> +
> + err = plat_fill_cmd_msg_hdr(priv,
> + (struct mu_hdr *)&priv->tx_msg.header,
> + ELE_READ_FUSE_REQ, 8);
> + if (err) {
> + pr_err("Error: plat_fill_cmd_msg_hdr failed.\n");
> + return err;
> + }
> +
> + priv->tx_msg.data[0] = fuse_id;
> + err = imx_ele_msg_send_rcv(priv);
> + if (err < 0)
> + return err;
> +
> + switch (fuse_id) {
> + case OTP_UNIQ_ID:
> + err = read_otp_uniq_id(priv, value);
> + break;
> + default:
> + err = read_fuse_word(priv, value);
> + break;
> + }
> +
> + return err;
> +}
> +EXPORT_SYMBOL_GPL(read_common_fuse);

Missing kerneldoc, missing user. Sorry, this cannot be accepted. Don't
add such dead code.

Best regards,
Krzysztof