blob: bf95a0ecd0dc66e96580d4d331364a7ef0098677 [file] [log] [blame]
Philipp Zabel3edba6b2015-09-30 13:55:47 +01001/*
2 * i.MX6 OCOTP fusebox driver
3 *
4 * Copyright (c) 2015 Pengutronix, Philipp Zabel <p.zabel@pengutronix.de>
5 *
6 * Based on the barebox ocotp driver,
7 * Copyright (c) 2010 Baruch Siach <baruch@tkos.co.il>,
8 * Orex Computed Radiography
9 *
Richard Leitner0642bac2017-03-31 13:44:55 +010010 * Write support based on the fsl_otp driver,
11 * Copyright (C) 2010-2013 Freescale Semiconductor, Inc
12 *
Philipp Zabel3edba6b2015-09-30 13:55:47 +010013 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation.
16 *
17 * http://www.opensource.org/licenses/gpl-license.html
18 * http://www.gnu.org/copyleft/gpl.html
19 */
20
Peng Fandeb31972016-06-02 12:05:11 +010021#include <linux/clk.h>
Philipp Zabel3edba6b2015-09-30 13:55:47 +010022#include <linux/device.h>
23#include <linux/io.h>
24#include <linux/module.h>
25#include <linux/nvmem-provider.h>
26#include <linux/of.h>
27#include <linux/of_device.h>
28#include <linux/platform_device.h>
Philipp Zabel3edba6b2015-09-30 13:55:47 +010029#include <linux/slab.h>
Richard Leitner0642bac2017-03-31 13:44:55 +010030#include <linux/delay.h>
Philipp Zabel3edba6b2015-09-30 13:55:47 +010031
Richard Leitner9b665872017-03-31 13:44:54 +010032#define IMX_OCOTP_OFFSET_B0W0 0x400 /* Offset from base address of the
33 * OTP Bank0 Word0
34 */
35#define IMX_OCOTP_OFFSET_PER_WORD 0x10 /* Offset between the start addr
36 * of two consecutive OTP words.
37 */
Richard Leitner0642bac2017-03-31 13:44:55 +010038
Richard Leitner9b665872017-03-31 13:44:54 +010039#define IMX_OCOTP_ADDR_CTRL 0x0000
Richard Leitner0642bac2017-03-31 13:44:55 +010040#define IMX_OCOTP_ADDR_CTRL_SET 0x0004
Richard Leitner9b665872017-03-31 13:44:54 +010041#define IMX_OCOTP_ADDR_CTRL_CLR 0x0008
Richard Leitner0642bac2017-03-31 13:44:55 +010042#define IMX_OCOTP_ADDR_TIMING 0x0010
Bryan O'Donoghueffd91152017-10-24 10:54:29 +010043#define IMX_OCOTP_ADDR_DATA0 0x0020
44#define IMX_OCOTP_ADDR_DATA1 0x0030
45#define IMX_OCOTP_ADDR_DATA2 0x0040
46#define IMX_OCOTP_ADDR_DATA3 0x0050
Richard Leitner9b665872017-03-31 13:44:54 +010047
Richard Leitner0642bac2017-03-31 13:44:55 +010048#define IMX_OCOTP_BM_CTRL_ADDR 0x0000007F
49#define IMX_OCOTP_BM_CTRL_BUSY 0x00000100
Richard Leitner9b665872017-03-31 13:44:54 +010050#define IMX_OCOTP_BM_CTRL_ERROR 0x00000200
Richard Leitner0642bac2017-03-31 13:44:55 +010051#define IMX_OCOTP_BM_CTRL_REL_SHADOWS 0x00000400
Richard Leitner9b665872017-03-31 13:44:54 +010052
Richard Leitner0642bac2017-03-31 13:44:55 +010053#define DEF_RELAX 20 /* > 16.5ns */
54#define IMX_OCOTP_WR_UNLOCK 0x3E770000
Richard Leitner9b665872017-03-31 13:44:54 +010055#define IMX_OCOTP_READ_LOCKED_VAL 0xBADABADA
56
Richard Leitner0642bac2017-03-31 13:44:55 +010057static DEFINE_MUTEX(ocotp_mutex);
58
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +010059struct ocotp_params {
60 unsigned int nregs;
Bryan O'Donoghueffd91152017-10-24 10:54:29 +010061 unsigned int bank_address_words;
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +010062};
63
Philipp Zabel3edba6b2015-09-30 13:55:47 +010064struct ocotp_priv {
65 struct device *dev;
Peng Fandeb31972016-06-02 12:05:11 +010066 struct clk *clk;
Philipp Zabel3edba6b2015-09-30 13:55:47 +010067 void __iomem *base;
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +010068 const struct ocotp_params *params;
Richard Leitner0642bac2017-03-31 13:44:55 +010069 struct nvmem_config *config;
Philipp Zabel3edba6b2015-09-30 13:55:47 +010070};
71
Richard Leitner0642bac2017-03-31 13:44:55 +010072static int imx_ocotp_wait_for_busy(void __iomem *base, u32 flags)
73{
74 int count;
75 u32 c, mask;
76
77 mask = IMX_OCOTP_BM_CTRL_BUSY | IMX_OCOTP_BM_CTRL_ERROR | flags;
78
79 for (count = 10000; count >= 0; count--) {
80 c = readl(base + IMX_OCOTP_ADDR_CTRL);
81 if (!(c & mask))
82 break;
83 cpu_relax();
84 }
85
86 if (count < 0) {
87 /* HW_OCOTP_CTRL[ERROR] will be set under the following
88 * conditions:
89 * - A write is performed to a shadow register during a shadow
90 * reload (essentially, while HW_OCOTP_CTRL[RELOAD_SHADOWS] is
91 * set. In addition, the contents of the shadow register shall
92 * not be updated.
93 * - A write is performed to a shadow register which has been
94 * locked.
95 * - A read is performed to from a shadow register which has
96 * been read locked.
97 * - A program is performed to a fuse word which has been locked
98 * - A read is performed to from a fuse word which has been read
99 * locked.
100 */
101 if (c & IMX_OCOTP_BM_CTRL_ERROR)
102 return -EPERM;
103 return -ETIMEDOUT;
104 }
105
106 return 0;
107}
108
Richard Leitner9b665872017-03-31 13:44:54 +0100109static void imx_ocotp_clr_err_if_set(void __iomem *base)
110{
111 u32 c;
112
113 c = readl(base + IMX_OCOTP_ADDR_CTRL);
114 if (!(c & IMX_OCOTP_BM_CTRL_ERROR))
115 return;
116
117 writel(IMX_OCOTP_BM_CTRL_ERROR, base + IMX_OCOTP_ADDR_CTRL_CLR);
118}
119
Srinivas Kandagatla33e5e292016-04-24 20:28:13 +0100120static int imx_ocotp_read(void *context, unsigned int offset,
121 void *val, size_t bytes)
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100122{
123 struct ocotp_priv *priv = context;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100124 unsigned int count;
Srinivas Kandagatla33e5e292016-04-24 20:28:13 +0100125 u32 *buf = val;
Peng Fandeb31972016-06-02 12:05:11 +0100126 int i, ret;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100127 u32 index;
128
129 index = offset >> 2;
Srinivas Kandagatla33e5e292016-04-24 20:28:13 +0100130 count = bytes >> 2;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100131
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100132 if (count > (priv->params->nregs - index))
133 count = priv->params->nregs - index;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100134
Richard Leitner0642bac2017-03-31 13:44:55 +0100135 mutex_lock(&ocotp_mutex);
136
Peng Fandeb31972016-06-02 12:05:11 +0100137 ret = clk_prepare_enable(priv->clk);
138 if (ret < 0) {
Richard Leitner0642bac2017-03-31 13:44:55 +0100139 mutex_unlock(&ocotp_mutex);
Peng Fandeb31972016-06-02 12:05:11 +0100140 dev_err(priv->dev, "failed to prepare/enable ocotp clk\n");
141 return ret;
142 }
Richard Leitner9b665872017-03-31 13:44:54 +0100143
Richard Leitner0642bac2017-03-31 13:44:55 +0100144 ret = imx_ocotp_wait_for_busy(priv->base, 0);
145 if (ret < 0) {
146 dev_err(priv->dev, "timeout during read setup\n");
147 goto read_end;
148 }
149
Richard Leitner9b665872017-03-31 13:44:54 +0100150 for (i = index; i < (index + count); i++) {
151 *buf++ = readl(priv->base + IMX_OCOTP_OFFSET_B0W0 +
152 i * IMX_OCOTP_OFFSET_PER_WORD);
153
154 /* 47.3.1.2
155 * For "read locked" registers 0xBADABADA will be returned and
156 * HW_OCOTP_CTRL[ERROR] will be set. It must be cleared by
157 * software before any new write, read or reload access can be
158 * issued
159 */
160 if (*(buf - 1) == IMX_OCOTP_READ_LOCKED_VAL)
161 imx_ocotp_clr_err_if_set(priv->base);
162 }
Richard Leitner0642bac2017-03-31 13:44:55 +0100163 ret = 0;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100164
Richard Leitner0642bac2017-03-31 13:44:55 +0100165read_end:
Peng Fandeb31972016-06-02 12:05:11 +0100166 clk_disable_unprepare(priv->clk);
Richard Leitner0642bac2017-03-31 13:44:55 +0100167 mutex_unlock(&ocotp_mutex);
168 return ret;
169}
170
171static int imx_ocotp_write(void *context, unsigned int offset, void *val,
172 size_t bytes)
173{
174 struct ocotp_priv *priv = context;
175 u32 *buf = val;
176 int ret;
177
178 unsigned long clk_rate = 0;
179 unsigned long strobe_read, relax, strobe_prog;
180 u32 timing = 0;
181 u32 ctrl;
182 u8 waddr;
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100183 u8 word = 0;
Richard Leitner0642bac2017-03-31 13:44:55 +0100184
185 /* allow only writing one complete OTP word at a time */
186 if ((bytes != priv->config->word_size) ||
187 (offset % priv->config->word_size))
188 return -EINVAL;
189
190 mutex_lock(&ocotp_mutex);
191
192 ret = clk_prepare_enable(priv->clk);
193 if (ret < 0) {
194 mutex_unlock(&ocotp_mutex);
195 dev_err(priv->dev, "failed to prepare/enable ocotp clk\n");
196 return ret;
197 }
198
199 /* 47.3.1.3.1
200 * Program HW_OCOTP_TIMING[STROBE_PROG] and HW_OCOTP_TIMING[RELAX]
201 * fields with timing values to match the current frequency of the
202 * ipg_clk. OTP writes will work at maximum bus frequencies as long
203 * as the HW_OCOTP_TIMING parameters are set correctly.
204 */
205 clk_rate = clk_get_rate(priv->clk);
206
207 relax = clk_rate / (1000000000 / DEF_RELAX) - 1;
208 strobe_prog = clk_rate / (1000000000 / 10000) + 2 * (DEF_RELAX + 1) - 1;
209 strobe_read = clk_rate / (1000000000 / 40) + 2 * (DEF_RELAX + 1) - 1;
210
211 timing = strobe_prog & 0x00000FFF;
212 timing |= (relax << 12) & 0x0000F000;
213 timing |= (strobe_read << 16) & 0x003F0000;
214
215 writel(timing, priv->base + IMX_OCOTP_ADDR_TIMING);
216
217 /* 47.3.1.3.2
218 * Check that HW_OCOTP_CTRL[BUSY] and HW_OCOTP_CTRL[ERROR] are clear.
219 * Overlapped accesses are not supported by the controller. Any pending
220 * write or reload must be completed before a write access can be
221 * requested.
222 */
223 ret = imx_ocotp_wait_for_busy(priv->base, 0);
224 if (ret < 0) {
225 dev_err(priv->dev, "timeout during timing setup\n");
226 goto write_end;
227 }
228
229 /* 47.3.1.3.3
230 * Write the requested address to HW_OCOTP_CTRL[ADDR] and program the
231 * unlock code into HW_OCOTP_CTRL[WR_UNLOCK]. This must be programmed
232 * for each write access. The lock code is documented in the register
233 * description. Both the unlock code and address can be written in the
234 * same operation.
235 */
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100236 if (priv->params->bank_address_words != 0) {
237 /*
238 * In banked/i.MX7 mode the OTP register bank goes into waddr
239 * see i.MX 7Solo Applications Processor Reference Manual, Rev.
240 * 0.1 section 6.4.3.1
241 */
242 offset = offset / priv->config->word_size;
243 waddr = offset / priv->params->bank_address_words;
244 word = offset & (priv->params->bank_address_words - 1);
245 } else {
246 /*
247 * Non-banked i.MX6 mode.
248 * OTP write/read address specifies one of 128 word address
249 * locations
250 */
251 waddr = offset / 4;
252 }
Richard Leitner0642bac2017-03-31 13:44:55 +0100253
254 ctrl = readl(priv->base + IMX_OCOTP_ADDR_CTRL);
255 ctrl &= ~IMX_OCOTP_BM_CTRL_ADDR;
256 ctrl |= waddr & IMX_OCOTP_BM_CTRL_ADDR;
257 ctrl |= IMX_OCOTP_WR_UNLOCK;
258
259 writel(ctrl, priv->base + IMX_OCOTP_ADDR_CTRL);
260
261 /* 47.3.1.3.4
262 * Write the data to the HW_OCOTP_DATA register. This will automatically
263 * set HW_OCOTP_CTRL[BUSY] and clear HW_OCOTP_CTRL[WR_UNLOCK]. To
264 * protect programming same OTP bit twice, before program OCOTP will
265 * automatically read fuse value in OTP and use read value to mask
266 * program data. The controller will use masked program data to program
267 * a 32-bit word in the OTP per the address in HW_OCOTP_CTRL[ADDR]. Bit
268 * fields with 1's will result in that OTP bit being programmed. Bit
269 * fields with 0's will be ignored. At the same time that the write is
270 * accepted, the controller makes an internal copy of
271 * HW_OCOTP_CTRL[ADDR] which cannot be updated until the next write
272 * sequence is initiated. This copy guarantees that erroneous writes to
273 * HW_OCOTP_CTRL[ADDR] will not affect an active write operation. It
274 * should also be noted that during the programming HW_OCOTP_DATA will
275 * shift right (with zero fill). This shifting is required to program
276 * the OTP serially. During the write operation, HW_OCOTP_DATA cannot be
277 * modified.
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100278 * Note: on i.MX7 there are four data fields to write for banked write
279 * with the fuse blowing operation only taking place after data0
280 * has been written. This is why data0 must always be the last
281 * register written.
Richard Leitner0642bac2017-03-31 13:44:55 +0100282 */
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100283 if (priv->params->bank_address_words != 0) {
284 /* Banked/i.MX7 mode */
285 switch (word) {
286 case 0:
287 writel(0, priv->base + IMX_OCOTP_ADDR_DATA1);
288 writel(0, priv->base + IMX_OCOTP_ADDR_DATA2);
289 writel(0, priv->base + IMX_OCOTP_ADDR_DATA3);
290 writel(*buf, priv->base + IMX_OCOTP_ADDR_DATA0);
291 break;
292 case 1:
293 writel(*buf, priv->base + IMX_OCOTP_ADDR_DATA1);
294 writel(0, priv->base + IMX_OCOTP_ADDR_DATA2);
295 writel(0, priv->base + IMX_OCOTP_ADDR_DATA3);
296 writel(0, priv->base + IMX_OCOTP_ADDR_DATA0);
297 break;
298 case 2:
299 writel(0, priv->base + IMX_OCOTP_ADDR_DATA1);
300 writel(*buf, priv->base + IMX_OCOTP_ADDR_DATA2);
301 writel(0, priv->base + IMX_OCOTP_ADDR_DATA3);
302 writel(0, priv->base + IMX_OCOTP_ADDR_DATA0);
303 break;
304 case 3:
305 writel(0, priv->base + IMX_OCOTP_ADDR_DATA1);
306 writel(0, priv->base + IMX_OCOTP_ADDR_DATA2);
307 writel(*buf, priv->base + IMX_OCOTP_ADDR_DATA3);
308 writel(0, priv->base + IMX_OCOTP_ADDR_DATA0);
309 break;
310 }
311 } else {
312 /* Non-banked i.MX6 mode */
313 writel(*buf, priv->base + IMX_OCOTP_ADDR_DATA0);
314 }
Richard Leitner0642bac2017-03-31 13:44:55 +0100315
316 /* 47.4.1.4.5
317 * Once complete, the controller will clear BUSY. A write request to a
318 * protected or locked region will result in no OTP access and no
319 * setting of HW_OCOTP_CTRL[BUSY]. In addition HW_OCOTP_CTRL[ERROR] will
320 * be set. It must be cleared by software before any new write access
321 * can be issued.
322 */
323 ret = imx_ocotp_wait_for_busy(priv->base, 0);
324 if (ret < 0) {
325 if (ret == -EPERM) {
326 dev_err(priv->dev, "failed write to locked region");
327 imx_ocotp_clr_err_if_set(priv->base);
328 } else {
329 dev_err(priv->dev, "timeout during data write\n");
330 }
331 goto write_end;
332 }
333
334 /* 47.3.1.4
335 * Write Postamble: Due to internal electrical characteristics of the
336 * OTP during writes, all OTP operations following a write must be
337 * separated by 2 us after the clearing of HW_OCOTP_CTRL_BUSY following
338 * the write.
339 */
340 udelay(2);
341
342 /* reload all shadow registers */
343 writel(IMX_OCOTP_BM_CTRL_REL_SHADOWS,
344 priv->base + IMX_OCOTP_ADDR_CTRL_SET);
345 ret = imx_ocotp_wait_for_busy(priv->base,
346 IMX_OCOTP_BM_CTRL_REL_SHADOWS);
347 if (ret < 0) {
348 dev_err(priv->dev, "timeout during shadow register reload\n");
349 goto write_end;
350 }
351
352write_end:
353 clk_disable_unprepare(priv->clk);
354 mutex_unlock(&ocotp_mutex);
355 if (ret < 0)
356 return ret;
357 return bytes;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100358}
359
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100360static struct nvmem_config imx_ocotp_nvmem_config = {
361 .name = "imx-ocotp",
Richard Leitner0642bac2017-03-31 13:44:55 +0100362 .read_only = false,
Srinivas Kandagatla33e5e292016-04-24 20:28:13 +0100363 .word_size = 4,
364 .stride = 4,
Srinivas Kandagatla33e5e292016-04-24 20:28:13 +0100365 .reg_read = imx_ocotp_read,
Richard Leitner0642bac2017-03-31 13:44:55 +0100366 .reg_write = imx_ocotp_write,
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100367};
368
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100369static const struct ocotp_params imx6q_params = {
370 .nregs = 128,
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100371 .bank_address_words = 0,
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100372};
373
374static const struct ocotp_params imx6sl_params = {
375 .nregs = 64,
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100376 .bank_address_words = 0,
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100377};
378
379static const struct ocotp_params imx6sx_params = {
380 .nregs = 128,
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100381 .bank_address_words = 0,
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100382};
383
384static const struct ocotp_params imx6ul_params = {
385 .nregs = 128,
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100386 .bank_address_words = 0,
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100387};
388
389static const struct ocotp_params imx7d_params = {
390 .nregs = 64,
Bryan O'Donoghueffd91152017-10-24 10:54:29 +0100391 .bank_address_words = 4,
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100392};
393
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100394static const struct of_device_id imx_ocotp_dt_ids[] = {
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100395 { .compatible = "fsl,imx6q-ocotp", .data = &imx6q_params },
396 { .compatible = "fsl,imx6sl-ocotp", .data = &imx6sl_params },
397 { .compatible = "fsl,imx6sx-ocotp", .data = &imx6sx_params },
398 { .compatible = "fsl,imx6ul-ocotp", .data = &imx6ul_params },
399 { .compatible = "fsl,imx7d-ocotp", .data = &imx7d_params },
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100400 { },
401};
402MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);
403
404static int imx_ocotp_probe(struct platform_device *pdev)
405{
406 const struct of_device_id *of_id;
407 struct device *dev = &pdev->dev;
408 struct resource *res;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100409 struct ocotp_priv *priv;
410 struct nvmem_device *nvmem;
411
412 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
413 if (!priv)
414 return -ENOMEM;
415
Richard Leitner4cefb742017-03-31 13:44:49 +0100416 priv->dev = dev;
417
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100418 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
419 priv->base = devm_ioremap_resource(dev, res);
420 if (IS_ERR(priv->base))
421 return PTR_ERR(priv->base);
422
Richard Leitner4cefb742017-03-31 13:44:49 +0100423 priv->clk = devm_clk_get(dev, NULL);
Peng Fandeb31972016-06-02 12:05:11 +0100424 if (IS_ERR(priv->clk))
425 return PTR_ERR(priv->clk);
426
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100427 of_id = of_match_device(imx_ocotp_dt_ids, dev);
Bryan O'Donoghuee20d2b22017-10-24 10:54:28 +0100428 priv->params = of_device_get_match_data(&pdev->dev);
429 imx_ocotp_nvmem_config.size = 4 * priv->params->nregs;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100430 imx_ocotp_nvmem_config.dev = dev;
Srinivas Kandagatla33e5e292016-04-24 20:28:13 +0100431 imx_ocotp_nvmem_config.priv = priv;
Richard Leitner0642bac2017-03-31 13:44:55 +0100432 priv->config = &imx_ocotp_nvmem_config;
Bryan O'Donoghue9d6a8da2017-10-24 10:54:27 +0100433 if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-ocotp"))
434 imx_ocotp_nvmem_config.read_only = true;
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100435 nvmem = nvmem_register(&imx_ocotp_nvmem_config);
Richard Leitner0642bac2017-03-31 13:44:55 +0100436
Philipp Zabel3edba6b2015-09-30 13:55:47 +0100437 if (IS_ERR(nvmem))
438 return PTR_ERR(nvmem);
439
440 platform_set_drvdata(pdev, nvmem);
441
442 return 0;
443}
444
445static int imx_ocotp_remove(struct platform_device *pdev)
446{
447 struct nvmem_device *nvmem = platform_get_drvdata(pdev);
448
449 return nvmem_unregister(nvmem);
450}
451
452static struct platform_driver imx_ocotp_driver = {
453 .probe = imx_ocotp_probe,
454 .remove = imx_ocotp_remove,
455 .driver = {
456 .name = "imx_ocotp",
457 .of_match_table = imx_ocotp_dt_ids,
458 },
459};
460module_platform_driver(imx_ocotp_driver);
461
462MODULE_AUTHOR("Philipp Zabel <p.zabel@pengutronix.de>");
463MODULE_DESCRIPTION("i.MX6 OCOTP fuse box driver");
464MODULE_LICENSE("GPL v2");