linux/drivers/nvmem/lpc18xx_otp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * NXP LPC18xx/43xx OTP memory NVMEM driver
 *
 * Copyright (c) 2016 Joachim Eastwood <[email protected]>
 *
 * Based on the imx ocotp driver,
 * Copyright (c) 2015 Pengutronix, Philipp Zabel <[email protected]>
 *
 * TODO: add support for writing OTP register via API in boot ROM.
 */

#include <linux/io.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

/*
 * LPC18xx OTP memory contains 4 banks with 4 32-bit words. Bank 0 starts
 * at offset 0 from the base.
 *
 * Bank 0 contains the part ID for Flashless devices and is reseverd for
 * devices with Flash.
 * Bank 1/2 is generale purpose or AES key storage for secure devices.
 * Bank 3 contains control data, USB ID and generale purpose words.
 */
#define LPC18XX_OTP_NUM_BANKS
#define LPC18XX_OTP_WORDS_PER_BANK
#define LPC18XX_OTP_WORD_SIZE
#define LPC18XX_OTP_SIZE

struct lpc18xx_otp {};

static int lpc18xx_otp_read(void *context, unsigned int offset,
			    void *val, size_t bytes)
{}

static struct nvmem_config lpc18xx_otp_nvmem_config =;

static int lpc18xx_otp_probe(struct platform_device *pdev)
{}

static const struct of_device_id lpc18xx_otp_dt_ids[] =;
MODULE_DEVICE_TABLE(of, lpc18xx_otp_dt_ids);

static struct platform_driver lpc18xx_otp_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();