Lines Matching +full:otp +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0-only
3 * NXP LPC18xx/43xx OTP memory NVMEM driver
10 * TODO: add support for writing OTP register via API in boot ROM.
15 #include <linux/nvmem-provider.h>
21 * LPC18xx OTP memory contains 4 banks with 4 32-bit words. Bank 0 starts
26 * Bank 1/2 is generale purpose or AES key storage for secure devices.
43 struct lpc18xx_otp *otp = context; in lpc18xx_otp_read() local
49 if (count > (LPC18XX_OTP_SIZE - index)) in lpc18xx_otp_read()
50 count = LPC18XX_OTP_SIZE - index; in lpc18xx_otp_read()
53 *buf++ = readl(otp->base + i * LPC18XX_OTP_WORD_SIZE); in lpc18xx_otp_read()
59 .name = "lpc18xx-otp",
69 struct lpc18xx_otp *otp; in lpc18xx_otp_probe() local
71 otp = devm_kzalloc(&pdev->dev, sizeof(*otp), GFP_KERNEL); in lpc18xx_otp_probe()
72 if (!otp) in lpc18xx_otp_probe()
73 return -ENOMEM; in lpc18xx_otp_probe()
75 otp->base = devm_platform_ioremap_resource(pdev, 0); in lpc18xx_otp_probe()
76 if (IS_ERR(otp->base)) in lpc18xx_otp_probe()
77 return PTR_ERR(otp->base); in lpc18xx_otp_probe()
80 lpc18xx_otp_nvmem_config.dev = &pdev->dev; in lpc18xx_otp_probe()
81 lpc18xx_otp_nvmem_config.priv = otp; in lpc18xx_otp_probe()
83 nvmem = devm_nvmem_register(&pdev->dev, &lpc18xx_otp_nvmem_config); in lpc18xx_otp_probe()
89 { .compatible = "nxp,lpc1850-otp" },
104 MODULE_DESCRIPTION("NXP LPC18xx OTP NVMEM driver");