linux/drivers/nvmem/rockchip-otp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Rockchip OTP Driver
 *
 * Copyright (c) 2018 Rockchip Electronics Co. Ltd.
 * Author: Finley Xiao <[email protected]>
 */

#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/nvmem-provider.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>

/* OTP Register Offsets */
#define OTPC_SBPI_CTRL
#define OTPC_SBPI_CMD_VALID_PRE
#define OTPC_SBPI_CS_VALID_PRE
#define OTPC_SBPI_STATUS
#define OTPC_USER_CTRL
#define OTPC_USER_ADDR
#define OTPC_USER_ENABLE
#define OTPC_USER_Q
#define OTPC_INT_STATUS
#define OTPC_SBPI_CMD0_OFFSET
#define OTPC_SBPI_CMD1_OFFSET

/* OTP Register bits and masks */
#define OTPC_USER_ADDR_MASK
#define OTPC_USE_USER
#define OTPC_USE_USER_MASK
#define OTPC_USER_FSM_ENABLE
#define OTPC_USER_FSM_ENABLE_MASK
#define OTPC_SBPI_DONE
#define OTPC_USER_DONE

#define SBPI_DAP_ADDR
#define SBPI_DAP_ADDR_SHIFT
#define SBPI_DAP_ADDR_MASK
#define SBPI_CMD_VALID_MASK
#define SBPI_DAP_CMD_WRF
#define SBPI_DAP_REG_ECC
#define SBPI_ECC_ENABLE
#define SBPI_ECC_DISABLE
#define SBPI_ENABLE
#define SBPI_ENABLE_MASK

#define OTPC_TIMEOUT

/* RK3588 Register */
#define RK3588_OTPC_AUTO_CTRL
#define RK3588_OTPC_AUTO_EN
#define RK3588_OTPC_INT_ST
#define RK3588_OTPC_DOUT0
#define RK3588_NO_SECURE_OFFSET
#define RK3588_NBYTES
#define RK3588_BURST_NUM
#define RK3588_BURST_SHIFT
#define RK3588_ADDR_SHIFT
#define RK3588_AUTO_EN
#define RK3588_RD_DONE

struct rockchip_data {};

struct rockchip_otp {};

static int rockchip_otp_reset(struct rockchip_otp *otp)
{}

static int rockchip_otp_wait_status(struct rockchip_otp *otp,
				    unsigned int reg, u32 flag)
{}

static int rockchip_otp_ecc_enable(struct rockchip_otp *otp, bool enable)
{}

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

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

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

static struct nvmem_config otp_config =;

static const char * const px30_otp_clocks[] =;

static const struct rockchip_data px30_data =;

static const char * const rk3588_otp_clocks[] =;

static const struct rockchip_data rk3588_data =;

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

static int rockchip_otp_probe(struct platform_device *pdev)
{}

static struct platform_driver rockchip_otp_driver =;

module_platform_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();