2019-05-20 10:19:02 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2009-03-04 23:01:37 +03:00
|
|
|
/*
|
|
|
|
* mach-davinci/nand.h
|
|
|
|
*
|
|
|
|
* Copyright © 2006 Texas Instruments.
|
|
|
|
*
|
|
|
|
* Ported to 2.6.23 Copyright © 2008 by
|
|
|
|
* Sander Huijsen <Shuijsen@optelecom-nkf.com>
|
|
|
|
* Troy Kisky <troy.kisky@boundarydevices.com>
|
|
|
|
* Dirk Behme <Dirk.Behme@gmail.com>
|
|
|
|
*
|
|
|
|
* --------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ARCH_ARM_DAVINCI_NAND_H
|
|
|
|
#define __ARCH_ARM_DAVINCI_NAND_H
|
|
|
|
|
2017-08-04 18:29:10 +03:00
|
|
|
#include <linux/mtd/rawnand.h>
|
2009-03-04 23:01:37 +03:00
|
|
|
|
|
|
|
#define NANDFCR_OFFSET 0x60
|
|
|
|
#define NANDFSR_OFFSET 0x64
|
|
|
|
#define NANDF1ECC_OFFSET 0x70
|
|
|
|
|
|
|
|
/* 4-bit ECC syndrome registers */
|
|
|
|
#define NAND_4BIT_ECC_LOAD_OFFSET 0xbc
|
|
|
|
#define NAND_4BIT_ECC1_OFFSET 0xc0
|
|
|
|
#define NAND_4BIT_ECC2_OFFSET 0xc4
|
|
|
|
#define NAND_4BIT_ECC3_OFFSET 0xc8
|
|
|
|
#define NAND_4BIT_ECC4_OFFSET 0xcc
|
|
|
|
#define NAND_ERR_ADD1_OFFSET 0xd0
|
|
|
|
#define NAND_ERR_ADD2_OFFSET 0xd4
|
|
|
|
#define NAND_ERR_ERRVAL1_OFFSET 0xd8
|
|
|
|
#define NAND_ERR_ERRVAL2_OFFSET 0xdc
|
|
|
|
|
|
|
|
/* NOTE: boards don't need to use these address bits
|
|
|
|
* for ALE/CLE unless they support booting from NAND.
|
|
|
|
* They're used unless platform data overrides them.
|
|
|
|
*/
|
|
|
|
#define MASK_ALE 0x08
|
|
|
|
#define MASK_CLE 0x10
|
|
|
|
|
|
|
|
struct davinci_nand_pdata { /* platform_data */
|
|
|
|
uint32_t mask_ale;
|
|
|
|
uint32_t mask_cle;
|
|
|
|
|
2018-04-30 11:24:42 +03:00
|
|
|
/*
|
|
|
|
* 0-indexed chip-select number of the asynchronous
|
|
|
|
* interface to which the NAND device has been connected.
|
|
|
|
*
|
|
|
|
* So, if you have NAND connected to CS3 of DA850, you
|
|
|
|
* will pass '1' here. Since the asynchronous interface
|
|
|
|
* on DA850 starts from CS2.
|
|
|
|
*/
|
|
|
|
uint32_t core_chipsel;
|
|
|
|
|
2009-03-04 23:01:37 +03:00
|
|
|
/* for packages using two chipselects */
|
|
|
|
uint32_t mask_chipsel;
|
|
|
|
|
|
|
|
/* board's default static partition info */
|
|
|
|
struct mtd_partition *parts;
|
|
|
|
unsigned nr_parts;
|
|
|
|
|
|
|
|
/* none == NAND_ECC_NONE (strongly *not* advised!!)
|
|
|
|
* soft == NAND_ECC_SOFT
|
2009-04-22 06:58:13 +04:00
|
|
|
* else == NAND_ECC_HW, according to ecc_bits
|
|
|
|
*
|
|
|
|
* All DaVinci-family chips support 1-bit hardware ECC.
|
|
|
|
* Newer ones also support 4-bit ECC, but are awkward
|
|
|
|
* using it with large page chips.
|
2009-03-04 23:01:37 +03:00
|
|
|
*/
|
|
|
|
nand_ecc_modes_t ecc_mode;
|
2009-04-22 06:58:13 +04:00
|
|
|
u8 ecc_bits;
|
2009-03-04 23:01:37 +03:00
|
|
|
|
2011-06-01 03:31:22 +04:00
|
|
|
/* e.g. NAND_BUSWIDTH_16 */
|
2009-03-04 23:01:37 +03:00
|
|
|
unsigned options;
|
2011-06-01 03:31:23 +04:00
|
|
|
/* e.g. NAND_BBT_USE_FLASH */
|
2011-06-01 03:31:22 +04:00
|
|
|
unsigned bbt_options;
|
2009-10-13 03:16:37 +04:00
|
|
|
|
|
|
|
/* Main and mirror bbt descriptor overrides */
|
|
|
|
struct nand_bbt_descr *bbt_td;
|
|
|
|
struct nand_bbt_descr *bbt_md;
|
2010-08-09 14:16:36 +04:00
|
|
|
|
|
|
|
/* Access timings */
|
|
|
|
struct davinci_aemif_timing *timing;
|
2009-03-04 23:01:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ARCH_ARM_DAVINCI_NAND_H */
|