linux/drivers/nvmem/imx-ocotp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * i.MX6 OCOTP fusebox driver
 *
 * Copyright (c) 2015 Pengutronix, Philipp Zabel <[email protected]>
 *
 * Copyright 2019 NXP
 *
 * Based on the barebox ocotp driver,
 * Copyright (c) 2010 Baruch Siach <[email protected]>,
 *	Orex Computed Radiography
 *
 * Write support based on the fsl_otp driver,
 * Copyright (C) 2010-2013 Freescale Semiconductor, Inc
 */

#include <linux/clk.h>
#include <linux/device.h>
#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>
#include <linux/delay.h>

#define IMX_OCOTP_OFFSET_B0W0
#define IMX_OCOTP_OFFSET_PER_WORD

#define IMX_OCOTP_ADDR_CTRL
#define IMX_OCOTP_ADDR_CTRL_SET
#define IMX_OCOTP_ADDR_CTRL_CLR
#define IMX_OCOTP_ADDR_TIMING
#define IMX_OCOTP_ADDR_DATA0
#define IMX_OCOTP_ADDR_DATA1
#define IMX_OCOTP_ADDR_DATA2
#define IMX_OCOTP_ADDR_DATA3

#define IMX_OCOTP_BM_CTRL_ADDR
#define IMX_OCOTP_BM_CTRL_BUSY
#define IMX_OCOTP_BM_CTRL_ERROR
#define IMX_OCOTP_BM_CTRL_REL_SHADOWS

#define IMX_OCOTP_BM_CTRL_ADDR_8MP
#define IMX_OCOTP_BM_CTRL_BUSY_8MP
#define IMX_OCOTP_BM_CTRL_ERROR_8MP
#define IMX_OCOTP_BM_CTRL_REL_SHADOWS_8MP

#define IMX_OCOTP_BM_CTRL_DEFAULT

#define IMX_OCOTP_BM_CTRL_8MP

#define TIMING_STROBE_PROG_US
#define TIMING_STROBE_READ_NS
#define TIMING_RELAX_NS
#define DEF_FSOURCE
#define DEF_STROBE_PROG
#define IMX_OCOTP_WR_UNLOCK
#define IMX_OCOTP_READ_LOCKED_VAL

static DEFINE_MUTEX(ocotp_mutex);

struct ocotp_priv {};

struct ocotp_ctrl_reg {};

struct ocotp_params {};

static int imx_ocotp_wait_for_busy(struct ocotp_priv *priv, u32 flags)
{}

static void imx_ocotp_clr_err_if_set(struct ocotp_priv *priv)
{}

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

static int imx_ocotp_cell_pp(void *context, const char *id, int index,
			     unsigned int offset, void *data, size_t bytes)
{}

static void imx_ocotp_set_imx6_timing(struct ocotp_priv *priv)
{}

static void imx_ocotp_set_imx7_timing(struct ocotp_priv *priv)
{}

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

static struct nvmem_config imx_ocotp_nvmem_config =;

static const struct ocotp_params imx6q_params =;

static const struct ocotp_params imx6sl_params =;

static const struct ocotp_params imx6sll_params =;

static const struct ocotp_params imx6sx_params =;

static const struct ocotp_params imx6ul_params =;

static const struct ocotp_params imx6ull_params =;

static const struct ocotp_params imx7d_params =;

static const struct ocotp_params imx7ulp_params =;

static const struct ocotp_params imx8mq_params =;

static const struct ocotp_params imx8mm_params =;

static const struct ocotp_params imx8mn_params =;

static const struct ocotp_params imx8mp_params =;

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

static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,
					 struct nvmem_cell_info *cell)
{}

static int imx_ocotp_probe(struct platform_device *pdev)
{}

static struct platform_driver imx_ocotp_driver =;
module_platform_driver();

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