comparison loadtools/fldevs.c @ 973:7c18eac91457

loadtools: round out support for Intel flash families The three Intel flash families encountered so far in Calypso GSM devices are C3, W30 and W18, sizes from 2 to 8 MiB. Let's support all Intel flash chips from these 3 families across this range of sizes.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 28 Nov 2023 18:56:40 +0000
parents 54a0bc149d9c
children ff4ce8d5ece4
comparison
equal deleted inserted replaced
972:97a331a4b455 973:7c18eac91457
16 .nregions = 2, 16 .nregions = 2,
17 .regions = {0x10000, 31, 0x2000, 8}, 17 .regions = {0x10000, 31, 0x2000, 8},
18 .total_sectors = 39, 18 .total_sectors = 39,
19 }; 19 };
20 20
21 static struct flash_geom geom_2M_bottomboot = {
22 .total_size = 0x200000,
23 .nregions = 2,
24 .regions = {0x2000, 8, 0x10000, 31},
25 .total_sectors = 39,
26 };
27
21 static struct flash_geom geom_4M_topboot = { 28 static struct flash_geom geom_4M_topboot = {
22 .total_size = 0x400000, 29 .total_size = 0x400000,
23 .nregions = 2, 30 .nregions = 2,
24 .regions = {0x10000, 63, 0x2000, 8}, 31 .regions = {0x10000, 63, 0x2000, 8},
32 .total_sectors = 71,
33 };
34
35 static struct flash_geom geom_4M_bottomboot = {
36 .total_size = 0x400000,
37 .nregions = 2,
38 .regions = {0x2000, 8, 0x10000, 63},
25 .total_sectors = 71, 39 .total_sectors = 71,
26 }; 40 };
27 41
28 static struct flash_geom geom_4M_bothends = { 42 static struct flash_geom geom_4M_bothends = {
29 .total_size = 0x400000, 43 .total_size = 0x400000,
86 {0x33, 0x20}, 100 {0x33, 0x20},
87 {0x34, 0x00}, 101 {0x34, 0x00},
88 {-1, 0} 102 {-1, 0}
89 }; 103 };
90 104
105 static struct cfi_check intel_2M_bottomboot_cfi[] = {
106 {0x10, 'Q'},
107 {0x11, 'R'},
108 {0x12, 'Y'},
109 {0x13, 0x03},
110 {0x14, 0x00},
111 {0x27, 0x15},
112 {0x2C, 0x02},
113 {0x2D, 0x07},
114 {0x2E, 0x00},
115 {0x2F, 0x20},
116 {0x30, 0x00},
117 {0x31, 0x1E},
118 {0x32, 0x00},
119 {0x33, 0x00},
120 {0x34, 0x01},
121 {-1, 0}
122 };
123
91 static struct cfi_check intel_4M_topboot_cfi[] = { 124 static struct cfi_check intel_4M_topboot_cfi[] = {
92 {0x10, 'Q'}, 125 {0x10, 'Q'},
93 {0x11, 'R'}, 126 {0x11, 'R'},
94 {0x12, 'Y'}, 127 {0x12, 'Y'},
95 {0x13, 0x03}, 128 {0x13, 0x03},
105 {0x33, 0x20}, 138 {0x33, 0x20},
106 {0x34, 0x00}, 139 {0x34, 0x00},
107 {-1, 0} 140 {-1, 0}
108 }; 141 };
109 142
143 static struct cfi_check intel_4M_bottomboot_cfi[] = {
144 {0x10, 'Q'},
145 {0x11, 'R'},
146 {0x12, 'Y'},
147 {0x13, 0x03},
148 {0x14, 0x00},
149 {0x27, 0x16},
150 {0x2C, 0x02},
151 {0x2D, 0x07},
152 {0x2E, 0x00},
153 {0x2F, 0x20},
154 {0x30, 0x00},
155 {0x31, 0x3E},
156 {0x32, 0x00},
157 {0x33, 0x00},
158 {0x34, 0x01},
159 {-1, 0}
160 };
161
110 static struct cfi_check intel_8M_topboot_cfi[] = { 162 static struct cfi_check intel_8M_topboot_cfi[] = {
111 {0x10, 'Q'}, 163 {0x10, 'Q'},
112 {0x11, 'R'}, 164 {0x11, 'R'},
113 {0x12, 'Y'}, 165 {0x12, 'Y'},
114 {0x13, 0x03}, 166 {0x13, 0x03},
143 {0x33, 0x00}, 195 {0x33, 0x00},
144 {0x34, 0x01}, 196 {0x34, 0x01},
145 {-1, 0} 197 {-1, 0}
146 }; 198 };
147 199
200 /* classic Intel C3 family: found in low-end Mot C1xx models and BenQ M32 */
201
148 struct flash_device flashdev_28F160C3T = { 202 struct flash_device flashdev_28F160C3T = {
149 .name = "Intel 28F160C3T", 203 .name = "Intel 28F160C3T",
150 .cfi_table = intel_2M_topboot_cfi, 204 .cfi_table = intel_2M_topboot_cfi,
151 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M, 205 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M,
152 .bank_geom = {&geom_2M_topboot, 0}, 206 .bank_geom = {&geom_2M_topboot, 0},
153 .cmdset = &flash_cmdset_intel, 207 .cmdset = &flash_cmdset_intel,
154 }; 208 };
155 209
210 struct flash_device flashdev_28F160C3B = {
211 .name = "Intel 28F160C3B",
212 .cfi_table = intel_2M_bottomboot_cfi,
213 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M,
214 .bank_geom = {&geom_2M_bottomboot, 0},
215 .cmdset = &flash_cmdset_intel,
216 };
217
156 struct flash_device flashdev_28F320C3T = { 218 struct flash_device flashdev_28F320C3T = {
157 .name = "Intel 28F320C3T", 219 .name = "Intel 28F320C3T",
158 .cfi_table = intel_4M_topboot_cfi, 220 .cfi_table = intel_4M_topboot_cfi,
159 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M, 221 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M,
160 .bank_geom = {&geom_4M_topboot, 0}, 222 .bank_geom = {&geom_4M_topboot, 0},
223 .cmdset = &flash_cmdset_intel,
224 };
225
226 struct flash_device flashdev_28F320C3B = {
227 .name = "Intel 28F320C3B",
228 .cfi_table = intel_4M_bottomboot_cfi,
229 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M,
230 .bank_geom = {&geom_4M_bottomboot, 0},
161 .cmdset = &flash_cmdset_intel, 231 .cmdset = &flash_cmdset_intel,
162 }; 232 };
163 233
164 struct flash_device flashdev_28F640C3T = { 234 struct flash_device flashdev_28F640C3T = {
165 .name = "Intel 28F640C3T", 235 .name = "Intel 28F640C3T",
175 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M, 245 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M,
176 .bank_geom = {&geom_8M_bottomboot, 0}, 246 .bank_geom = {&geom_8M_bottomboot, 0},
177 .cmdset = &flash_cmdset_intel, 247 .cmdset = &flash_cmdset_intel,
178 }; 248 };
179 249
250 /*
251 * Intel W18 and W30 families are equivalent in terms of geometries and
252 * relevant quirks, and are distinguishable only by ID codes. We treat them
253 * all as W30, based on the latter family being the first one encountered:
254 * 28F640W30B is the flash chip used on TI's legendary D-Sample board, and
255 * the flash inside Motorola C155/156 is an MCP equivalent of the same.
256 */
257
258 struct flash_device flashdev_28F320W30T = {
259 .name = "Intel 28F320W30T",
260 .cfi_table = intel_4M_topboot_cfi,
261 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M,
262 .bank_geom = {&geom_4M_topboot, 0},
263 .cmdset = &flash_cmdset_intel_w30,
264 };
265
266 struct flash_device flashdev_28F320W30B = {
267 .name = "Intel 28F320W30B",
268 .cfi_table = intel_4M_bottomboot_cfi,
269 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M,
270 .bank_geom = {&geom_4M_bottomboot, 0},
271 .cmdset = &flash_cmdset_intel_w30,
272 };
273
180 struct flash_device flashdev_28F640W30T = { 274 struct flash_device flashdev_28F640W30T = {
181 .name = "Intel 28F640W30T", 275 .name = "Intel 28F640W30T",
182 .cfi_table = intel_8M_topboot_cfi, 276 .cfi_table = intel_8M_topboot_cfi,
183 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M, 277 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M,
184 .bank_geom = {&geom_8M_topboot, 0}, 278 .bank_geom = {&geom_8M_topboot, 0},