diff options
Diffstat (limited to 'drivers/mtd/chips/cfi_cmdset_0002.c')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 9885726a16e4..8901c4412daf 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -161,6 +161,26 @@ static void fixup_use_write_buffers(struct mtd_info *mtd, void *param) | |||
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | /* Atmel chips don't use the same PRI format as AMD chips */ | ||
165 | static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) | ||
166 | { | ||
167 | struct map_info *map = mtd->priv; | ||
168 | struct cfi_private *cfi = map->fldrv_priv; | ||
169 | struct cfi_pri_amdstd *extp = cfi->cmdset_priv; | ||
170 | struct cfi_pri_atmel atmel_pri; | ||
171 | |||
172 | memcpy(&atmel_pri, extp, sizeof(atmel_pri)); | ||
173 | memset(extp + 5, 0, sizeof(*extp) - 5); | ||
174 | |||
175 | if (atmel_pri.Features & 0x02) | ||
176 | extp->EraseSuspend = 2; | ||
177 | |||
178 | if (atmel_pri.BottomBoot) | ||
179 | extp->TopBottom = 2; | ||
180 | else | ||
181 | extp->TopBottom = 3; | ||
182 | } | ||
183 | |||
164 | static void fixup_use_secsi(struct mtd_info *mtd, void *param) | 184 | static void fixup_use_secsi(struct mtd_info *mtd, void *param) |
165 | { | 185 | { |
166 | /* Setup for chips with a secsi area */ | 186 | /* Setup for chips with a secsi area */ |
@@ -192,6 +212,7 @@ static struct cfi_fixup cfi_fixup_table[] = { | |||
192 | #if !FORCE_WORD_WRITE | 212 | #if !FORCE_WORD_WRITE |
193 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, }, | 213 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, }, |
194 | #endif | 214 | #endif |
215 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, | ||
195 | { 0, 0, NULL, NULL } | 216 | { 0, 0, NULL, NULL } |
196 | }; | 217 | }; |
197 | static struct cfi_fixup jedec_fixup_table[] = { | 218 | static struct cfi_fixup jedec_fixup_table[] = { |