[PATCH v8 4/5] firmware: imx: add driver for NXP EdgeLock Enclave
Pankaj Gupta
pankaj.gupta at nxp.com
Tue Oct 15 02:19:01 PDT 2024
diff --git a/drivers/firmware/imx/se_ctrl.c b/drivers/firmware/imx/se_ctrl.c
new file mode 100644 index 000000000000..37693c27042f
--- /dev/null
+++ b/drivers/firmware/imx/se_ctrl.c
+
+static void se_if_probe_cleanup(void *plat_dev) {
+ struct platform_device *pdev = plat_dev;
+ struct device *dev = &pdev->dev;
+ struct se_fw_load_info *load_fw;
+ struct se_if_priv *priv;
+
+ priv = dev_get_drvdata(dev);
+ load_fw = get_load_fw_instance(priv);
+
+ /* In se_if_request_channel(), passed the clean-up functional
+ * pointer reference as action to devm_add_action().
+ * No need to free the mbox channels here.
+ */
+
+ /* free the buffer in se remove, previously allocated
+ * in se probe to store encrypted IMEM
+ */
+ if (!load_fw && load_fw->imem.buf) {
This needs to be corrected to: if (load_fw && load_fw->imem.buf) {
Will correct in v9.
+ dmam_free_coherent(dev,
+ ELE_IMEM_SIZE,
+ load_fw->imem.buf,
+ load_fw->imem.phyaddr);
+ load_fw->imem.buf = NULL;
+ }
+
+ /* No need to check, if reserved memory is allocated
+ * before calling for its release. Or clearing the
+ * un-set bit.
+ */
+ of_reserved_mem_device_release(dev);
+}
+
+static int se_if_probe(struct platform_device *pdev) {
+ const struct se_if_node_info_list *info_list;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 11094 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20241015/2c18a31e/attachment.p7s>
More information about the linux-arm-kernel
mailing list