linux/drivers/nvmem/sunplus-ocotp.c

// SPDX-License-Identifier: GPL-2.0

/*
 * The OCOTP driver for Sunplus	SP7021
 *
 * Copyright (C) 2019 Sunplus Technology Inc., All rights reserved.
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/nvmem-provider.h>
#include <linux/platform_device.h>

/*
 * OTP memory
 * Each bank contains 4 words (32 bits).
 * Bank 0 starts at offset 0 from the base.
 */

#define OTP_WORDS_PER_BANK
#define OTP_WORD_SIZE
#define OTP_BIT_ADDR_OF_BANK
#define QAC628_OTP_NUM_BANKS
#define QAC628_OTP_SIZE
#define OTP_READ_TIMEOUT_US

/* HB_GPIO */
#define ADDRESS_8_DATA

/* OTP_RX */
#define OTP_CONTROL_2
#define OTP_RD_PERIOD
#define OTP_RD_PERIOD_MASK
#define CPU_CLOCK
#define SEL_BAK_KEY2
#define SEL_BAK_KEY2_MASK
#define SW_TRIM_EN
#define SW_TRIM_EN_MASK
#define SEL_BAK_KEY
#define SEL_BAK_KEY_MASK
#define OTP_READ
#define OTP_LOAD_SECURE_DATA
#define OTP_LOAD_SECURE_DATA_MASK
#define OTP_DO_CRC
#define OTP_DO_CRC_MASK
#define OTP_STATUS
#define OTP_READ_DONE
#define OTP_READ_DONE_MASK
#define OTP_LOAD_SECURE_DONE_MASK
#define OTP_READ_ADDRESS

enum base_type {};

struct sp_ocotp_priv {};

struct sp_ocotp_data {};

static const struct sp_ocotp_data sp_otp_v0 =;

static int sp_otp_read_real(struct sp_ocotp_priv *otp, int addr, char *value)
{}

static int sp_ocotp_read(void *priv, unsigned int offset, void *value, size_t bytes)
{}

static struct nvmem_config sp_ocotp_nvmem_config =;

static int sp_ocotp_probe(struct platform_device *pdev)
{}

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

static struct platform_driver sp_otp_driver =;
module_platform_driver();

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