linux/include/linux/mtd/onfi.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright © 2000-2010 David Woodhouse <[email protected]>
 *			 Steven J. Hill <[email protected]>
 *			 Thomas Gleixner <[email protected]>
 *
 * Contains all ONFI related definitions
 */

#ifndef __LINUX_MTD_ONFI_H
#define __LINUX_MTD_ONFI_H

#include <linux/types.h>
#include <linux/bitfield.h>

/* ONFI version bits */
#define ONFI_VERSION_1_0
#define ONFI_VERSION_2_0
#define ONFI_VERSION_2_1
#define ONFI_VERSION_2_2
#define ONFI_VERSION_2_3
#define ONFI_VERSION_3_0
#define ONFI_VERSION_3_1
#define ONFI_VERSION_3_2
#define ONFI_VERSION_4_0

/* ONFI features */
#define ONFI_FEATURE_16_BIT_BUS
#define ONFI_FEATURE_NV_DDR
#define ONFI_FEATURE_EXT_PARAM_PAGE

/* ONFI timing mode, used in both asynchronous and synchronous mode */
#define ONFI_DATA_INTERFACE_SDR
#define ONFI_DATA_INTERFACE_NVDDR
#define ONFI_DATA_INTERFACE_NVDDR2
#define ONFI_TIMING_MODE_0
#define ONFI_TIMING_MODE_1
#define ONFI_TIMING_MODE_2
#define ONFI_TIMING_MODE_3
#define ONFI_TIMING_MODE_4
#define ONFI_TIMING_MODE_5
#define ONFI_TIMING_MODE_UNKNOWN
#define ONFI_TIMING_MODE_PARAM(x)

/* ONFI feature number/address */
#define ONFI_FEATURE_NUMBER
#define ONFI_FEATURE_ADDR_TIMING_MODE

/* Vendor-specific feature address (Micron) */
#define ONFI_FEATURE_ADDR_READ_RETRY
#define ONFI_FEATURE_ON_DIE_ECC
#define ONFI_FEATURE_ON_DIE_ECC_EN

/* ONFI subfeature parameters length */
#define ONFI_SUBFEATURE_PARAM_LEN

/* ONFI optional commands SET/GET FEATURES supported? */
#define ONFI_OPT_CMD_READ_CACHE
#define ONFI_OPT_CMD_SET_GET_FEATURES

struct nand_onfi_params {} __packed;

#define ONFI_CRC_BASE

/* Extended ECC information Block Definition (since ONFI 2.1) */
struct onfi_ext_ecc_info {} __packed;

#define ONFI_SECTION_TYPE_0
#define ONFI_SECTION_TYPE_1
#define ONFI_SECTION_TYPE_2
struct onfi_ext_section {} __packed;

#define ONFI_EXT_SECTION_MAX

/* Extended Parameter Page Definition (since ONFI 2.1) */
struct onfi_ext_param_page {} __packed;

/**
 * struct onfi_params - ONFI specific parameters that will be reused
 * @version: ONFI version (BCD encoded), 0 if ONFI is not supported
 * @tPROG: Page program time
 * @tBERS: Block erase time
 * @tR: Page read time
 * @tCCS: Change column setup time
 * @fast_tCAD: Command/Address/Data slow or fast delay (NV-DDR only)
 * @sdr_timing_modes: Supported asynchronous/SDR timing modes
 * @nvddr_timing_modes: Supported source synchronous/NV-DDR timing modes
 * @vendor_revision: Vendor specific revision number
 * @vendor: Vendor specific data
 */
struct onfi_params {};

#endif /* __LINUX_MTD_ONFI_H */