Codebase list flashrom / b2e3091
Import Upstream version 0.9.9+r1954 Gürkan Myczko authored 4 years ago root committed 4 years ago
16 changed file(s) with 450 addition(s) and 122 deletion(s). Raw diff Collapse all Expand all
0 ------------------------------------------------------------------------
1 r1954 | stefanct | 2016-03-13 18:46:08 +0100 (Sun, 13 Mar 2016) | 6 lines
2
3 Increase flashrom version number to 0.9.9.
4
5 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
6 Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
7 Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
8 Acked-by: Urja Rannikko <urjaman@gmail.com>
9 ------------------------------------------------------------------------
10 r1953 | hailfinger | 2016-03-13 18:36:49 +0100 (Sun, 13 Mar 2016) | 22 lines
11
12 Fix fscanf format string security bug in layout.c
13
14 An internal security audit of the flashrom project by
15 Carl-Daniel Hailfinger found a buffer overflow bug present in all
16 flashrom versions since the year 2005.
17 This bug was independently found and reported to flashrom.org by
18 Cosmin Gorgovan a few days ago.
19
20 A buffer on the stack and a buffer on the heap are affected by the
21 overflow caused by an incorrect fscanf format string.
22 The buffer overflow can only be triggered if the optional layout feature
23 is used and if the user manually specifies a specially crafted layout
24 file on the command line. Command line parsing and flash image handling
25 do not trigger the buggy code path.
26 Most usage of flashrom does not involve layout files.
27
28 The fix in this commit (changed fscanf format string) can be applied to
29 layout.c of all past flashrom versions.
30
31 Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
32 Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
33
34 ------------------------------------------------------------------------
35 r1952 | hailfinger | 2016-03-13 17:24:09 +0100 (Sun, 13 Mar 2016) | 6 lines
36
37 Implement serial port shutdown both for regular termination and error
38 condition in pony_spi.
39
40 Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
41 Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
42
43 ------------------------------------------------------------------------
44 r1951 | stefanct | 2016-03-13 16:16:30 +0100 (Sun, 13 Mar 2016) | 39 lines
45
46 Add a bunch of new/tested stuff and various small changes 25.
47
48 Tested mainboards:
49 OK:
50 - ASRock Fatal1ty 970 Performance and P4i65G
51 Reported by anonymous email message ID:
52 932677687262b1300eaf14260999d9262c31@guerrillamail.com
53 The latter actually had a tested board enable already.
54
55 Flash chips:
56 - Eon EN25Q128 to PREW (+PREW)
57 Reported by Adrian Graham
58 - GigaDevice GD25VQ41B to PREW (+PREW)
59 Reported by David Hendricks
60 - Winbond W39V040FB to PREW (+EW)
61 Reported by fjed on IRC
62
63 Miscellaneous:
64 - Change PCI IDs of "MS-6577 (Xenon)" board enable.
65 The previous IDs contained the on-board display adapter which is
66 disabled when a dedicated graphics card is installed.
67 - Add a note to the README how to overcome the clang warning if only a
68 single programmer is enabled.
69 - Fix some typo and manpage problems found by lintian
70 - r1920 introduced some explicit calls to pkg-config instead of $(PKG_CONFIG).
71 This patch corrects that.
72 - Make MS-7094 (K8T Neo2-F V2.0) board enable less contestable.
73 Previous PCI IDs were board-specific but ot the other of devices
74 that could be disabled by the firmware or that vary among
75 hardware revions. There are no good alternatives available.
76 However, since we always have a DMI decoder available now, we can
77 use non-board-specific devices without taking risks. Thanks to
78 Uwe Hermann for reporting and testing.
79 - Some other small changes to clean up whitespace and fix some warnings
80 from Debian's lintian.
81
82 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
83 Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
84 Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
85 ------------------------------------------------------------------------
86 r1950 | stefanct | 2016-03-13 13:57:03 +0100 (Sun, 13 Mar 2016) | 11 lines
87
88 Fix compilation on SunOS.
89
90 This came up when I was testing if building on SunOS still works
91 on the buildbot's instance of OmniOS r151014 which is based on illumos.
92
93 The fix is
94 - to link against libnsl
95 - a small C type fix in ich_descriptor_tool
96
97 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
98 Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
99 ------------------------------------------------------------------------
100 r1949 | hailfinger | 2016-03-12 20:49:14 +0100 (Sat, 12 Mar 2016) | 7 lines
101
102 Specifying spispeed=reserved as programmer parameter resulted in
103 selecting the default SPI speed instead of aborting. Rewrite the logic
104 to be more readable.
105
106 Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
107 Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
108
109 ------------------------------------------------------------------------
110 r1948 | stefanct | 2016-03-06 23:32:16 +0100 (Sun, 06 Mar 2016) | 4 lines
111
112 Add support for GNU Hurd.
113
114 Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
115 Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
116 ------------------------------------------------------------------------
117 r1947 | stefanct | 2016-03-06 15:33:49 +0100 (Sun, 06 Mar 2016) | 4 lines
118
119 Add support for GD25VQ21B, GD25VQ40C, GD25VQ80C and GD25VQ16C.
120
121 Signed-off-by: Hatim Kanchwala <hatim@hatimak.me>
122 Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
0123 ------------------------------------------------------------------------
1124 r1946 | hailfinger | 2016-02-28 23:04:51 +0100 (Sun, 28 Feb 2016) | 9 lines
2125
313313 else
314314 override CONFIG_PONY_SPI = no
315315 endif
316 # Dediprog, USB-Blaster, PICkit2, CH341A and FT2232 are not supported with libpayload (missing libusb support)
316 # Dediprog, USB-Blaster, PICkit2, CH341A and FT2232 are not supported with libpayload (missing libusb support).
317317 ifeq ($(CONFIG_DEDIPROG), yes)
318318 UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes
319319 else
528528 # Set the flashrom version string from the highest revision number of the checked out flashrom files.
529529 # Note to packagers: Any tree exported with "make export" or "make tarball"
530530 # will not require subversion. The downloadable snapshots are already exported.
531 SVNVERSION := r1946
532
533 RELEASE := 0.9.9-rc1
531 SVNVERSION := r1954
532
533 RELEASE := 0.9.9
534534 VERSION := $(RELEASE)-$(SVNVERSION)
535535 RELEASENAME ?= $(VERSION)
536536
660660 override CONFIG_DEDIPROG = no
661661 endif
662662 ifeq ($(CONFIG_ENABLE_LIBPCI_PROGRAMMERS), no)
663 override CONFIG_INTERNAL = no
664 override CONFIG_NIC3COM = no
665 override CONFIG_GFXNVIDIA = no
666 override CONFIG_SATASII = no
667 override CONFIG_ATAHPT = no
668 override CONFIG_ATAVIA = no
669 override CONFIG_ATAPROMISE = no
670 override CONFIG_IT8212 = no
671 override CONFIG_DRKAISER = no
672 override CONFIG_NICREALTEK = no
673 override CONFIG_NICNATSEMI = no
674 override CONFIG_NICINTEL = no
675 override CONFIG_NICINTEL_SPI = no
676 override CONFIG_NICINTEL_EEPROM = no
677 override CONFIG_OGP_SPI = no
678 override CONFIG_SATAMV = no
663 override CONFIG_INTERNAL = no
664 override CONFIG_NIC3COM = no
665 override CONFIG_GFXNVIDIA = no
666 override CONFIG_SATASII = no
667 override CONFIG_ATAHPT = no
668 override CONFIG_ATAVIA = no
669 override CONFIG_ATAPROMISE = no
670 override CONFIG_IT8212 = no
671 override CONFIG_DRKAISER = no
672 override CONFIG_NICREALTEK = no
673 override CONFIG_NICNATSEMI = no
674 override CONFIG_NICINTEL = no
675 override CONFIG_NICINTEL_SPI = no
676 override CONFIG_NICINTEL_EEPROM = no
677 override CONFIG_OGP_SPI = no
678 override CONFIG_SATAMV = no
679679 endif
680680
681681 # Bitbanging SPI infrastructure, default off unless needed.
925925
926926 ifneq ($(NEED_POSIX_SOCKETS), )
927927 ifeq ($(TARGET_OS), SunOS)
928 LIBS += -lsocket
928 LIBS += -lsocket -lnsl
929929 endif
930930 endif
931931
135135 use port-based I/O which is not directly available on non-x86. Those
136136 programmers will be disabled automatically if you run "make".
137137
138 Compiler quirks:
139
140 If you are using clang and if you want to enable only one driver, you may hit an
141 overzealous compiler warning from clang. Compile with "make WARNERROR=no" to
142 force it to continue and enjoy.
143
138144 Installation
139145 ------------
140146
24392439 {0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^MS-6163 (i440BX)$", NULL, NULL, P3, "MSI", "MS-6163 (MS-6163 Pro)", 0, OK, intel_piix4_gpo14_raise},
24402440 {0x8086, 0x244b, 0x1462, 0x3910, 0x8086, 0x2442, 0x1462, 0x3910, NULL, NULL, NULL, P3, "MSI", "MS-6391 (845 Pro4)", 0, OK, intel_ich_gpio23_raise},
24412441 {0x1039, 0x0745, 0, 0, 0x1039, 0x0018, 0, 0, "^MS-6561", NULL, NULL, P3, "MSI", "MS-6561 (745 Ultra)", 0, OK, w836xx_memw_enable_2e},
2442 {0x8086, 0x2560, 0x1462, 0x5770, 0x8086, 0x2562, 0x1462, 0x5778, NULL, NULL, NULL, P3, "MSI", "MS-6577 (Xenon)", 0, OK, w83627hf_gpio25_raise_2e},
2442 {0x8086, 0x2560, 0x1462, 0x5770, 0x8086, 0x24C3, 0x1462, 0x5770, NULL, NULL, NULL, P3, "MSI", "MS-6577 (Xenon)", 0, OK, w83627hf_gpio25_raise_2e},
24432443 {0x13f6, 0x0111, 0x1462, 0x5900, 0x1106, 0x3177, 0x1106, 0, NULL, NULL, NULL, P3, "MSI", "MS-6590 (KT4 Ultra)", 0, OK, board_msi_kt4v},
2444 {0x1106, 0x3149, 0x1462, 0x7094, 0x10ec, 0x8167, 0x1462, 0x094c, "^MS-7094$", NULL, NULL, P3, "MSI", "MS-7094 (K8T Neo2-F V2.0)", 0, OK, w83627thf_gpio44_raise_2e},
2444 {0x1106, 0x0282, 0x1106, 0x0282, 0x1106, 0x3227, 0x1106, 0x3227, "^MS-7094$", NULL, NULL, P3, "MSI", "MS-7094 (K8T Neo2-F V2.0)", 0, OK, w83627thf_gpio44_raise_2e},
24452445 {0x1106, 0x0571, 0x1462, 0x7120, 0x1106, 0x3065, 0x1462, 0x7120, NULL, NULL, NULL, P3, "MSI", "MS-6712 (KT4V)", 0, OK, board_msi_kt4v},
24462446 {0x1106, 0x3148, 0 , 0 , 0x1106, 0x3177, 0 , 0 , NULL, "msi", "ms6787", P3, "MSI", "MS-6787 (P4MAM-V/P4MAM-L)", 0, OK, w836xx_memw_enable_2e},
24472447 {0x8086, 0x24d3, 0x1462, 0x7880, 0x8086, 0x2570, 0, 0, NULL, NULL, NULL, P3, "MSI", "MS-6788-040 (848P NeoV)", 0, OK, intel_ich_gpio32_raise},
46624662 .page_size = 256,
46634663 /* OTP: 512B total; enter 0x3A */
46644664 .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
4665 .tested = TEST_UNTESTED,
4665 .tested = TEST_OK_PREW,
46664666 .probe = probe_spi_rdid,
46674667 .probe_timing = TIMING_ZERO,
46684668 .block_erasers =
53675367 .probe_timing = TIMING_ZERO,
53685368 .block_erasers =
53695369 {
5370 {
5371 .eraseblocks = { {64 * 1024, 8} },
5372 .block_erase = spi_block_erase_d8,
5373 }, {
5374 .eraseblocks = { {512 * 1024, 1} },
5375 .block_erase = spi_block_erase_c7,
5376 }
5370 {
5371 .eraseblocks = { {64 * 1024, 8} },
5372 .block_erase = spi_block_erase_d8,
5373 }, {
5374 .eraseblocks = { {512 * 1024, 1} },
5375 .block_erase = spi_block_erase_c7,
5376 }
53775377 },
53785378 .printlock = spi_prettyprint_status_register_bp2_srwd,
53795379 .unlock = spi_disable_blockprotect_bp2_srwd,
53985398 .probe_timing = TIMING_ZERO,
53995399 .block_erasers =
54005400 {
5401 {
5402 .eraseblocks = { {64 * 1024, 16} },
5403 .block_erase = spi_block_erase_d8,
5404 }, {
5405 .eraseblocks = { {1024 * 1024, 1} },
5406 .block_erase = spi_block_erase_c7,
5407 }
5401 {
5402 .eraseblocks = { {64 * 1024, 16} },
5403 .block_erase = spi_block_erase_d8,
5404 }, {
5405 .eraseblocks = { {1024 * 1024, 1} },
5406 .block_erase = spi_block_erase_c7,
5407 }
54085408 },
54095409 .printlock = spi_prettyprint_status_register_bp2_srwd,
54105410 .unlock = spi_disable_blockprotect_bp2_srwd,
62946294
62956295 {
62966296 .vendor = "GigaDevice",
6297 .name = "GD25VQ41B",
6297 .name = "GD25VQ21B",
6298 .bustype = BUS_SPI,
6299 .manufacture_id = GIGADEVICE_ID,
6300 .model_id = GIGADEVICE_GD25VQ21B,
6301 .total_size = 256,
6302 .page_size = 256,
6303 /* OTP: 1536B total; read 0x48, write 0x42, erase 0x44 */
6304 .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
6305 .tested = TEST_UNTESTED,
6306 .probe = probe_spi_rdid,
6307 .probe_timing = TIMING_ZERO,
6308 .block_erasers =
6309 {
6310 {
6311 .eraseblocks = { { 4 * 1024, 64} },
6312 .block_erase = spi_block_erase_20,
6313 }, {
6314 .eraseblocks = { { 32 * 1024, 8} },
6315 .block_erase = spi_block_erase_52,
6316 }, {
6317 .eraseblocks = { { 64 * 1024, 4} },
6318 .block_erase = spi_block_erase_d8,
6319 }, {
6320 .eraseblocks = { {256 * 1024, 1} },
6321 .block_erase = spi_block_erase_60,
6322 }, {
6323 .eraseblocks = { {256 * 1024, 1} },
6324 .block_erase = spi_block_erase_c7,
6325 }
6326 },
6327 .printlock = spi_prettyprint_status_register_bp4_srwd,
6328 .unlock = spi_disable_blockprotect_bp4_srwd, /* TODO: 2nd status reg (read with 0x35) */
6329 .write = spi_chip_write_256,
6330 .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
6331 .voltage = {2300, 3600},
6332 },
6333
6334 {
6335 .vendor = "GigaDevice",
6336 .name = "GD25VQ40C",
62986337 .bustype = BUS_SPI,
62996338 .manufacture_id = GIGADEVICE_ID,
63006339 .model_id = GIGADEVICE_GD25VQ41B,
63016340 .total_size = 512,
63026341 .page_size = 256,
6342 /* Supports SFDP */
6343 /* OTP: 1024B total; read 0x48, write 0x42, erase 0x44 */
6344 .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
6345 .tested = TEST_UNTESTED,
6346 .probe = probe_spi_rdid,
6347 .probe_timing = TIMING_ZERO,
6348 .block_erasers =
6349 {
6350 {
6351 .eraseblocks = { { 4 * 1024, 128} },
6352 .block_erase = spi_block_erase_20,
6353 }, {
6354 .eraseblocks = { { 32 * 1024, 16} },
6355 .block_erase = spi_block_erase_52,
6356 }, {
6357 .eraseblocks = { { 64 * 1024, 8} },
6358 .block_erase = spi_block_erase_d8,
6359 }, {
6360 .eraseblocks = { {512 * 1024, 1} },
6361 .block_erase = spi_block_erase_60,
6362 }, {
6363 .eraseblocks = { {512 * 1024, 1} },
6364 .block_erase = spi_block_erase_c7,
6365 }
6366 },
6367 .printlock = spi_prettyprint_status_register_bp4_srwd,
6368 .unlock = spi_disable_blockprotect_bp4_srwd, /* TODO: 2nd status reg (read with 0x35) */
6369 .write = spi_chip_write_256,
6370 .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
6371 .voltage = {2300, 3600},
6372 },
6373
6374 {
6375 .vendor = "GigaDevice",
6376 .name = "GD25VQ41B",
6377 .bustype = BUS_SPI,
6378 .manufacture_id = GIGADEVICE_ID,
6379 .model_id = GIGADEVICE_GD25VQ41B,
6380 .total_size = 512,
6381 .page_size = 256,
63036382 /* OTP: 1536B total; read 0x48, write 0x42, erase 0x44 */
63046383 .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
6305 .tested = TEST_UNTESTED,
6306 .probe = probe_spi_rdid,
6307 .probe_timing = TIMING_ZERO,
6308 .block_erasers =
6309 {
6310 {
6311 .eraseblocks = { { 4 * 1024, 128} },
6312 .block_erase = spi_block_erase_20,
6313 }, {
6314 .eraseblocks = { { 32 * 1024, 16} },
6315 .block_erase = spi_block_erase_52,
6316 }, {
6317 .eraseblocks = { { 64 * 1024, 8} },
6318 .block_erase = spi_block_erase_d8,
6319 }, {
6320 .eraseblocks = { {512 * 1024, 1} },
6321 .block_erase = spi_block_erase_60,
6322 }, {
6323 .eraseblocks = { {512 * 1024, 1} },
6324 .block_erase = spi_block_erase_c7,
6325 }
6326 },
6327 /* TODO: 2nd Status Register; read 0x35 */
6384 .tested = TEST_OK_PREW,
6385 .probe = probe_spi_rdid,
6386 .probe_timing = TIMING_ZERO,
6387 .block_erasers =
6388 {
6389 {
6390 .eraseblocks = { { 4 * 1024, 128} },
6391 .block_erase = spi_block_erase_20,
6392 }, {
6393 .eraseblocks = { { 32 * 1024, 16} },
6394 .block_erase = spi_block_erase_52,
6395 }, {
6396 .eraseblocks = { { 64 * 1024, 8} },
6397 .block_erase = spi_block_erase_d8,
6398 }, {
6399 .eraseblocks = { {512 * 1024, 1} },
6400 .block_erase = spi_block_erase_60,
6401 }, {
6402 .eraseblocks = { {512 * 1024, 1} },
6403 .block_erase = spi_block_erase_c7,
6404 }
6405 },
63286406 .printlock = spi_prettyprint_status_register_bp4_srwd,
6329 .unlock = spi_disable_blockprotect_bp4_srwd,
6407 .unlock = spi_disable_blockprotect_bp4_srwd, /* TODO: 2nd status reg (read with 0x35) */
6408 .write = spi_chip_write_256,
6409 .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
6410 .voltage = {2300, 3600},
6411 },
6412
6413 {
6414 .vendor = "GigaDevice",
6415 .name = "GD25VQ80C",
6416 .bustype = BUS_SPI,
6417 .manufacture_id = GIGADEVICE_ID,
6418 .model_id = GIGADEVICE_GD25VQ80C,
6419 .total_size = 1024,
6420 .page_size = 256,
6421 /* Supports SFDP */
6422 /* OTP: 1024B total; read 0x48, write 0x42, erase 0x44 */
6423 .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
6424 .tested = TEST_UNTESTED,
6425 .probe = probe_spi_rdid,
6426 .probe_timing = TIMING_ZERO,
6427 .block_erasers =
6428 {
6429 {
6430 .eraseblocks = { { 4 * 1024, 256} },
6431 .block_erase = spi_block_erase_20,
6432 }, {
6433 .eraseblocks = { { 32 * 1024, 32} },
6434 .block_erase = spi_block_erase_52,
6435 }, {
6436 .eraseblocks = { { 64 * 1024, 16} },
6437 .block_erase = spi_block_erase_d8,
6438 }, {
6439 .eraseblocks = { {1024 * 1024, 1} },
6440 .block_erase = spi_block_erase_60,
6441 }, {
6442 .eraseblocks = { {1024 * 1024, 1} },
6443 .block_erase = spi_block_erase_c7,
6444 }
6445 },
6446 .printlock = spi_prettyprint_status_register_bp4_srwd,
6447 .unlock = spi_disable_blockprotect_bp4_srwd, /* TODO: 2nd status reg (read with 0x35) */
6448 .write = spi_chip_write_256,
6449 .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
6450 .voltage = {2300, 3600},
6451 },
6452
6453 {
6454 .vendor = "GigaDevice",
6455 .name = "GD25VQ16C",
6456 .bustype = BUS_SPI,
6457 .manufacture_id = GIGADEVICE_ID,
6458 .model_id = GIGADEVICE_GD25VQ16C,
6459 .total_size = 2 * 1024,
6460 .page_size = 256,
6461 /* Supports SFDP */
6462 /* OTP: 1024B total; read 0x48, write 0x42, erase 0x44 */
6463 .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
6464 .tested = TEST_UNTESTED,
6465 .probe = probe_spi_rdid,
6466 .probe_timing = TIMING_ZERO,
6467 .block_erasers =
6468 {
6469 {
6470 .eraseblocks = { { 4 * 1024, 512} },
6471 .block_erase = spi_block_erase_20,
6472 }, {
6473 .eraseblocks = { { 32 * 1024, 64} },
6474 .block_erase = spi_block_erase_52,
6475 }, {
6476 .eraseblocks = { { 64 * 1024, 32} },
6477 .block_erase = spi_block_erase_d8,
6478 }, {
6479 .eraseblocks = { {2 * 1024 * 1024, 1} },
6480 .block_erase = spi_block_erase_60,
6481 }, {
6482 .eraseblocks = { {2 * 1024 * 1024, 1} },
6483 .block_erase = spi_block_erase_c7,
6484 }
6485 },
6486 .printlock = spi_prettyprint_status_register_bp4_srwd,
6487 .unlock = spi_disable_blockprotect_bp4_srwd, /* TODO: 2nd status reg (read with 0x35) */
63306488 .write = spi_chip_write_256,
63316489 .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
63326490 .voltage = {2300, 3600},
1546815626 .total_size = 512,
1546915627 .page_size = 64 * 1024,
1547015628 .feature_bits = FEATURE_REGISTERMAP | FEATURE_EITHER_RESET,
15471 .tested = TEST_OK_PR,
15629 .tested = TEST_OK_PREW,
1547215630 .probe = probe_jedec,
1547315631 .probe_timing = 10,
1547415632 .block_erasers =
371371 #define GIGADEVICE_GD25Q32 0x4016 /* Same as GD25Q32B */
372372 #define GIGADEVICE_GD25Q64 0x4017 /* Same as GD25Q64B */
373373 #define GIGADEVICE_GD25Q128 0x4018 /* GD25Q128B and GD25Q128C only, can be distinguished by SFDP */
374 #define GIGADEVICE_GD25VQ21B 0x4212
375 #define GIGADEVICE_GD25VQ41B 0x4213 /* Same as GD25VQ40C, can be distinguished by SFDP */
376 #define GIGADEVICE_GD25VQ80C 0x4214
377 #define GIGADEVICE_GD25VQ16C 0x4215
374378 #define GIGADEVICE_GD25LQ40 0x6013
375379 #define GIGADEVICE_GD25LQ80 0x6014
376380 #define GIGADEVICE_GD25LQ16 0x6015
377381 #define GIGADEVICE_GD25LQ32 0x6016
378382 #define GIGADEVICE_GD25LQ64 0x6017 /* Same as GD25LQ64B (which is faster) */
379383 #define GIGADEVICE_GD25LQ128 0x6018
380 #define GIGADEVICE_GD25VQ41B 0x4213
381384 #define GIGADEVICE_GD29GL064CAB 0x7E0601
382385
383386 #define HYUNDAI_ID 0xAD /* Hyundai */
00 .\" Load the www device when using groff; provide a fallback for groff's MTO macro that formats email addresses.
11 .ie \n[.g] \
22 . mso www.tmac
3 .el \
4 . de MTO \\$2 \(la\\$1 \(ra\\$3
3 .el \{
4 . de MTO
5 \\$2 \(la\\$1 \(ra\\$3 \
56 . .
7 .\}
68 .\" Create wrappers for .MTO and .URL that print only text on systems w/o groff or if not outputting to a HTML
79 .\" device. To that end we need to distinguish HTML output on groff from other configurations first.
810 .nr groffhtml 0
3739 . \}
3840 . \}
3941 ..
40 .TH FLASHROM 8 "2016-02-28" "0.9.9-rc1-r1946"
42 .TH FLASHROM 8 "2016-03-13" "0.9.9-r1954"
4143 .SH NAME
4244 flashrom \- detect, read, write, verify and erase flash chips
4345 .SH SYNOPSIS
207209 Specify the programmer device. This is mandatory for all operations
208210 involving any chip access (probe/read/write/...). Currently supported are:
209211 .sp
210 .BR "* internal" " (default, for in-system flashing in the mainboard)"
212 .BR "* internal" " (for in-system flashing in the mainboard)"
211213 .sp
212214 .BR "* dummy" " (virtual programmer for testing flashrom)"
213215 .sp
236238 .sp
237239 .BR "* it8212" " (for flash ROMs on ITE IT8212F ATA/RAID controller)"
238240 .sp
239 .BR "* ft2232_spi" " (for SPI flash ROMs attached to an FT2232/FT4232H/FT232H family \
240 based USB SPI programmer), including the DLP Design DLP-USB1232H, \
241 FTDI FT2232H Mini-Module, FTDI FT4232H Mini-Module, openbiosprog-spi, Amontec \
242 JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster, \
243 Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, TIAO/DIYGADGET USB
244 Multi-Protocol Adapter (TUMPA), TUMPA Lite, GOEPEL PicoTAP and Google Servo v1/v2.
241 .BR "* ft2232_spi" " (for SPI flash ROMs attached to an FT2232/FT4232H/FT232H family based USB SPI programmer).
245242 .sp
246243 .BR "* serprog" " (for flash ROMs attached to a programmer speaking serprog, \
247 including Arduino-based devices as well as various programmers by Urja Rannikko, \
248 Juhana Helovuo, Stefan Tauner and others)."
244 including some Arduino-based devices)."
249245 .sp
250246 .BR "* buspirate_spi" " (for SPI flash ROMs attached to a Bus Pirate)"
251247 .sp
683679 .IP
684680 This is the first programmer module in flashrom that does not provide access to NOR flash chips but EEPROMs
685681 mounted on gigabit Ethernet cards based on Intel's 82580 NIC. Because EEPROMs normally do not announce their
686 size nor allow to be identified, the controller relies on correct size values written to predefined addresses
687 within the chip. Flashrom follows this scheme but assumes the minimum size of 16 kB (128 kb) if an unprogrammed
688 EEPROM/card is detected. Intel specifies following EEPROMs to be compatible: Atmel AT25128, AT25256, Micron (ST)
689 M95128, M95256 and OnSemi (Catalyst) CAT25CS128.
682 size nor allow themselves to be identified, the controller relies on correct size values written to predefined
683 addresses within the chip. Flashrom follows this scheme but assumes the minimum size of 16 kB (128 kb) if an
684 unprogrammed EEPROM/card is detected. Intel specifies following EEPROMs to be compatible:
685 Atmel AT25128, AT25256, Micron (ST) M95128, M95256 and OnSemi (Catalyst) CAT25CS128.
690686 .SS
691687 .BR "ft2232_spi " programmer
692688 .IP
689 This module supports various programmers based on FTDI FT2232/FT4232H/FT232H chips including the DLP Design
690 DLP-USB1232H, openbiosprog-spi, Amontec JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster,
691 Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, OpenMoko Neo1973 Debug board (V2+), TIAO/DIYGADGET USB
692 Multi-Protocol Adapter (TUMPA), TUMPA Lite, GOEPEL PicoTAP and Google Servo v1/v2.
693 .sp
693694 An optional parameter specifies the controller
694695 type and channel/interface/port it should support. For that you have to use the
695696 .sp
735736 .SS
736737 .BR "serprog " programmer
737738 .IP
739 This module supports all programmers speaking the serprog protocol. This includes some Arduino-based devices
740 as well as various programmers by Urja Rannikko, Juhana Helovuo, Stefan Tauner, Chi Zhang and many others.
741 .sp
738742 A mandatory parameter specifies either a serial device (and baud rate) or an IP/port combination for
739743 communicating with the programmer.
740744 The device/baud combination has to start with
980984 .BR "mstarddc_spi " programmer
981985 .IP
982986 The Display Data Channel (DDC) is an I2C bus present on VGA and DVI connectors, that allows exchanging
983 informations between a computer and attached displays. Its most common uses are getting display capabilities
987 information between a computer and attached displays. Its most common uses are getting display capabilities
984988 through EDID (at I2C address 0x50) and sending commands to the display using the DDC/CI protocol (at address
985989 0x37). On displays driven by MSTAR SoCs, it is also possible to access the SoC firmware flash (connected to
986990 the Soc through another SPI bus) using an In-System Programming (ISP) port, usually at address 0x49.
10151019 .sp
10161020 .B " flashrom \-p mstarddc_spi:dev=/dev/i2c-1:49,noreset=1
10171021 .sp
1018 Please note that sending the reset command is also inhibited in the event an error occured during the operation.
1022 Please note that sending the reset command is also inhibited if an error occurred during the operation.
10191023 To send the reset command afterwards, you can simply run flashrom once more, in chip probe mode (not specifying
10201024 an operation), without the
10211025 .B noreset
00 .\" Load the www device when using groff; provide a fallback for groff's MTO macro that formats email addresses.
11 .ie \n[.g] \
22 . mso www.tmac
3 .el \
4 . de MTO \\$2 \(la\\$1 \(ra\\$3
3 .el \{
4 . de MTO
5 \\$2 \(la\\$1 \(ra\\$3 \
56 . .
7 .\}
68 .\" Create wrappers for .MTO and .URL that print only text on systems w/o groff or if not outputting to a HTML
79 .\" device. To that end we need to distinguish HTML output on groff from other configurations first.
810 .nr groffhtml 0
207209 Specify the programmer device. This is mandatory for all operations
208210 involving any chip access (probe/read/write/...). Currently supported are:
209211 .sp
210 .BR "* internal" " (default, for in-system flashing in the mainboard)"
212 .BR "* internal" " (for in-system flashing in the mainboard)"
211213 .sp
212214 .BR "* dummy" " (virtual programmer for testing flashrom)"
213215 .sp
236238 .sp
237239 .BR "* it8212" " (for flash ROMs on ITE IT8212F ATA/RAID controller)"
238240 .sp
239 .BR "* ft2232_spi" " (for SPI flash ROMs attached to an FT2232/FT4232H/FT232H family \
240 based USB SPI programmer), including the DLP Design DLP-USB1232H, \
241 FTDI FT2232H Mini-Module, FTDI FT4232H Mini-Module, openbiosprog-spi, Amontec \
242 JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster, \
243 Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, TIAO/DIYGADGET USB
244 Multi-Protocol Adapter (TUMPA), TUMPA Lite, GOEPEL PicoTAP and Google Servo v1/v2.
241 .BR "* ft2232_spi" " (for SPI flash ROMs attached to an FT2232/FT4232H/FT232H family based USB SPI programmer).
245242 .sp
246243 .BR "* serprog" " (for flash ROMs attached to a programmer speaking serprog, \
247 including Arduino-based devices as well as various programmers by Urja Rannikko, \
248 Juhana Helovuo, Stefan Tauner and others)."
244 including some Arduino-based devices)."
249245 .sp
250246 .BR "* buspirate_spi" " (for SPI flash ROMs attached to a Bus Pirate)"
251247 .sp
683679 .IP
684680 This is the first programmer module in flashrom that does not provide access to NOR flash chips but EEPROMs
685681 mounted on gigabit Ethernet cards based on Intel's 82580 NIC. Because EEPROMs normally do not announce their
686 size nor allow to be identified, the controller relies on correct size values written to predefined addresses
687 within the chip. Flashrom follows this scheme but assumes the minimum size of 16 kB (128 kb) if an unprogrammed
688 EEPROM/card is detected. Intel specifies following EEPROMs to be compatible: Atmel AT25128, AT25256, Micron (ST)
689 M95128, M95256 and OnSemi (Catalyst) CAT25CS128.
682 size nor allow themselves to be identified, the controller relies on correct size values written to predefined
683 addresses within the chip. Flashrom follows this scheme but assumes the minimum size of 16 kB (128 kb) if an
684 unprogrammed EEPROM/card is detected. Intel specifies following EEPROMs to be compatible:
685 Atmel AT25128, AT25256, Micron (ST) M95128, M95256 and OnSemi (Catalyst) CAT25CS128.
690686 .SS
691687 .BR "ft2232_spi " programmer
692688 .IP
689 This module supports various programmers based on FTDI FT2232/FT4232H/FT232H chips including the DLP Design
690 DLP-USB1232H, openbiosprog-spi, Amontec JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster,
691 Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, OpenMoko Neo1973 Debug board (V2+), TIAO/DIYGADGET USB
692 Multi-Protocol Adapter (TUMPA), TUMPA Lite, GOEPEL PicoTAP and Google Servo v1/v2.
693 .sp
693694 An optional parameter specifies the controller
694695 type and channel/interface/port it should support. For that you have to use the
695696 .sp
735736 .SS
736737 .BR "serprog " programmer
737738 .IP
739 This module supports all programmers speaking the serprog protocol. This includes some Arduino-based devices
740 as well as various programmers by Urja Rannikko, Juhana Helovuo, Stefan Tauner, Chi Zhang and many others.
741 .sp
738742 A mandatory parameter specifies either a serial device (and baud rate) or an IP/port combination for
739743 communicating with the programmer.
740744 The device/baud combination has to start with
980984 .BR "mstarddc_spi " programmer
981985 .IP
982986 The Display Data Channel (DDC) is an I2C bus present on VGA and DVI connectors, that allows exchanging
983 informations between a computer and attached displays. Its most common uses are getting display capabilities
987 information between a computer and attached displays. Its most common uses are getting display capabilities
984988 through EDID (at I2C address 0x50) and sending commands to the display using the DDC/CI protocol (at address
985989 0x37). On displays driven by MSTAR SoCs, it is also possible to access the SoC firmware flash (connected to
986990 the Soc through another SPI bus) using an In-System Programming (ISP) port, usually at address 0x49.
10151019 .sp
10161020 .B " flashrom \-p mstarddc_spi:dev=/dev/i2c-1:49,noreset=1
10171021 .sp
1018 Please note that sending the reset command is also inhibited in the event an error occured during the operation.
1022 Please note that sending the reset command is also inhibited if an error occurred during the operation.
10191023 To send the reset command afterwards, you can simply run flashrom once more, in chip probe mode (not specifying
10201024 an operation), without the
10211025 .B noreset
3232 #include "flash.h"
3333 #include "hwaccess.h"
3434
35 #if !(IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__DJGPP__) || defined(__LIBPAYLOAD__) || defined(__sun))
35 #if !(IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__DJGPP__) || defined(__LIBPAYLOAD__) || defined(__sun) || defined(__gnu_hurd__))
3636 #error "Unknown operating system"
3737 #endif
3838
3939 #define USE_IOPL (IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__))
4040 #define USE_DEV_IO (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__))
41 #define USE_IOPERM (defined(__gnu_hurd__))
42
43 #if USE_IOPERM
44 #include <sys/io.h>
45 #endif
4146
4247 #if IS_X86 && USE_DEV_IO
4348 int io_fd;
8186 sysi86(SI86V86, V86SC_IOPL, 0);
8287 #elif USE_DEV_IO
8388 close(io_fd);
89 #elif USE_IOPERM
90 ioperm(0, 65536, 0);
8491 #elif USE_IOPL
8592 iopl(0);
8693 #endif
96103 if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) {
97104 #elif USE_DEV_IO
98105 if ((io_fd = open("/dev/io", O_RDWR)) < 0) {
106 #elif USE_IOPERM
107 if (ioperm(0, 65536, 1) != 0) {
99108 #elif USE_IOPL
100109 if (iopl(3) != 0) {
101110 #endif
6767 (void)fclose(romlayout);
6868 return 1;
6969 }
70 if (2 != fscanf(romlayout, "%s %s\n", tempstr, rom_entries[num_rom_entries].name))
70 if (2 != fscanf(romlayout, "%255s %255s\n", tempstr, rom_entries[num_rom_entries].name))
7171 continue;
7272 #if 0
7373 // fscanf does not like arbitrary comments like that :( later
5555 // libpayload
5656 #elif defined(__LIBPAYLOAD__)
5757 #define __FLASHROM_OS__ "libpayload"
58 // GNU Hurd
59 #elif defined(__gnu_hurd__)
60 #define __FLASHROM_OS__ "Hurd"
5861 // Linux
5962 #elif defined(__linux__)
6063 // There are various flags in use on Android apparently. __ANDROID__ seems to be the most trustworthy.
399399
400400 int pickit2_spi_init(void)
401401 {
402 unsigned int usedevice = 0; // FIXME: allow to select one of multiple devices
402 unsigned int usedevice = 0; // FIXME: Allow selecting one of multiple devices
403403
404404 uint8_t buf[CMD_LENGTH] = {
405405 CMD_EXEC_SCRIPT,
102102 .half_period = 0,
103103 };
104104
105 static int pony_spi_shutdown(void *data)
106 {
107 /* Shut down serial port communication */
108 int ret = serialport_shutdown(NULL);
109 if (ret)
110 msg_pdbg("Pony SPI shutdown failed.\n");
111 else
112 msg_pdbg("Pony SPI shutdown completed.\n");
113
114 return ret;
115 }
116
105117 int pony_spi_init(void)
106118 {
107119 int i, data_out;
117129 sp_fd = sp_openserport(arg, 9600);
118130 if (sp_fd == SER_INV_FD) {
119131 free(arg);
132 return 1;
133 }
134 if (register_shutdown(pony_spi_shutdown, NULL) != 0) {
135 free(arg);
136 serialport_shutdown(NULL);
120137 return 1;
121138 }
122139 have_device++;
489489 case USB:
490490 print_supported_devs(prog, "USB");
491491 break;
492 #if NEED_PCI == 1
493492 case PCI:
494493 print_supported_devs(prog, "PCI");
495494 break;
496 #endif
497495 case OTHER:
498496 if (prog.devs.note != NULL) {
499497 msg_ginfo("\nSupported devices for the %s programmer:\n", prog.name);
570568 B("ASRock", "AMCP7AION-HT", OK, "http://www.asrock.com/nettop/NVIDIA/ION%20330HT/", "Used in ION 330HT(-BD) barebones."),
571569 B("ASRock", "ConRoeXFire-eSATA2", OK, "http://www.asrock.com/mb/overview.asp?model=conroexfire-esata2", NULL),
572570 B("ASRock", "E350M1/USB3", OK, "http://www.asrock.com/mb/overview.asp?model=e350m1/usb3", "Vendor firmware writes to flash at shutdown. This probably corrupts the flash in case you write coreboot while running the vendor firmware. Simply updating the vendor firmware should be fine."),
571 B("ASRock", "Fatal1ty 970 Performance", OK, "http://www.asrock.com/mb/overview.asp?Model=Fatal1ty%20970%20Performance", "Probing works (Winbond W25Q64, 8192 kB, SPI), but parts of the flash are problematic: descriptor is r/o (conforming to ICH reqs), ME region is locked."),
573572 B("ASRock", "Fatal1ty Z77 Performance", BAD, "http://www.asrock.com/mb/overview.asp?Model=Fatal1ty%20Z77%20Performance", "Probing works (Winbond W25Q64, 8192 kB, SPI), but parts of the flash are problematic: descriptor is r/o (conforming to ICH reqs), ME region is locked."),
574573 B("ASRock", "G31M-GS", OK, "http://www.asrock.com/mb/overview.asp?Model=G31M-GS", NULL),
575574 B("ASRock", "G31M-S rev 2.0", OK, "http://www.asrock.com/mb/overview.asp?model=G31M-S", NULL),
584583 B("ASRock", "M3A790GXH/128M", OK, "http://www.asrock.com/mb/overview.asp?Model=M3A790GXH/128M", NULL),
585584 B("ASRock", "N61P-S", OK, "http://www.asrock.com/mb/overview.asp?Model=N61P-S", NULL),
586585 B("ASRock", "N68C-S UCC", OK, "http://www.asrock.com/mb/overview.asp?Model=N68C-S%20UCC", NULL),
586 B("ASRock", "P4i65G", OK, "http://www.asrock.com/mb/overview.asp?Model=P4i65G", NULL),
587587 B("ASRock", "P4i65GV", OK, "http://www.asrock.com/mb/overview.asp?Model=P4i65GV", NULL),
588588 B("ASRock", "Z68 Extreme4", BAD, "http://www.asrock.com/mb/overview.asp?Model=Z68%20Extreme4", "Probing works (Winbond W25Q64, 8192 kB, SPI), but parts of the flash are problematic: descriptor is r/o (conforming to ICH reqs), ME region is locked."),
589589 B("ASUS", "A7N8X Deluxe", OK, "http://www.asus.com/Motherboards/AMD_Socket_A/A7N8X_Deluxe/", NULL),
386386 static int handle_speed(struct pci_dev *dev)
387387 {
388388 uint32_t tmp;
389 int8_t spispeed_idx = 3; /* Default to 16.5 MHz */
389 uint8_t spispeed_idx = 3; /* Default to 16.5 MHz */
390390
391391 char *spispeed = extract_programmer_param("spispeed");
392392 if (spispeed != NULL) {
393 if (strcasecmp(spispeed, "reserved") != 0) {
394 int i;
395 for (i = 0; i < ARRAY_SIZE(spispeeds); i++) {
396 if (strcasecmp(spispeeds[i].name, spispeed) == 0) {
397 spispeed_idx = i;
398 break;
399 }
393 unsigned int i;
394 for (i = 0; i < ARRAY_SIZE(spispeeds); i++) {
395 if (strcasecmp(spispeeds[i].name, spispeed) == 0) {
396 spispeed_idx = i;
397 break;
400398 }
401 /* Only Yangtze supports the second half of indices; no 66 MHz before SB8xx. */
402 if ((amd_gen < CHIPSET_YANGTZE && spispeed_idx > 3) ||
403 (amd_gen < CHIPSET_SB89XX && spispeed_idx == 0))
404 spispeed_idx = -1;
405 }
406 if (spispeed_idx < 0) {
399 }
400 /* "reserved" is not a valid speed.
401 * Error out on speeds not present in the spispeeds array.
402 * Only Yangtze supports the second half of indices.
403 * No 66 MHz before SB8xx. */
404 if ((strcasecmp(spispeed, "reserved") == 0) ||
405 (i == ARRAY_SIZE(spispeeds)) ||
406 (amd_gen < CHIPSET_YANGTZE && spispeed_idx > 3) ||
407 (amd_gen < CHIPSET_SB89XX && spispeed_idx == 0)) {
407408 msg_perr("Error: Invalid spispeed value: '%s'.\n", spispeed);
408409 free(spispeed);
409410 return 1;
510511 msg_pinfo("Writes have been disabled for safety reasons because the presence of the IMC\n"
511512 "was detected and it could interfere with accessing flash memory. Flashrom will\n"
512513 "try to disable it temporarily but even then this might not be safe:\n"
513 "when it is reenabled and after a reboot it expects to find working code\n"
514 "when it is re-enabled and after a reboot it expects to find working code\n"
514515 "in the flash and it is unpredictable what happens if there is none.\n"
515516 "\n"
516517 "To be safe make sure that there is a working IMC firmware at the right\n"
169169 usage(argv, "Seeking to the end of the file failed");
170170
171171 #ifdef HAVE_MMAP
172 buf = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
172 buf = (uint32_t *)mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
173173 if (buf == (void *) -1)
174174 #endif
175175 {
179179 usage(argv, "Could not allocate memory");
180180 lseek(fd, 0, SEEK_SET);
181181 if (len != read(fd, buf, len))
182 usage(argv, "Seeking to the end of the file failed");
182 usage(argv, "Reading the descriptor image file failed");
183183 }
184184 printf("The flash image has a size of %d [0x%x] bytes.\n", len, len);
185185 close(fd);