Lines Matching +full:efuse +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0+
4 * Copyright (C) 2022 - 2023, Advanced Micro Devices, Inc.
7 #include <linux/dma-mapping.h>
9 #include <linux/nvmem-provider.h>
12 #include <linux/firmware/xlnx-zynqmp.h>
32 * efuse access type
40 * struct xilinx_efuse - the basic structure
42 * @size: read/write word count
44 * @flag: 0 - represents efuse read and 1- represents efuse write
45 * @pufuserfuse:0 - represents non-puf efuses, offset is used for read/write
46 * 1 - represents puf user fuse row number.
49 * read/write efuse memory.
53 u32 size; member
64 struct xilinx_efuse *efuse; in zynqmp_efuse_access() local
74 return -EOPNOTSUPP; in zynqmp_efuse_access()
79 return -EOPNOTSUPP; in zynqmp_efuse_access()
88 return -EOPNOTSUPP; in zynqmp_efuse_access()
94 return -EOPNOTSUPP; in zynqmp_efuse_access()
98 efuse = dma_alloc_coherent(dev, sizeof(struct xilinx_efuse), in zynqmp_efuse_access()
100 if (!efuse) in zynqmp_efuse_access()
101 return -ENOMEM; in zynqmp_efuse_access()
106 ret = -ENOMEM; in zynqmp_efuse_access()
112 efuse->flag = EFUSE_WRITE; in zynqmp_efuse_access()
114 efuse->flag = EFUSE_READ; in zynqmp_efuse_access()
117 efuse->src = dma_buf; in zynqmp_efuse_access()
118 efuse->size = words; in zynqmp_efuse_access()
119 efuse->offset = offset; in zynqmp_efuse_access()
120 efuse->pufuserfuse = pufflag; in zynqmp_efuse_access()
125 dev_err(dev, "efuse access is not enabled\n"); in zynqmp_efuse_access()
126 ret = -EOPNOTSUPP; in zynqmp_efuse_access()
128 dev_err(dev, "Error in efuse read %x\n", ret); in zynqmp_efuse_access()
129 ret = -EPERM; in zynqmp_efuse_access()
141 efuse, dma_addr); in zynqmp_efuse_access()
161 return -EOPNOTSUPP; in zynqmp_nvmem_read()
170 /* Efuse offset starts from 0xc */ in zynqmp_nvmem_read()
191 return -EOPNOTSUPP; in zynqmp_nvmem_write()
201 { .compatible = "xlnx,zynqmp-nvmem-fw", },
208 struct device *dev = &pdev->dev; in zynqmp_nvmem_probe()
211 econfig.name = "zynqmp-nvmem"; in zynqmp_nvmem_probe()
214 econfig.size = ZYNQMP_NVMEM_SIZE; in zynqmp_nvmem_probe()
226 .name = "zynqmp-nvmem",