diff options
author | Armando Visconti <armando.visconti@st.com> | 2012-03-07 06:30:55 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:50:00 -0400 |
commit | 0c78e93b44f39d4e5dfd4ebfc529cd74ac2a9bbb (patch) | |
tree | 80c4373f5a8155be4ad16a5f3044a7156a6666ae /drivers/mtd/nand/fsmc_nand.c | |
parent | 753e0139e5569946056a8d5960111665a7f8f6f1 (diff) |
mtd: fsmc: Support of 224-bytes OOB area length
The current patch is required to support EVALSPEAR1340CPU
Revision 2 where a new (ONFI compliant) MT29F16G08 NAND
flash from Micron is present.
This NAND flash device defines a OOB area which is
224 bytes long (oobsize).
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/fsmc_nand.c')
-rw-r--r-- | drivers/mtd/nand/fsmc_nand.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index 5b217f2a31b7..4a018d0b7034 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c | |||
@@ -130,6 +130,42 @@ static struct nand_ecclayout fsmc_ecc4_256_layout = { | |||
130 | }; | 130 | }; |
131 | 131 | ||
132 | /* | 132 | /* |
133 | * ECC4 layout for NAND of pagesize 4096 bytes & OOBsize 224 bytes. 13*8 bytes | ||
134 | * of OOB size is reserved for ECC, Byte no. 0 & 1 reserved for bad block & 118 | ||
135 | * bytes are free for use. | ||
136 | */ | ||
137 | static struct nand_ecclayout fsmc_ecc4_224_layout = { | ||
138 | .eccbytes = 104, | ||
139 | .eccpos = { 2, 3, 4, 5, 6, 7, 8, | ||
140 | 9, 10, 11, 12, 13, 14, | ||
141 | 18, 19, 20, 21, 22, 23, 24, | ||
142 | 25, 26, 27, 28, 29, 30, | ||
143 | 34, 35, 36, 37, 38, 39, 40, | ||
144 | 41, 42, 43, 44, 45, 46, | ||
145 | 50, 51, 52, 53, 54, 55, 56, | ||
146 | 57, 58, 59, 60, 61, 62, | ||
147 | 66, 67, 68, 69, 70, 71, 72, | ||
148 | 73, 74, 75, 76, 77, 78, | ||
149 | 82, 83, 84, 85, 86, 87, 88, | ||
150 | 89, 90, 91, 92, 93, 94, | ||
151 | 98, 99, 100, 101, 102, 103, 104, | ||
152 | 105, 106, 107, 108, 109, 110, | ||
153 | 114, 115, 116, 117, 118, 119, 120, | ||
154 | 121, 122, 123, 124, 125, 126 | ||
155 | }, | ||
156 | .oobfree = { | ||
157 | {.offset = 15, .length = 3}, | ||
158 | {.offset = 31, .length = 3}, | ||
159 | {.offset = 47, .length = 3}, | ||
160 | {.offset = 63, .length = 3}, | ||
161 | {.offset = 79, .length = 3}, | ||
162 | {.offset = 95, .length = 3}, | ||
163 | {.offset = 111, .length = 3}, | ||
164 | {.offset = 127, .length = 97} | ||
165 | } | ||
166 | }; | ||
167 | |||
168 | /* | ||
133 | * ECC4 layout for NAND of pagesize 4096 bytes & OOBsize 128 bytes. 13*8 bytes | 169 | * ECC4 layout for NAND of pagesize 4096 bytes & OOBsize 128 bytes. 13*8 bytes |
134 | * of OOB size is reserved for ECC, Byte no. 0 & 1 reserved for bad block & 22 | 170 | * of OOB size is reserved for ECC, Byte no. 0 & 1 reserved for bad block & 22 |
135 | * bytes are free for use. | 171 | * bytes are free for use. |
@@ -856,6 +892,10 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) | |||
856 | nand->ecc.layout = &fsmc_ecc4_128_layout; | 892 | nand->ecc.layout = &fsmc_ecc4_128_layout; |
857 | host->ecc_place = &fsmc_ecc4_lp_place; | 893 | host->ecc_place = &fsmc_ecc4_lp_place; |
858 | break; | 894 | break; |
895 | case 224: | ||
896 | nand->ecc.layout = &fsmc_ecc4_224_layout; | ||
897 | host->ecc_place = &fsmc_ecc4_lp_place; | ||
898 | break; | ||
859 | case 256: | 899 | case 256: |
860 | nand->ecc.layout = &fsmc_ecc4_256_layout; | 900 | nand->ecc.layout = &fsmc_ecc4_256_layout; |
861 | host->ecc_place = &fsmc_ecc4_lp_place; | 901 | host->ecc_place = &fsmc_ecc4_lp_place; |