1 /***************************************************************************
2 * Copyright (C) 2007 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
32 /* non-CFI compatible flashes */
33 non_cfi_t non_cfi_flashes[] = {
39 .interface_desc = 0x0,
40 .max_buf_write_size = 0x0,
41 .num_erase_regions = 1,
53 .interface_desc = 0x0,
54 .max_buf_write_size = 0x0,
55 .num_erase_regions = 1,
67 .interface_desc = 0x0,
68 .max_buf_write_size = 0x0,
69 .num_erase_regions = 1,
81 .interface_desc = 0x0,
82 .max_buf_write_size = 0x0,
83 .num_erase_regions = 1,
96 void cfi_fixup_non_cfi(flash_bank_t *bank, void *param)
98 cfi_flash_bank_t *cfi_info = bank->driver_priv;
99 non_cfi_t *non_cfi = non_cfi_flashes;
103 if ((cfi_info->manufacturer == non_cfi->mfr)
104 && (cfi_info->device_id == non_cfi->id))
111 cfi_info->not_cfi = 1;
113 /* fill in defaults for non-critical data */
114 cfi_info->vcc_min = 0x0;
115 cfi_info->vcc_max = 0x0;
116 cfi_info->vpp_min = 0x0;
117 cfi_info->vpp_max = 0x0;
118 cfi_info->word_write_timeout_typ = 0x0;
119 cfi_info->buf_write_timeout_typ = 0x0;
120 cfi_info->block_erase_timeout_typ = 0x0;
121 cfi_info->chip_erase_timeout_typ = 0x0;
122 cfi_info->word_write_timeout_max = 0x0;
123 cfi_info->buf_write_timeout_max = 0x0;
124 cfi_info->block_erase_timeout_max = 0x0;
125 cfi_info->chip_erase_timeout_max = 0x0;
127 cfi_info->qry[0] = 'Q';
128 cfi_info->qry[1] = 'R';
129 cfi_info->qry[2] = 'Y';
131 cfi_info->pri_id = non_cfi->pri_id;
132 cfi_info->pri_addr = 0x0;
133 cfi_info->alt_id = 0x0;
134 cfi_info->alt_addr = 0x0;
135 cfi_info->alt_ext = NULL;
137 cfi_info->interface_desc = non_cfi->interface_desc;
138 cfi_info->max_buf_write_size = non_cfi->max_buf_write_size;
139 cfi_info->num_erase_regions = non_cfi->num_erase_regions;
140 cfi_info->erase_region_info = non_cfi->erase_region_info;
142 if (cfi_info->pri_id == 0x2)
144 cfi_spansion_pri_ext_t *pri_ext = malloc(sizeof(cfi_spansion_pri_ext_t));
146 pri_ext->pri[0] = 'P';
147 pri_ext->pri[1] = 'R';
148 pri_ext->pri[2] = 'I';
150 pri_ext->major_version = '1';
151 pri_ext->minor_version = '0';
153 pri_ext->SiliconRevision = 0x0;
154 pri_ext->EraseSuspend = 0x0;
155 pri_ext->EraseSuspend = 0x0;
156 pri_ext->BlkProt = 0x0;
157 pri_ext->TmpBlkUnprotect = 0x0;
158 pri_ext->BlkProtUnprot = 0x0;
159 pri_ext->SimultaneousOps = 0x0;
160 pri_ext->BurstMode = 0x0;
161 pri_ext->PageMode = 0x0;
162 pri_ext->VppMin = 0x0;
163 pri_ext->VppMax = 0x0;
164 pri_ext->TopBottom = 0x0;
166 pri_ext->_reversed_geometry = 0;
168 cfi_info->pri_ext = pri_ext;
169 } else if ((cfi_info->pri_id == 0x1) || (cfi_info->pri_id == 0x3))
171 ERROR("BUG: non-CFI flashes using the Intel commandset are not yet supported");