blob: 18e007c8e4a7d3f0d59bb9a4e2cf74c33192ee80 [file] [log] [blame]
Thomas Heijligenbbfacff2021-03-31 20:40:01 +02001/*
2 * This file is part of the flashrom project.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include "programmer.h"
16
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020017#if CONFIG_INTERNAL == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020018const struct programmer_entry programmer_internal = {
19 .name = "internal",
20 .type = OTHER,
21 .devs.note = NULL,
22 .init = internal_init,
23 .map_flash_region = physmap,
24 .unmap_flash_region = physunmap,
25 .delay = internal_delay,
26};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020027#endif
28
29#if CONFIG_DUMMY == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020030const struct programmer_entry programmer_dummy = {
31 .name = "dummy",
32 .type = OTHER,
33 /* FIXME */
34 .devs.note = "Dummy device, does nothing and logs all accesses\n",
35 .init = dummy_init,
36 .map_flash_region = dummy_map,
37 .unmap_flash_region = dummy_unmap,
38 .delay = internal_delay,
39};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020040#endif
41
42#if CONFIG_NIC3COM == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020043const struct programmer_entry programmer_nic3com = {
44 .name = "nic3com",
45 .type = PCI,
46 .devs.dev = nics_3com,
47 .init = nic3com_init,
48 .map_flash_region = fallback_map,
49 .unmap_flash_region = fallback_unmap,
50 .delay = internal_delay,
51};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020052#endif
53
54#if CONFIG_NICREALTEK == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020055const struct programmer_entry programmer_nicrealtek = {
56 /* This programmer works for Realtek RTL8139 and SMC 1211. */
57 .name = "nicrealtek",
58 .type = PCI,
59 .devs.dev = nics_realtek,
60 .init = nicrealtek_init,
61 .map_flash_region = fallback_map,
62 .unmap_flash_region = fallback_unmap,
63 .delay = internal_delay,
64};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020065#endif
66
67#if CONFIG_NICNATSEMI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020068const struct programmer_entry programmer_nicnatsemi = {
69 .name = "nicnatsemi",
70 .type = PCI,
71 .devs.dev = nics_natsemi,
72 .init = nicnatsemi_init,
73 .map_flash_region = fallback_map,
74 .unmap_flash_region = fallback_unmap,
75 .delay = internal_delay,
76};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020077#endif
78
79#if CONFIG_GFXNVIDIA == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020080const struct programmer_entry programmer_gfxnvidia = {
81 .name = "gfxnvidia",
82 .type = PCI,
83 .devs.dev = gfx_nvidia,
84 .init = gfxnvidia_init,
85 .map_flash_region = fallback_map,
86 .unmap_flash_region = fallback_unmap,
87 .delay = internal_delay,
88};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +020089#endif
90
91#if CONFIG_DRKAISER == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +020092const struct programmer_entry programmer_drkaiser = {
93 .name = "drkaiser",
94 .type = PCI,
95 .devs.dev = drkaiser_pcidev,
96 .init = drkaiser_init,
97 .map_flash_region = fallback_map,
98 .unmap_flash_region = fallback_unmap,
99 .delay = internal_delay,
100};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200101#endif
102
103#if CONFIG_SATASII == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200104const struct programmer_entry programmer_satasii = {
105 .name = "satasii",
106 .type = PCI,
107 .devs.dev = satas_sii,
108 .init = satasii_init,
109 .map_flash_region = fallback_map,
110 .unmap_flash_region = fallback_unmap,
111 .delay = internal_delay,
112};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200113#endif
114
115#if CONFIG_ATAHPT == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200116const struct programmer_entry programmer_atahpt = {
117 .name = "atahpt",
118 .type = PCI,
119 .devs.dev = ata_hpt,
120 .init = atahpt_init,
121 .map_flash_region = fallback_map,
122 .unmap_flash_region = fallback_unmap,
123 .delay = internal_delay,
124};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200125#endif
126
127#if CONFIG_ATAVIA == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200128const struct programmer_entry programmer_atavia = {
129 .name = "atavia",
130 .type = PCI,
131 .devs.dev = ata_via,
132 .init = atavia_init,
133 .map_flash_region = atavia_map,
134 .unmap_flash_region = fallback_unmap,
135 .delay = internal_delay,
136};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200137#endif
138
139#if CONFIG_ATAPROMISE == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200140const struct programmer_entry programmer_atapromise = {
141 .name = "atapromise",
142 .type = PCI,
143 .devs.dev = ata_promise,
144 .init = atapromise_init,
145 .map_flash_region = atapromise_map,
146 .unmap_flash_region = fallback_unmap,
147 .delay = internal_delay,
148};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200149#endif
150
151#if CONFIG_IT8212 == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200152const struct programmer_entry programmer_it8212 = {
153 .name = "it8212",
154 .type = PCI,
155 .devs.dev = devs_it8212,
156 .init = it8212_init,
157 .map_flash_region = fallback_map,
158 .unmap_flash_region = fallback_unmap,
159 .delay = internal_delay,
160};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200161#endif
162
163#if CONFIG_FT2232_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200164const struct programmer_entry programmer_ft2232_spi = {
165 .name = "ft2232_spi",
166 .type = USB,
167 .devs.dev = devs_ft2232spi,
168 .init = ft2232_spi_init,
169 .map_flash_region = fallback_map,
170 .unmap_flash_region = fallback_unmap,
171 .delay = internal_delay,
172};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200173#endif
174
175#if CONFIG_SERPROG == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200176const struct programmer_entry programmer_serprog = {
177 .name = "serprog",
178 .type = OTHER,
179 /* FIXME */
180 .devs.note = "All programmer devices speaking the serprog protocol\n",
181 .init = serprog_init,
182 .map_flash_region = serprog_map,
183 .unmap_flash_region = fallback_unmap,
184 .delay = serprog_delay,
185};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200186#endif
187
188#if CONFIG_BUSPIRATE_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200189const struct programmer_entry programmer_buspirate_spi = {
190 .name = "buspirate_spi",
191 .type = OTHER,
192 /* FIXME */
193 .devs.note = "Dangerous Prototypes Bus Pirate\n",
194 .init = buspirate_spi_init,
195 .map_flash_region = fallback_map,
196 .unmap_flash_region = fallback_unmap,
197 .delay = internal_delay,
198};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200199#endif
200
201#if CONFIG_DEDIPROG == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200202const struct programmer_entry programmer_dediprog = {
203 .name = "dediprog",
204 .type = USB,
205 .devs.dev = devs_dediprog,
206 .init = dediprog_init,
207 .map_flash_region = fallback_map,
208 .unmap_flash_region = fallback_unmap,
209 .delay = internal_delay,
210};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200211#endif
212
213#if CONFIG_DEVELOPERBOX_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200214const struct programmer_entry programmer_developerbox = {
215 .name = "developerbox",
216 .type = USB,
217 .devs.dev = devs_developerbox_spi,
218 .init = developerbox_spi_init,
219 .map_flash_region = fallback_map,
220 .unmap_flash_region = fallback_unmap,
221 .delay = internal_delay,
222};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200223#endif
224
225#if CONFIG_RAYER_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200226const struct programmer_entry programmer_rayer_spi = {
227 .name = "rayer_spi",
228 .type = OTHER,
229 /* FIXME */
230 .devs.note = "RayeR parallel port programmer\n",
231 .init = rayer_spi_init,
232 .map_flash_region = fallback_map,
233 .unmap_flash_region = fallback_unmap,
234 .delay = internal_delay,
235};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200236#endif
237
238#if CONFIG_PONY_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200239const struct programmer_entry programmer_pony_spi = {
240 .name = "pony_spi",
241 .type = OTHER,
242 /* FIXME */
243 .devs.note = "Programmers compatible with SI-Prog, serbang or AJAWe\n",
244 .init = pony_spi_init,
245 .map_flash_region = fallback_map,
246 .unmap_flash_region = fallback_unmap,
247 .delay = internal_delay,
248};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200249#endif
250
251#if CONFIG_NICINTEL == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200252const struct programmer_entry programmer_nicintel = {
253 .name = "nicintel",
254 .type = PCI,
255 .devs.dev = nics_intel,
256 .init = nicintel_init,
257 .map_flash_region = fallback_map,
258 .unmap_flash_region = fallback_unmap,
259 .delay = internal_delay,
260};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200261#endif
262
263#if CONFIG_NICINTEL_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200264const struct programmer_entry programmer_nicintel_spi = {
265 .name = "nicintel_spi",
266 .type = PCI,
267 .devs.dev = nics_intel_spi,
268 .init = nicintel_spi_init,
269 .map_flash_region = fallback_map,
270 .unmap_flash_region = fallback_unmap,
271 .delay = internal_delay,
272};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200273#endif
274
275#if CONFIG_NICINTEL_EEPROM == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200276const struct programmer_entry programmer_nicintel_eeprom = {
277 .name = "nicintel_eeprom",
278 .type = PCI,
279 .devs.dev = nics_intel_ee,
280 .init = nicintel_ee_init,
281 .map_flash_region = fallback_map,
282 .unmap_flash_region = fallback_unmap,
283 .delay = internal_delay,
284};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200285#endif
286
287#if CONFIG_OGP_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200288const struct programmer_entry programmer_ogp_spi = {
289 .name = "ogp_spi",
290 .type = PCI,
291 .devs.dev = ogp_spi,
292 .init = ogp_spi_init,
293 .map_flash_region = fallback_map,
294 .unmap_flash_region = fallback_unmap,
295 .delay = internal_delay,
296};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200297#endif
298
299#if CONFIG_SATAMV == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200300const struct programmer_entry programmer_satamv = {
301 .name = "satamv",
302 .type = PCI,
303 .devs.dev = satas_mv,
304 .init = satamv_init,
305 .map_flash_region = fallback_map,
306 .unmap_flash_region = fallback_unmap,
307 .delay = internal_delay,
308};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200309#endif
310
311#if CONFIG_LINUX_MTD == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200312const struct programmer_entry programmer_linux_mtd = {
313 .name = "linux_mtd",
314 .type = OTHER,
315 .devs.note = "Device files /dev/mtd*\n",
316 .init = linux_mtd_init,
317 .map_flash_region = fallback_map,
318 .unmap_flash_region = fallback_unmap,
319 .delay = internal_delay,
320};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200321#endif
322
323#if CONFIG_LINUX_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200324const struct programmer_entry programmer_linux_spi = {
325 .name = "linux_spi",
326 .type = OTHER,
327 .devs.note = "Device files /dev/spidev*.*\n",
328 .init = linux_spi_init,
329 .map_flash_region = fallback_map,
330 .unmap_flash_region = fallback_unmap,
331 .delay = internal_delay,
332};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200333#endif
334
335#if CONFIG_USBBLASTER_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200336const struct programmer_entry programmer_usbblaster_spi = {
337 .name = "usbblaster_spi",
338 .type = USB,
339 .devs.dev = devs_usbblasterspi,
340 .init = usbblaster_spi_init,
341 .map_flash_region = fallback_map,
342 .unmap_flash_region = fallback_unmap,
343 .delay = internal_delay,
344};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200345#endif
346
347#if CONFIG_MSTARDDC_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200348const struct programmer_entry programmer_mstarddc_spi = {
349 .name = "mstarddc_spi",
350 .type = OTHER,
351 .devs.note = "MSTAR DDC devices addressable via /dev/i2c-* on Linux.\n",
352 .init = mstarddc_spi_init,
353 .map_flash_region = fallback_map,
354 .unmap_flash_region = fallback_unmap,
355 .delay = internal_delay,
356};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200357#endif
358
359#if CONFIG_PICKIT2_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200360const struct programmer_entry programmer_pickit2_spi = {
361 .name = "pickit2_spi",
362 .type = USB,
363 .devs.dev = devs_pickit2_spi,
364 .init = pickit2_spi_init,
365 .map_flash_region = fallback_map,
366 .unmap_flash_region = fallback_unmap,
367 .delay = internal_delay,
368};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200369#endif
370
371#if CONFIG_CH341A_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200372const struct programmer_entry programmer_ch341a_spi = {
373 .name = "ch341a_spi",
374 .type = USB,
375 .devs.dev = devs_ch341a_spi,
376 .init = ch341a_spi_init,
377 .map_flash_region = fallback_map,
378 .unmap_flash_region = fallback_unmap,
379 .delay = ch341a_spi_delay,
380};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200381#endif
382
383#if CONFIG_DIGILENT_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200384const struct programmer_entry programmer_digilent_spi = {
385 .name = "digilent_spi",
386 .type = USB,
387 .devs.dev = devs_digilent_spi,
388 .init = digilent_spi_init,
389 .map_flash_region = fallback_map,
390 .unmap_flash_region = fallback_unmap,
391 .delay = internal_delay,
392};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200393#endif
394
395#if CONFIG_JLINK_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200396const struct programmer_entry programmer_jlink_spi = {
397 .name = "jlink_spi",
398 .type = OTHER,
399 .init = jlink_spi_init,
400 .devs.note = "SEGGER J-Link and compatible devices\n",
401 .map_flash_region = fallback_map,
402 .unmap_flash_region = fallback_unmap,
403 .delay = internal_delay,
404};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200405#endif
406
407#if CONFIG_NI845X_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200408const struct programmer_entry programmer_ni845x_spi = {
409 .name = "ni845x_spi",
410 .type = OTHER, // choose other because NI-845x uses own USB implementation
411 .devs.note = "National Instruments USB-845x\n",
412 .init = ni845x_spi_init,
413 .map_flash_region = fallback_map,
414 .unmap_flash_region = fallback_unmap,
415 .delay = internal_delay,
416};
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200417#endif
418
419#if CONFIG_STLINKV3_SPI == 1
Thomas Heijligen633d6db2021-03-31 19:09:44 +0200420const struct programmer_entry programmer_stlinkv3_spi = {
421 .name = "stlinkv3_spi",
422 .type = USB,
423 .devs.dev = devs_stlinkv3_spi,
424 .init = stlinkv3_spi_init,
425 .map_flash_region = fallback_map,
426 .unmap_flash_region = fallback_unmap,
427 .delay = internal_delay,
428};
429#endif
430
431const struct programmer_entry *const programmer_table[] = {
432
433#if CONFIG_INTERNAL == 1
434 &programmer_internal,
435#endif
436
437#if CONFIG_DUMMY == 1
438 &programmer_dummy,
439#endif
440
441#if CONFIG_MEC1308 == 1
442 &programmer_mec1308,
443#endif
444
445#if CONFIG_NIC3COM == 1
446 &programmer_nic3com,
447#endif
448
449#if CONFIG_NICREALTEK == 1
450 & programmer_nicrealtek,
451#endif
452
453#if CONFIG_NICNATSEMI == 1
454 &programmer_nicnatsemi,
455#endif
456
457#if CONFIG_GFXNVIDIA == 1
458 &programmer_gfxnvidia,
459#endif
460
461#if CONFIG_RAIDEN_DEBUG_SPI == 1
462 &programmer_raiden_debug_spi,
463#endif
464
465#if CONFIG_DRKAISER == 1
466 &programmer_drkaiser,
467#endif
468
469#if CONFIG_SATASII == 1
470 &programmer_satasii,
471#endif
472
473#if CONFIG_ATAHPT == 1
474 &programmer_atahpt,
475#endif
476
477#if CONFIG_ATAVIA == 1
478 &programmer_atavia,
479#endif
480
481#if CONFIG_ATAPROMISE == 1
482 &programmer_atapromise,
483#endif
484
485#if CONFIG_IT8212 == 1
486 &programmer_it8212,
487#endif
488
489#if CONFIG_FT2232_SPI == 1
490 &programmer_ft2232_spi,
491#endif
492
493#if CONFIG_SERPROG == 1
494 &programmer_serprog,
495#endif
496
497#if CONFIG_BUSPIRATE_SPI == 1
498 &programmer_buspirate_spi,
499#endif
500
501#if CONFIG_DEDIPROG == 1
502 &programmer_dediprog,
503#endif
504
505#if CONFIG_DEVELOPERBOX_SPI == 1
506 &programmer_developerbox,
507#endif
508
509#if CONFIG_ENE_LPC == 1
510 &programmer_ene_lpc,
511#endif
512
513#if CONFIG_RAYER_SPI == 1
514 &programmer_rayer_spi,
515#endif
516
517#if CONFIG_PONY_SPI == 1
518 &programmer_pony_spi,
519#endif
520
521#if CONFIG_NICINTEL == 1
522 &programmer_nicintel,
523#endif
524
525#if CONFIG_NICINTEL_SPI == 1
526 &programmer_nicintel_spi,
527#endif
528
529#if CONFIG_NICINTEL_EEPROM == 1
530 &programmer_nicintel_eeprom,
531#endif
532
533#if CONFIG_OGP_SPI == 1
534 &programmer_ogp_spi,
535#endif
536
537#if CONFIG_SATAMV == 1
538 &programmer_satamv,
539#endif
540
541#if CONFIG_LINUX_MTD == 1
542 &programmer_linux_mtd,
543#endif
544
545#if CONFIG_LINUX_SPI == 1
546 &programmer_linux_spi,
547#endif
548
549#if CONFIG_LSPCON_I2C_SPI == 1
550 &programmer_lspcon_i2c_spi,
551#endif
552
553#if CONFIG_REALTEK_MST_I2C_SPI == 1
554 &programmer_realtek_mst_i2c_spi,
555#endif
556
557#if CONFIG_USBBLASTER_SPI == 1
558 &programmer_usbblaster_spi,
559#endif
560
561#if CONFIG_MSTARDDC_SPI == 1
562 &programmer_mstarddc_spi,
563#endif
564
565#if CONFIG_PICKIT2_SPI == 1
566 &programmer_pickit2_spi,
567#endif
568
569#if CONFIG_CH341A_SPI == 1
570 &programmer_ch341a_spi,
571#endif
572
573#if CONFIG_DIGILENT_SPI == 1
574 &programmer_digilent_spi,
575#endif
576
577#if CONFIG_JLINK_SPI == 1
578 &programmer_jlink_spi,
579#endif
580
581#if CONFIG_NI845X_SPI == 1
582 &programmer_ni845x_spi,
583#endif
584
585#if CONFIG_STLINKV3_SPI == 1
586 &programmer_stlinkv3_spi,
Thomas Heijligenbbfacff2021-03-31 20:40:01 +0200587#endif
588};
589
590const size_t programmer_table_size = ARRAY_SIZE(programmer_table);