Import Upstream version 0.9.9+r1954
Gürkan Myczko authored 4 years ago
root committed 4 years ago
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> | |
0 | 123 | ------------------------------------------------------------------------ |
1 | 124 | r1946 | hailfinger | 2016-02-28 23:04:51 +0100 (Sun, 28 Feb 2016) | 9 lines |
2 | 125 |
313 | 313 | else |
314 | 314 | override CONFIG_PONY_SPI = no |
315 | 315 | 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). | |
317 | 317 | ifeq ($(CONFIG_DEDIPROG), yes) |
318 | 318 | UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes |
319 | 319 | else |
528 | 528 | # Set the flashrom version string from the highest revision number of the checked out flashrom files. |
529 | 529 | # Note to packagers: Any tree exported with "make export" or "make tarball" |
530 | 530 | # 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 | |
534 | 534 | VERSION := $(RELEASE)-$(SVNVERSION) |
535 | 535 | RELEASENAME ?= $(VERSION) |
536 | 536 | |
660 | 660 | override CONFIG_DEDIPROG = no |
661 | 661 | endif |
662 | 662 | 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 | |
679 | 679 | endif |
680 | 680 | |
681 | 681 | # Bitbanging SPI infrastructure, default off unless needed. |
925 | 925 | |
926 | 926 | ifneq ($(NEED_POSIX_SOCKETS), ) |
927 | 927 | ifeq ($(TARGET_OS), SunOS) |
928 | LIBS += -lsocket | |
928 | LIBS += -lsocket -lnsl | |
929 | 929 | endif |
930 | 930 | endif |
931 | 931 |
135 | 135 | use port-based I/O which is not directly available on non-x86. Those |
136 | 136 | programmers will be disabled automatically if you run "make". |
137 | 137 | |
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 | ||
138 | 144 | Installation |
139 | 145 | ------------ |
140 | 146 |
2439 | 2439 | {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}, |
2440 | 2440 | {0x8086, 0x244b, 0x1462, 0x3910, 0x8086, 0x2442, 0x1462, 0x3910, NULL, NULL, NULL, P3, "MSI", "MS-6391 (845 Pro4)", 0, OK, intel_ich_gpio23_raise}, |
2441 | 2441 | {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}, | |
2443 | 2443 | {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}, | |
2445 | 2445 | {0x1106, 0x0571, 0x1462, 0x7120, 0x1106, 0x3065, 0x1462, 0x7120, NULL, NULL, NULL, P3, "MSI", "MS-6712 (KT4V)", 0, OK, board_msi_kt4v}, |
2446 | 2446 | {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}, |
2447 | 2447 | {0x8086, 0x24d3, 0x1462, 0x7880, 0x8086, 0x2570, 0, 0, NULL, NULL, NULL, P3, "MSI", "MS-6788-040 (848P NeoV)", 0, OK, intel_ich_gpio32_raise}, |
4662 | 4662 | .page_size = 256, |
4663 | 4663 | /* OTP: 512B total; enter 0x3A */ |
4664 | 4664 | .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, |
4665 | .tested = TEST_UNTESTED, | |
4665 | .tested = TEST_OK_PREW, | |
4666 | 4666 | .probe = probe_spi_rdid, |
4667 | 4667 | .probe_timing = TIMING_ZERO, |
4668 | 4668 | .block_erasers = |
5367 | 5367 | .probe_timing = TIMING_ZERO, |
5368 | 5368 | .block_erasers = |
5369 | 5369 | { |
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 | } | |
5377 | 5377 | }, |
5378 | 5378 | .printlock = spi_prettyprint_status_register_bp2_srwd, |
5379 | 5379 | .unlock = spi_disable_blockprotect_bp2_srwd, |
5398 | 5398 | .probe_timing = TIMING_ZERO, |
5399 | 5399 | .block_erasers = |
5400 | 5400 | { |
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 | } | |
5408 | 5408 | }, |
5409 | 5409 | .printlock = spi_prettyprint_status_register_bp2_srwd, |
5410 | 5410 | .unlock = spi_disable_blockprotect_bp2_srwd, |
6294 | 6294 | |
6295 | 6295 | { |
6296 | 6296 | .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", | |
6298 | 6337 | .bustype = BUS_SPI, |
6299 | 6338 | .manufacture_id = GIGADEVICE_ID, |
6300 | 6339 | .model_id = GIGADEVICE_GD25VQ41B, |
6301 | 6340 | .total_size = 512, |
6302 | 6341 | .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, | |
6303 | 6382 | /* OTP: 1536B total; read 0x48, write 0x42, erase 0x44 */ |
6304 | 6383 | .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 | }, | |
6328 | 6406 | .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) */ | |
6330 | 6488 | .write = spi_chip_write_256, |
6331 | 6489 | .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ |
6332 | 6490 | .voltage = {2300, 3600}, |
15468 | 15626 | .total_size = 512, |
15469 | 15627 | .page_size = 64 * 1024, |
15470 | 15628 | .feature_bits = FEATURE_REGISTERMAP | FEATURE_EITHER_RESET, |
15471 | .tested = TEST_OK_PR, | |
15629 | .tested = TEST_OK_PREW, | |
15472 | 15630 | .probe = probe_jedec, |
15473 | 15631 | .probe_timing = 10, |
15474 | 15632 | .block_erasers = |
371 | 371 | #define GIGADEVICE_GD25Q32 0x4016 /* Same as GD25Q32B */ |
372 | 372 | #define GIGADEVICE_GD25Q64 0x4017 /* Same as GD25Q64B */ |
373 | 373 | #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 | |
374 | 378 | #define GIGADEVICE_GD25LQ40 0x6013 |
375 | 379 | #define GIGADEVICE_GD25LQ80 0x6014 |
376 | 380 | #define GIGADEVICE_GD25LQ16 0x6015 |
377 | 381 | #define GIGADEVICE_GD25LQ32 0x6016 |
378 | 382 | #define GIGADEVICE_GD25LQ64 0x6017 /* Same as GD25LQ64B (which is faster) */ |
379 | 383 | #define GIGADEVICE_GD25LQ128 0x6018 |
380 | #define GIGADEVICE_GD25VQ41B 0x4213 | |
381 | 384 | #define GIGADEVICE_GD29GL064CAB 0x7E0601 |
382 | 385 | |
383 | 386 | #define HYUNDAI_ID 0xAD /* Hyundai */ |
0 | 0 | .\" Load the www device when using groff; provide a fallback for groff's MTO macro that formats email addresses. |
1 | 1 | .ie \n[.g] \ |
2 | 2 | . mso www.tmac |
3 | .el \ | |
4 | . de MTO \\$2 \(la\\$1 \(ra\\$3 | |
3 | .el \{ | |
4 | . de MTO | |
5 | \\$2 \(la\\$1 \(ra\\$3 \ | |
5 | 6 | . . |
7 | .\} | |
6 | 8 | .\" Create wrappers for .MTO and .URL that print only text on systems w/o groff or if not outputting to a HTML |
7 | 9 | .\" device. To that end we need to distinguish HTML output on groff from other configurations first. |
8 | 10 | .nr groffhtml 0 |
37 | 39 | . \} |
38 | 40 | . \} |
39 | 41 | .. |
40 | .TH FLASHROM 8 "2016-02-28" "0.9.9-rc1-r1946" | |
42 | .TH FLASHROM 8 "2016-03-13" "0.9.9-r1954" | |
41 | 43 | .SH NAME |
42 | 44 | flashrom \- detect, read, write, verify and erase flash chips |
43 | 45 | .SH SYNOPSIS |
207 | 209 | Specify the programmer device. This is mandatory for all operations |
208 | 210 | involving any chip access (probe/read/write/...). Currently supported are: |
209 | 211 | .sp |
210 | .BR "* internal" " (default, for in-system flashing in the mainboard)" | |
212 | .BR "* internal" " (for in-system flashing in the mainboard)" | |
211 | 213 | .sp |
212 | 214 | .BR "* dummy" " (virtual programmer for testing flashrom)" |
213 | 215 | .sp |
236 | 238 | .sp |
237 | 239 | .BR "* it8212" " (for flash ROMs on ITE IT8212F ATA/RAID controller)" |
238 | 240 | .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). | |
245 | 242 | .sp |
246 | 243 | .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)." | |
249 | 245 | .sp |
250 | 246 | .BR "* buspirate_spi" " (for SPI flash ROMs attached to a Bus Pirate)" |
251 | 247 | .sp |
683 | 679 | .IP |
684 | 680 | This is the first programmer module in flashrom that does not provide access to NOR flash chips but EEPROMs |
685 | 681 | 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. | |
690 | 686 | .SS |
691 | 687 | .BR "ft2232_spi " programmer |
692 | 688 | .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 | |
693 | 694 | An optional parameter specifies the controller |
694 | 695 | type and channel/interface/port it should support. For that you have to use the |
695 | 696 | .sp |
735 | 736 | .SS |
736 | 737 | .BR "serprog " programmer |
737 | 738 | .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 | |
738 | 742 | A mandatory parameter specifies either a serial device (and baud rate) or an IP/port combination for |
739 | 743 | communicating with the programmer. |
740 | 744 | The device/baud combination has to start with |
980 | 984 | .BR "mstarddc_spi " programmer |
981 | 985 | .IP |
982 | 986 | 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 | |
984 | 988 | through EDID (at I2C address 0x50) and sending commands to the display using the DDC/CI protocol (at address |
985 | 989 | 0x37). On displays driven by MSTAR SoCs, it is also possible to access the SoC firmware flash (connected to |
986 | 990 | the Soc through another SPI bus) using an In-System Programming (ISP) port, usually at address 0x49. |
1015 | 1019 | .sp |
1016 | 1020 | .B " flashrom \-p mstarddc_spi:dev=/dev/i2c-1:49,noreset=1 |
1017 | 1021 | .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. | |
1019 | 1023 | To send the reset command afterwards, you can simply run flashrom once more, in chip probe mode (not specifying |
1020 | 1024 | an operation), without the |
1021 | 1025 | .B noreset |
0 | 0 | .\" Load the www device when using groff; provide a fallback for groff's MTO macro that formats email addresses. |
1 | 1 | .ie \n[.g] \ |
2 | 2 | . mso www.tmac |
3 | .el \ | |
4 | . de MTO \\$2 \(la\\$1 \(ra\\$3 | |
3 | .el \{ | |
4 | . de MTO | |
5 | \\$2 \(la\\$1 \(ra\\$3 \ | |
5 | 6 | . . |
7 | .\} | |
6 | 8 | .\" Create wrappers for .MTO and .URL that print only text on systems w/o groff or if not outputting to a HTML |
7 | 9 | .\" device. To that end we need to distinguish HTML output on groff from other configurations first. |
8 | 10 | .nr groffhtml 0 |
207 | 209 | Specify the programmer device. This is mandatory for all operations |
208 | 210 | involving any chip access (probe/read/write/...). Currently supported are: |
209 | 211 | .sp |
210 | .BR "* internal" " (default, for in-system flashing in the mainboard)" | |
212 | .BR "* internal" " (for in-system flashing in the mainboard)" | |
211 | 213 | .sp |
212 | 214 | .BR "* dummy" " (virtual programmer for testing flashrom)" |
213 | 215 | .sp |
236 | 238 | .sp |
237 | 239 | .BR "* it8212" " (for flash ROMs on ITE IT8212F ATA/RAID controller)" |
238 | 240 | .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). | |
245 | 242 | .sp |
246 | 243 | .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)." | |
249 | 245 | .sp |
250 | 246 | .BR "* buspirate_spi" " (for SPI flash ROMs attached to a Bus Pirate)" |
251 | 247 | .sp |
683 | 679 | .IP |
684 | 680 | This is the first programmer module in flashrom that does not provide access to NOR flash chips but EEPROMs |
685 | 681 | 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. | |
690 | 686 | .SS |
691 | 687 | .BR "ft2232_spi " programmer |
692 | 688 | .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 | |
693 | 694 | An optional parameter specifies the controller |
694 | 695 | type and channel/interface/port it should support. For that you have to use the |
695 | 696 | .sp |
735 | 736 | .SS |
736 | 737 | .BR "serprog " programmer |
737 | 738 | .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 | |
738 | 742 | A mandatory parameter specifies either a serial device (and baud rate) or an IP/port combination for |
739 | 743 | communicating with the programmer. |
740 | 744 | The device/baud combination has to start with |
980 | 984 | .BR "mstarddc_spi " programmer |
981 | 985 | .IP |
982 | 986 | 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 | |
984 | 988 | through EDID (at I2C address 0x50) and sending commands to the display using the DDC/CI protocol (at address |
985 | 989 | 0x37). On displays driven by MSTAR SoCs, it is also possible to access the SoC firmware flash (connected to |
986 | 990 | the Soc through another SPI bus) using an In-System Programming (ISP) port, usually at address 0x49. |
1015 | 1019 | .sp |
1016 | 1020 | .B " flashrom \-p mstarddc_spi:dev=/dev/i2c-1:49,noreset=1 |
1017 | 1021 | .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. | |
1019 | 1023 | To send the reset command afterwards, you can simply run flashrom once more, in chip probe mode (not specifying |
1020 | 1024 | an operation), without the |
1021 | 1025 | .B noreset |
32 | 32 | #include "flash.h" |
33 | 33 | #include "hwaccess.h" |
34 | 34 | |
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__)) | |
36 | 36 | #error "Unknown operating system" |
37 | 37 | #endif |
38 | 38 | |
39 | 39 | #define USE_IOPL (IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__)) |
40 | 40 | #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 | |
41 | 46 | |
42 | 47 | #if IS_X86 && USE_DEV_IO |
43 | 48 | int io_fd; |
81 | 86 | sysi86(SI86V86, V86SC_IOPL, 0); |
82 | 87 | #elif USE_DEV_IO |
83 | 88 | close(io_fd); |
89 | #elif USE_IOPERM | |
90 | ioperm(0, 65536, 0); | |
84 | 91 | #elif USE_IOPL |
85 | 92 | iopl(0); |
86 | 93 | #endif |
96 | 103 | if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) { |
97 | 104 | #elif USE_DEV_IO |
98 | 105 | if ((io_fd = open("/dev/io", O_RDWR)) < 0) { |
106 | #elif USE_IOPERM | |
107 | if (ioperm(0, 65536, 1) != 0) { | |
99 | 108 | #elif USE_IOPL |
100 | 109 | if (iopl(3) != 0) { |
101 | 110 | #endif |
67 | 67 | (void)fclose(romlayout); |
68 | 68 | return 1; |
69 | 69 | } |
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)) | |
71 | 71 | continue; |
72 | 72 | #if 0 |
73 | 73 | // fscanf does not like arbitrary comments like that :( later |
55 | 55 | // libpayload |
56 | 56 | #elif defined(__LIBPAYLOAD__) |
57 | 57 | #define __FLASHROM_OS__ "libpayload" |
58 | // GNU Hurd | |
59 | #elif defined(__gnu_hurd__) | |
60 | #define __FLASHROM_OS__ "Hurd" | |
58 | 61 | // Linux |
59 | 62 | #elif defined(__linux__) |
60 | 63 | // There are various flags in use on Android apparently. __ANDROID__ seems to be the most trustworthy. |
399 | 399 | |
400 | 400 | int pickit2_spi_init(void) |
401 | 401 | { |
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 | |
403 | 403 | |
404 | 404 | uint8_t buf[CMD_LENGTH] = { |
405 | 405 | CMD_EXEC_SCRIPT, |
102 | 102 | .half_period = 0, |
103 | 103 | }; |
104 | 104 | |
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 | ||
105 | 117 | int pony_spi_init(void) |
106 | 118 | { |
107 | 119 | int i, data_out; |
117 | 129 | sp_fd = sp_openserport(arg, 9600); |
118 | 130 | if (sp_fd == SER_INV_FD) { |
119 | 131 | free(arg); |
132 | return 1; | |
133 | } | |
134 | if (register_shutdown(pony_spi_shutdown, NULL) != 0) { | |
135 | free(arg); | |
136 | serialport_shutdown(NULL); | |
120 | 137 | return 1; |
121 | 138 | } |
122 | 139 | have_device++; |
489 | 489 | case USB: |
490 | 490 | print_supported_devs(prog, "USB"); |
491 | 491 | break; |
492 | #if NEED_PCI == 1 | |
493 | 492 | case PCI: |
494 | 493 | print_supported_devs(prog, "PCI"); |
495 | 494 | break; |
496 | #endif | |
497 | 495 | case OTHER: |
498 | 496 | if (prog.devs.note != NULL) { |
499 | 497 | msg_ginfo("\nSupported devices for the %s programmer:\n", prog.name); |
570 | 568 | B("ASRock", "AMCP7AION-HT", OK, "http://www.asrock.com/nettop/NVIDIA/ION%20330HT/", "Used in ION 330HT(-BD) barebones."), |
571 | 569 | B("ASRock", "ConRoeXFire-eSATA2", OK, "http://www.asrock.com/mb/overview.asp?model=conroexfire-esata2", NULL), |
572 | 570 | 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."), | |
573 | 572 | 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."), |
574 | 573 | B("ASRock", "G31M-GS", OK, "http://www.asrock.com/mb/overview.asp?Model=G31M-GS", NULL), |
575 | 574 | B("ASRock", "G31M-S rev 2.0", OK, "http://www.asrock.com/mb/overview.asp?model=G31M-S", NULL), |
584 | 583 | B("ASRock", "M3A790GXH/128M", OK, "http://www.asrock.com/mb/overview.asp?Model=M3A790GXH/128M", NULL), |
585 | 584 | B("ASRock", "N61P-S", OK, "http://www.asrock.com/mb/overview.asp?Model=N61P-S", NULL), |
586 | 585 | 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), | |
587 | 587 | B("ASRock", "P4i65GV", OK, "http://www.asrock.com/mb/overview.asp?Model=P4i65GV", NULL), |
588 | 588 | 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."), |
589 | 589 | B("ASUS", "A7N8X Deluxe", OK, "http://www.asus.com/Motherboards/AMD_Socket_A/A7N8X_Deluxe/", NULL), |
386 | 386 | static int handle_speed(struct pci_dev *dev) |
387 | 387 | { |
388 | 388 | 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 */ | |
390 | 390 | |
391 | 391 | char *spispeed = extract_programmer_param("spispeed"); |
392 | 392 | 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; | |
400 | 398 | } |
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)) { | |
407 | 408 | msg_perr("Error: Invalid spispeed value: '%s'.\n", spispeed); |
408 | 409 | free(spispeed); |
409 | 410 | return 1; |
510 | 511 | msg_pinfo("Writes have been disabled for safety reasons because the presence of the IMC\n" |
511 | 512 | "was detected and it could interfere with accessing flash memory. Flashrom will\n" |
512 | 513 | "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" | |
514 | 515 | "in the flash and it is unpredictable what happens if there is none.\n" |
515 | 516 | "\n" |
516 | 517 | "To be safe make sure that there is a working IMC firmware at the right\n" |
169 | 169 | usage(argv, "Seeking to the end of the file failed"); |
170 | 170 | |
171 | 171 | #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); | |
173 | 173 | if (buf == (void *) -1) |
174 | 174 | #endif |
175 | 175 | { |
179 | 179 | usage(argv, "Could not allocate memory"); |
180 | 180 | lseek(fd, 0, SEEK_SET); |
181 | 181 | 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"); | |
183 | 183 | } |
184 | 184 | printf("The flash image has a size of %d [0x%x] bytes.\n", len, len); |
185 | 185 | close(fd); |