linux/drivers/mtd/nand/raw/ingenic/jz4740_ecc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * JZ4740 ECC controller driver
 *
 * Copyright (c) 2019 Paul Cercueil <[email protected]>
 *
 * based on jz4740-nand.c
 */

#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>

#include "ingenic_ecc.h"

#define JZ_REG_NAND_ECC_CTRL
#define JZ_REG_NAND_DATA
#define JZ_REG_NAND_PAR0
#define JZ_REG_NAND_PAR1
#define JZ_REG_NAND_PAR2
#define JZ_REG_NAND_IRQ_STAT
#define JZ_REG_NAND_IRQ_CTRL
#define JZ_REG_NAND_ERR(x)

#define JZ_NAND_ECC_CTRL_PAR_READY
#define JZ_NAND_ECC_CTRL_ENCODING
#define JZ_NAND_ECC_CTRL_RS
#define JZ_NAND_ECC_CTRL_RESET
#define JZ_NAND_ECC_CTRL_ENABLE

#define JZ_NAND_STATUS_ERR_COUNT
#define JZ_NAND_STATUS_PAD_FINISH
#define JZ_NAND_STATUS_DEC_FINISH
#define JZ_NAND_STATUS_ENC_FINISH
#define JZ_NAND_STATUS_UNCOR_ERROR
#define JZ_NAND_STATUS_ERROR

static const uint8_t empty_block_ecc[] =;

static void jz4740_ecc_reset(struct ingenic_ecc *ecc, bool calc_ecc)
{}

static int jz4740_ecc_calculate(struct ingenic_ecc *ecc,
				struct ingenic_ecc_params *params,
				const u8 *buf, u8 *ecc_code)
{}

static void jz_nand_correct_data(uint8_t *buf, int index, int mask)
{}

static int jz4740_ecc_correct(struct ingenic_ecc *ecc,
			      struct ingenic_ecc_params *params,
			      u8 *buf, u8 *ecc_code)
{}

static void jz4740_ecc_disable(struct ingenic_ecc *ecc)
{}

static const struct ingenic_ecc_ops jz4740_ecc_ops =;

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

static struct platform_driver jz4740_ecc_driver =;
module_platform_driver();

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