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

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2018 Macronix
 *
 * Author: Boris Brezillon <[email protected]>
 */

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

#define SPINAND_MFR_MACRONIX
#define MACRONIX_ECCSR_BF_LAST_PAGE(eccsr)
#define MACRONIX_ECCSR_BF_ACCUMULATED_PAGES(eccsr)
#define MACRONIX_CFG_CONT_READ

#define STATUS_ECC_HAS_BITFLIPS_THRESHOLD

/* Bitflip theshold configuration register */
#define REG_CFG_BFT
#define CFG_BFT(x)

struct macronix_priv {};

static SPINAND_OP_VARIANTS(read_cache_variants,
		SPINAND_PAGE_READ_FROM_CACHE_X4_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(false, 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 mx35lfxge4ab_ooblayout_ecc(struct mtd_info *mtd, int section,
				      struct mtd_oob_region *region)
{}

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

static const struct mtd_ooblayout_ops mx35lfxge4ab_ooblayout =;

static int macronix_get_eccsr(struct spinand_device *spinand, u8 *eccsr)
{}

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

static int macronix_set_cont_read(struct spinand_device *spinand, bool enable)
{}

static const struct spinand_info macronix_spinand_table[] =;

static int macronix_spinand_init(struct spinand_device *spinand)
{}

static void macronix_spinand_cleanup(struct spinand_device *spinand)
{}

static const struct spinand_manufacturer_ops macronix_spinand_manuf_ops =;

const struct spinand_manufacturer macronix_spinand_manufacturer =;