linux/drivers/mtd/nand/raw/nand_macronix.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2017 Free Electrons
 * Copyright (C) 2017 NextThing Co
 *
 * Author: Boris Brezillon <[email protected]>
 */

#include <linux/slab.h>
#include "linux/delay.h"
#include "internals.h"

#define MACRONIX_READ_RETRY_BIT
#define MACRONIX_NUM_READ_RETRY_MODES

#define ONFI_FEATURE_ADDR_MXIC_PROTECTION
#define MXIC_BLOCK_PROTECTION_ALL_LOCK
#define MXIC_BLOCK_PROTECTION_ALL_UNLOCK

#define ONFI_FEATURE_ADDR_MXIC_RANDOMIZER
#define MACRONIX_RANDOMIZER_BIT
#define MACRONIX_RANDOMIZER_ENPGM
#define MACRONIX_RANDOMIZER_RANDEN
#define MACRONIX_RANDOMIZER_RANDOPT
#define MACRONIX_RANDOMIZER_MODE_ENTER
#define MACRONIX_RANDOMIZER_MODE_EXIT

#define MXIC_CMD_POWER_DOWN

#define ONFI_FEATURE_ADDR_30LFXG18AC_OTP
#define MACRONIX_30LFXG18AC_OTP_START_PAGE
#define MACRONIX_30LFXG18AC_OTP_PAGES
#define MACRONIX_30LFXG18AC_OTP_PAGE_SIZE
#define MACRONIX_30LFXG18AC_OTP_SIZE_BYTES

#define MACRONIX_30LFXG18AC_OTP_EN

struct nand_onfi_vendor_macronix {} __packed;

static int macronix_nand_setup_read_retry(struct nand_chip *chip, int mode)
{}

static int macronix_nand_randomizer_check_enable(struct nand_chip *chip)
{}

static void macronix_nand_onfi_init(struct nand_chip *chip)
{}

/*
 * Macronix AC series does not support using SET/GET_FEATURES to change
 * the timings unlike what is declared in the parameter page. Unflag
 * this feature to avoid unnecessary downturns.
 */
static void macronix_nand_fix_broken_get_timings(struct nand_chip *chip)
{}

/*
 * Macronix NAND supports Block Protection by Protectoin(PT) pin;
 * active high at power-on which protects the entire chip even the #WP is
 * disabled. Lock/unlock protection area can be partition according to
 * protection bits, i.e. upper 1/2 locked, upper 1/4 locked and so on.
 */
static int mxic_nand_lock(struct nand_chip *chip, loff_t ofs, uint64_t len)
{}

static int mxic_nand_unlock(struct nand_chip *chip, loff_t ofs, uint64_t len)
{}

static void macronix_nand_block_protection_support(struct nand_chip *chip)
{}

static int nand_power_down_op(struct nand_chip *chip)
{}

static int mxic_nand_suspend(struct nand_chip *chip)
{}

static void mxic_nand_resume(struct nand_chip *chip)
{}

static void macronix_nand_deep_power_down_support(struct nand_chip *chip)
{}

static int macronix_30lfxg18ac_get_otp_info(struct mtd_info *mtd, size_t len,
					    size_t *retlen,
					    struct otp_info *buf)
{}

static int macronix_30lfxg18ac_otp_enable(struct nand_chip *nand)
{}

static int macronix_30lfxg18ac_otp_disable(struct nand_chip *nand)
{}

static int __macronix_30lfxg18ac_rw_otp(struct mtd_info *mtd,
					loff_t offs_in_flash,
					size_t len, size_t *retlen,
					u_char *buf, bool write)
{}

static int macronix_30lfxg18ac_write_otp(struct mtd_info *mtd, loff_t to,
					 size_t len, size_t *rlen,
					 const u_char *buf)
{}

static int macronix_30lfxg18ac_read_otp(struct mtd_info *mtd, loff_t from,
					size_t len, size_t *rlen,
					u_char *buf)
{}

static int macronix_30lfxg18ac_lock_otp(struct mtd_info *mtd, loff_t from,
					size_t len)
{}

static void macronix_nand_setup_otp(struct nand_chip *chip)
{}

static int macronix_nand_init(struct nand_chip *chip)
{}

const struct nand_manufacturer_ops macronix_nand_manuf_ops =;