linux/drivers/mtd/nand/spi/xtx.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Author:
 * Felix Matouschek <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/mtd/spinand.h>

#define SPINAND_MFR_XTX

#define XT26G0XA_STATUS_ECC_MASK
#define XT26G0XA_STATUS_ECC_NO_DETECTED
#define XT26G0XA_STATUS_ECC_8_CORRECTED
#define XT26G0XA_STATUS_ECC_UNCOR_ERROR

#define XT26XXXD_STATUS_ECC3_ECC2_MASK
#define XT26XXXD_STATUS_ECC_NO_DETECTED
#define XT26XXXD_STATUS_ECC_1_7_CORRECTED
#define XT26XXXD_STATUS_ECC_8_CORRECTED
#define XT26XXXD_STATUS_ECC_UNCOR_ERROR

static SPINAND_OP_VARIANTS(read_cache_variants,
		SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
		SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
		SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
		SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
		SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
		SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));

static SPINAND_OP_VARIANTS(write_cache_variants,
		SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
		SPINAND_PROG_LOAD(true, 0, NULL, 0));

static SPINAND_OP_VARIANTS(update_cache_variants,
		SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
		SPINAND_PROG_LOAD(false, 0, NULL, 0));

static int xt26g0xa_ooblayout_ecc(struct mtd_info *mtd, int section,
				   struct mtd_oob_region *region)
{}

static int xt26g0xa_ooblayout_free(struct mtd_info *mtd, int section,
				   struct mtd_oob_region *region)
{}

static const struct mtd_ooblayout_ops xt26g0xa_ooblayout =;

static int xt26g0xa_ecc_get_status(struct spinand_device *spinand,
					 u8 status)
{}

static int xt26xxxd_ooblayout_ecc(struct mtd_info *mtd, int section,
				  struct mtd_oob_region *region)
{}

static int xt26xxxd_ooblayout_free(struct mtd_info *mtd, int section,
				   struct mtd_oob_region *region)
{}

static const struct mtd_ooblayout_ops xt26xxxd_ooblayout =;

static int xt26xxxd_ecc_get_status(struct spinand_device *spinand,
				   u8 status)
{}
static const struct spinand_info xtx_spinand_table[] =;

static const struct spinand_manufacturer_ops xtx_spinand_manuf_ops =;

const struct spinand_manufacturer xtx_spinand_manufacturer =;