]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - patches/0024-ENGR00114236-Disable-NAND-driver-interleave-mode-sup.patch
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / patches / 0024-ENGR00114236-Disable-NAND-driver-interleave-mode-sup.patch
1 From afbf753cb44a5b7dfb8bcff430b48a4999214f02 Mon Sep 17 00:00:00 2001
2 From: Jason <r64343@freescale.com>
3 Date: Wed, 15 Jul 2009 14:12:05 +0800
4 Subject: [PATCH] ENGR00114236 Disable NAND driver interleave mode support
5
6 Disable NAND driver interleave mode support
7
8 Signed-off-by:Jason Liu <r64343@freescale.com>
9 ---
10  drivers/mtd/nand/mxc_nand.c |   36 +++++++++++++-----------------------
11  1 files changed, 13 insertions(+), 23 deletions(-)
12
13 diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
14 index ae02d6a..f6dd23b 100644
15 --- a/drivers/mtd/nand/mxc_nand.c
16 +++ b/drivers/mtd/nand/mxc_nand.c
17 @@ -1069,7 +1069,7 @@ static uint8_t mirror_pattern[] = { '1', 't', 'b', 'B' };
18  
19  static struct nand_bbt_descr bbt_main_descr = {
20         .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
21 -           | NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
22 +           | NAND_BBT_2BIT | NAND_BBT_VERSION,
23         .offs = 0,
24         .len = 4,
25         .veroffs = 4,
26 @@ -1079,7 +1079,7 @@ static struct nand_bbt_descr bbt_main_descr = {
27  
28  static struct nand_bbt_descr bbt_mirror_descr = {
29         .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
30 -           | NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
31 +           | NAND_BBT_2BIT | NAND_BBT_VERSION,
32         .offs = 0,
33         .len = 4,
34         .veroffs = 4,
35 @@ -1094,6 +1094,17 @@ static int mxc_nand_scan_bbt(struct mtd_info *mtd)
36  
37         info->page_mask = this->pagemask;
38  
39 +       /* limit to 2G size due to Kernel
40 +        * larger 4G space support,need fix
41 +        * it later
42 +        */
43 +       if (mtd->size == 0) {
44 +               mtd->size = 1 << 31;
45 +               this->numchips = 1;
46 +               this->chipsize = mtd->size;
47 +       }
48 +
49 +
50         if (IS_2K_PAGE_NAND) {
51                 NFC_SET_NFMS(1 << NFMS_NF_PG_SZ);
52                 this->ecc.layout = &nand_hw_eccoob_2k;
53 @@ -1107,27 +1118,6 @@ static int mxc_nand_scan_bbt(struct mtd_info *mtd)
54                 info->large_page = 0;
55         }
56  
57 -       /* reconfig for interleave mode */
58 -
59 -       if (this->numchips > 1 && info->auto_mode) {
60 -               info->num_of_intlv = this->numchips;
61 -               this->numchips = 1;
62 -
63 -               /* FIXEME:need remove it
64 -                * when kernel support
65 -                * 4G larger space
66 -                */
67 -               mtd->size = this->chipsize;
68 -               mtd->erasesize *= info->num_of_intlv;
69 -               mtd->writesize *= info->num_of_intlv;
70 -               mtd->oobsize *= info->num_of_intlv;
71 -               this->page_shift = ffs(mtd->writesize) - 1;
72 -               this->bbt_erase_shift =
73 -               this->phys_erase_shift = ffs(mtd->erasesize) - 1;
74 -               this->chip_shift = ffs(this->chipsize) - 1;
75 -               this->oob_poi = this->buffers->databuf + mtd->writesize;
76 -       }
77 -
78         /* propagate ecc.layout to mtd_info */
79         mtd->ecclayout = this->ecc.layout;
80  
81 -- 
82 1.5.4.4
83