|
14 | 14 | #include <linux/slab.h>
|
15 | 15 |
|
16 | 16 | enum fuse_type {
|
17 |
| - FUSE_FSB = 1, |
18 |
| - FUSE_ELE = 2, |
| 17 | + FUSE_FSB = BIT(0), |
| 18 | + FUSE_ELE = BIT(1), |
| 19 | + FUSE_ECC = BIT(2), |
19 | 20 | FUSE_INVALID = -1
|
20 | 21 | };
|
21 | 22 |
|
@@ -93,7 +94,10 @@ static int imx_ocotp_reg_read(void *context, unsigned int offset, void *val, siz
|
93 | 94 | continue;
|
94 | 95 | }
|
95 | 96 |
|
96 |
| - *buf++ = readl_relaxed(reg + (i << 2)); |
| 97 | + if (type & FUSE_ECC) |
| 98 | + *buf++ = readl_relaxed(reg + (i << 2)) & GENMASK(15, 0); |
| 99 | + else |
| 100 | + *buf++ = readl_relaxed(reg + (i << 2)); |
97 | 101 | }
|
98 | 102 |
|
99 | 103 | memcpy(val, (u8 *)p, bytes);
|
@@ -155,8 +159,30 @@ static const struct ocotp_devtype_data imx93_ocotp_data = {
|
155 | 159 | },
|
156 | 160 | };
|
157 | 161 |
|
| 162 | +static const struct ocotp_devtype_data imx95_ocotp_data = { |
| 163 | + .reg_off = 0x8000, |
| 164 | + .reg_read = imx_ocotp_reg_read, |
| 165 | + .size = 2048, |
| 166 | + .num_entry = 12, |
| 167 | + .entry = { |
| 168 | + { 0, 1, FUSE_FSB | FUSE_ECC }, |
| 169 | + { 7, 1, FUSE_FSB | FUSE_ECC }, |
| 170 | + { 9, 3, FUSE_FSB | FUSE_ECC }, |
| 171 | + { 12, 24, FUSE_FSB }, |
| 172 | + { 36, 2, FUSE_FSB | FUSE_ECC }, |
| 173 | + { 38, 14, FUSE_FSB }, |
| 174 | + { 63, 1, FUSE_ELE }, |
| 175 | + { 128, 16, FUSE_ELE }, |
| 176 | + { 188, 1, FUSE_ELE }, |
| 177 | + { 317, 2, FUSE_FSB | FUSE_ECC }, |
| 178 | + { 320, 7, FUSE_FSB }, |
| 179 | + { 328, 184, FUSE_FSB } |
| 180 | + }, |
| 181 | +}; |
| 182 | + |
158 | 183 | static const struct of_device_id imx_ele_ocotp_dt_ids[] = {
|
159 | 184 | { .compatible = "fsl,imx93-ocotp", .data = &imx93_ocotp_data, },
|
| 185 | + { .compatible = "fsl,imx95-ocotp", .data = &imx95_ocotp_data, }, |
160 | 186 | {},
|
161 | 187 | };
|
162 | 188 | MODULE_DEVICE_TABLE(of, imx_ele_ocotp_dt_ids);
|
|
0 commit comments