|
20 | 20 | #include <linux/slab.h>
|
21 | 21 | #include <linux/of.h>
|
22 | 22 |
|
23 |
| -#include <linux/platform_data/mtd-davinci.h> |
24 |
| -#include <linux/platform_data/mtd-davinci-aemif.h> |
| 23 | +#define NRCSR_OFFSET 0x00 |
| 24 | +#define NANDFCR_OFFSET 0x60 |
| 25 | +#define NANDFSR_OFFSET 0x64 |
| 26 | +#define NANDF1ECC_OFFSET 0x70 |
| 27 | + |
| 28 | +/* 4-bit ECC syndrome registers */ |
| 29 | +#define NAND_4BIT_ECC_LOAD_OFFSET 0xbc |
| 30 | +#define NAND_4BIT_ECC1_OFFSET 0xc0 |
| 31 | +#define NAND_4BIT_ECC2_OFFSET 0xc4 |
| 32 | +#define NAND_4BIT_ECC3_OFFSET 0xc8 |
| 33 | +#define NAND_4BIT_ECC4_OFFSET 0xcc |
| 34 | +#define NAND_ERR_ADD1_OFFSET 0xd0 |
| 35 | +#define NAND_ERR_ADD2_OFFSET 0xd4 |
| 36 | +#define NAND_ERR_ERRVAL1_OFFSET 0xd8 |
| 37 | +#define NAND_ERR_ERRVAL2_OFFSET 0xdc |
| 38 | + |
| 39 | +/* NOTE: boards don't need to use these address bits |
| 40 | + * for ALE/CLE unless they support booting from NAND. |
| 41 | + * They're used unless platform data overrides them. |
| 42 | + */ |
| 43 | +#define MASK_ALE 0x08 |
| 44 | +#define MASK_CLE 0x10 |
| 45 | + |
| 46 | +struct davinci_nand_pdata { |
| 47 | + uint32_t mask_ale; |
| 48 | + uint32_t mask_cle; |
| 49 | + |
| 50 | + /* |
| 51 | + * 0-indexed chip-select number of the asynchronous |
| 52 | + * interface to which the NAND device has been connected. |
| 53 | + * |
| 54 | + * So, if you have NAND connected to CS3 of DA850, you |
| 55 | + * will pass '1' here. Since the asynchronous interface |
| 56 | + * on DA850 starts from CS2. |
| 57 | + */ |
| 58 | + uint32_t core_chipsel; |
| 59 | + |
| 60 | + /* for packages using two chipselects */ |
| 61 | + uint32_t mask_chipsel; |
| 62 | + |
| 63 | + /* board's default static partition info */ |
| 64 | + struct mtd_partition *parts; |
| 65 | + unsigned int nr_parts; |
| 66 | + |
| 67 | + /* none == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!) |
| 68 | + * soft == NAND_ECC_ENGINE_TYPE_SOFT |
| 69 | + * else == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits |
| 70 | + * |
| 71 | + * All DaVinci-family chips support 1-bit hardware ECC. |
| 72 | + * Newer ones also support 4-bit ECC, but are awkward |
| 73 | + * using it with large page chips. |
| 74 | + */ |
| 75 | + enum nand_ecc_engine_type engine_type; |
| 76 | + enum nand_ecc_placement ecc_placement; |
| 77 | + u8 ecc_bits; |
| 78 | + |
| 79 | + /* e.g. NAND_BUSWIDTH_16 */ |
| 80 | + unsigned int options; |
| 81 | + /* e.g. NAND_BBT_USE_FLASH */ |
| 82 | + unsigned int bbt_options; |
| 83 | + |
| 84 | + /* Main and mirror bbt descriptor overrides */ |
| 85 | + struct nand_bbt_descr *bbt_td; |
| 86 | + struct nand_bbt_descr *bbt_md; |
| 87 | +}; |
25 | 88 |
|
26 | 89 | /*
|
27 | 90 | * This is a device driver for the NAND flash controller found on the
|
@@ -54,8 +117,6 @@ struct davinci_nand_info {
|
54 | 117 | uint32_t mask_cle;
|
55 | 118 |
|
56 | 119 | uint32_t core_chipsel;
|
57 |
| - |
58 |
| - struct davinci_aemif_timing *timing; |
59 | 120 | };
|
60 | 121 |
|
61 | 122 | static DEFINE_SPINLOCK(davinci_nand_lock);
|
@@ -775,7 +836,6 @@ static int nand_davinci_probe(struct platform_device *pdev)
|
775 | 836 | info->chip.options = pdata->options;
|
776 | 837 | info->chip.bbt_td = pdata->bbt_td;
|
777 | 838 | info->chip.bbt_md = pdata->bbt_md;
|
778 |
| - info->timing = pdata->timing; |
779 | 839 |
|
780 | 840 | info->current_cs = info->vaddr;
|
781 | 841 | info->core_chipsel = pdata->core_chipsel;
|
|
0 commit comments