/* SPDX-License-Identifier: GPL-2.0+ */ /* * Freescale GPMI NAND Flash Driver * * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. * Copyright (C) 2008 Embedded Alley Solutions, Inc. */ #ifndef __DRIVERS_MTD_NAND_GPMI_NAND_H #define __DRIVERS_MTD_NAND_GPMI_NAND_H #include <linux/mtd/rawnand.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/dmaengine.h> #define GPMI_CLK_MAX … struct resources { … }; /** * struct bch_geometry - BCH geometry description. * @gf_len: The length of Galois Field. (e.g., 13 or 14) * @ecc_strength: A number that describes the strength of the ECC * algorithm. * @page_size: The size, in bytes, of a physical page, including * both data and OOB. * @metadata_size: The size, in bytes, of the metadata. * @ecc0_chunk_size: The size, in bytes, of a first ECC chunk. * @eccn_chunk_size: The size, in bytes, of a single ECC chunk after * the first chunk in the page. * @ecc_chunk_count: The number of ECC chunks in the page, * @payload_size: The size, in bytes, of the payload buffer. * @auxiliary_size: The size, in bytes, of the auxiliary buffer. * @auxiliary_status_offset: The offset into the auxiliary buffer at which * the ECC status appears. * @block_mark_byte_offset: The byte offset in the ECC-based page view at * which the underlying physical block mark appears. * @block_mark_bit_offset: The bit offset into the ECC-based page view at * which the underlying physical block mark appears. * @ecc_for_meta: The flag to indicate if there is a dedicate ecc * for meta. */ struct bch_geometry { … }; /** * struct boot_rom_geometry - Boot ROM geometry description. * @stride_size_in_pages: The size of a boot block stride, in pages. * @search_area_stride_exponent: The logarithm to base 2 of the size of a * search area in boot block strides. */ struct boot_rom_geometry { … }; enum gpmi_type { … }; struct gpmi_devdata { … }; /** * struct gpmi_nfc_hardware_timing - GPMI hardware timing parameters. * @must_apply_timings: Whether controller timings have already been * applied or not (useful only while there is * support for only one chip select) * @clk_rate: The clock rate that must be used to derive the * following parameters * @timing0: HW_GPMI_TIMING0 register * @timing1: HW_GPMI_TIMING1 register * @ctrl1n: HW_GPMI_CTRL1n register */ struct gpmi_nfc_hardware_timing { … }; #define GPMI_MAX_TRANSFERS … struct gpmi_transfer { … }; struct gpmi_nand_data { … }; /* BCH : Status Block Completion Codes */ #define STATUS_GOOD … #define STATUS_ERASED … #define STATUS_UNCORRECTABLE … /* Use the devdata to distinguish different Archs. */ #define GPMI_IS_MX23(x) … #define GPMI_IS_MX28(x) … #define GPMI_IS_MX6Q(x) … #define GPMI_IS_MX6SX(x) … #define GPMI_IS_MX7D(x) … #define GPMI_IS_MX8QXP(x) … #define GPMI_IS_MX6(x) … #define GPMI_IS_MXS(x) … #endif