blob: bfe5ab888d0963d7e954fe728826b35723635ba7 [file] [log] [blame]
Uwe Hermannba290d12009-06-17 12:07:12 +00001/*
2 * This file is part of the flashrom project.
3 *
4 * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
5 * Copyright (C) 2009 Carl-Daniel Hailfinger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include <string.h>
23#include <stdlib.h>
Uwe Hermanna2d05012009-06-20 01:21:38 +000024#include <time.h>
Uwe Hermannba290d12009-06-17 12:07:12 +000025#include "flash.h"
26#include "flashchips.h"
27
Uwe Hermanna2d05012009-06-20 01:21:38 +000028struct board_info_url {
29 const char *vendor;
30 const char *name;
31 const char *url;
32};
33
34struct board_info_notes {
35 const char *vendor;
36 const char *name;
37 const char *note;
38};
39
Uwe Hermannba290d12009-06-17 12:07:12 +000040/*
41 * Return a string corresponding to the bustype parameter.
42 * Memory is obtained with malloc() and can be freed with free().
43 */
44char *flashbuses_to_text(enum chipbustype bustype)
45{
46 char *ret = calloc(1, 1);
47 if (bustype == CHIP_BUSTYPE_UNKNOWN) {
48 ret = strcat_realloc(ret, "Unknown,");
49 /*
50 * FIXME: Once all chipsets and flash chips have been updated, NONSPI
51 * will cease to exist and should be eliminated here as well.
52 */
53 } else if (bustype == CHIP_BUSTYPE_NONSPI) {
54 ret = strcat_realloc(ret, "Non-SPI,");
55 } else {
56 if (bustype & CHIP_BUSTYPE_PARALLEL)
57 ret = strcat_realloc(ret, "Parallel,");
58 if (bustype & CHIP_BUSTYPE_LPC)
59 ret = strcat_realloc(ret, "LPC,");
60 if (bustype & CHIP_BUSTYPE_FWH)
61 ret = strcat_realloc(ret, "FWH,");
62 if (bustype & CHIP_BUSTYPE_SPI)
63 ret = strcat_realloc(ret, "SPI,");
64 if (bustype == CHIP_BUSTYPE_NONE)
65 ret = strcat_realloc(ret, "None,");
66 }
67 /* Kill last comma. */
68 ret[strlen(ret) - 1] = '\0';
69 ret = realloc(ret, strlen(ret) + 1);
70 return ret;
71}
72
73#define POS_PRINT(x) do { pos += strlen(x); printf(x); } while (0)
74
75static int digits(int n)
76{
77 int i;
78
79 if (!n)
80 return 1;
81
82 for (i = 0; n; ++i)
83 n /= 10;
84
85 return i;
86}
87
88void print_supported_chips(void)
89{
90 int okcol = 0, pos = 0, i, chipcount = 0;
91 struct flashchip *f;
92
93 for (f = flashchips; f->name != NULL; f++) {
94 if (GENERIC_DEVICE_ID == f->model_id)
95 continue;
96 okcol = max(okcol, strlen(f->vendor) + 1 + strlen(f->name));
97 }
98 okcol = (okcol + 7) & ~7;
99
100 for (f = flashchips; f->name != NULL; f++)
101 chipcount++;
102
103 printf("\nSupported flash chips (total: %d):\n\n", chipcount);
104 POS_PRINT("Vendor: Device:");
105 while (pos < okcol) {
106 printf("\t");
107 pos += 8 - (pos % 8);
108 }
109
110 printf("Tested OK:\tKnown BAD: Size/KB: Type:\n\n");
111 printf("(P = PROBE, R = READ, E = ERASE, W = WRITE)\n\n");
112
113 for (f = flashchips; f->name != NULL; f++) {
114 /* Don't print "unknown XXXX SPI chip" entries. */
115 if (!strncmp(f->name, "unknown", 7))
116 continue;
117
118 printf("%s", f->vendor);
119 for (i = 0; i < 10 - strlen(f->vendor); i++)
120 printf(" ");
121 printf("%s", f->name);
122
123 pos = 10 + strlen(f->name);
124 while (pos < okcol) {
125 printf("\t");
126 pos += 8 - (pos % 8);
127 }
128 if ((f->tested & TEST_OK_MASK)) {
129 if ((f->tested & TEST_OK_PROBE))
130 POS_PRINT("P ");
131 if ((f->tested & TEST_OK_READ))
132 POS_PRINT("R ");
133 if ((f->tested & TEST_OK_ERASE))
134 POS_PRINT("E ");
135 if ((f->tested & TEST_OK_WRITE))
136 POS_PRINT("W ");
137 }
138 while (pos < okcol + 9) {
139 printf("\t");
140 pos += 8 - (pos % 8);
141 }
142 if ((f->tested & TEST_BAD_MASK)) {
143 if ((f->tested & TEST_BAD_PROBE))
144 printf("P ");
145 if ((f->tested & TEST_BAD_READ))
146 printf("R ");
147 if ((f->tested & TEST_BAD_ERASE))
148 printf("E ");
149 if ((f->tested & TEST_BAD_WRITE))
150 printf("W ");
151 }
152
153 printf("\t %d", f->total_size);
154 for (i = 0; i < 10 - digits(f->total_size); i++)
155 printf(" ");
156 printf("%s\n", flashbuses_to_text(f->bustype));
157 }
158}
159
160void print_supported_chipsets(void)
161{
162 int i, j, chipsetcount = 0;
163 const struct penable *c = chipset_enables;
164
165 for (i = 0; c[i].vendor_name != NULL; i++)
166 chipsetcount++;
167
168 printf("\nSupported chipsets (total: %d):\n\nVendor: "
169 "Chipset: PCI IDs:\n\n", chipsetcount);
170
171 for (i = 0; c[i].vendor_name != NULL; i++) {
172 printf("%s", c[i].vendor_name);
173 for (j = 0; j < 25 - strlen(c[i].vendor_name); j++)
174 printf(" ");
175 printf("%s", c[i].device_name);
176 for (j = 0; j < 25 - strlen(c[i].device_name); j++)
177 printf(" ");
178 printf("%04x:%04x%s\n", c[i].vendor_id, c[i].device_id,
179 (c[i].status == OK) ? "" : " (untested)");
180 }
181}
182
Uwe Hermanne1aa75e2009-06-18 14:04:44 +0000183void print_supported_boards_helper(const struct board_info *b, const char *msg)
Uwe Hermannba290d12009-06-17 12:07:12 +0000184{
185 int i, j, boardcount = 0;
186
187 for (i = 0; b[i].vendor != NULL; i++)
188 boardcount++;
189
Uwe Hermanne1aa75e2009-06-18 14:04:44 +0000190 printf("\n%s (total: %d):\n\n", msg, boardcount);
191
Uwe Hermannba290d12009-06-17 12:07:12 +0000192 for (i = 0; b[i].vendor != NULL; i++) {
193 printf("%s", b[i].vendor);
194 for (j = 0; j < 25 - strlen(b[i].vendor); j++)
195 printf(" ");
196 printf("%s", b[i].name);
197 for (j = 0; j < 23 - strlen(b[i].name); j++)
198 printf(" ");
199 printf("\n");
200 }
201}
202
203void print_supported_boards(void)
204{
205 int i, j, boardcount = 0;
206 struct board_pciid_enable *b = board_pciid_enables;
207
208 for (i = 0; b[i].vendor_name != NULL; i++)
209 boardcount++;
210
211 printf("\nSupported boards which need write-enable code (total: %d):"
212 "\n\nVendor: Board: "
213 "Required option:\n\n", boardcount);
214
215 for (i = 0; b[i].vendor_name != NULL; i++) {
216 printf("%s", b[i].vendor_name);
217 for (j = 0; j < 25 - strlen(b[i].vendor_name); j++)
218 printf(" ");
219 printf("%s", b[i].board_name);
220 for (j = 0; j < 25 - strlen(b[i].board_name); j++)
221 printf(" ");
222 if (b[i].lb_vendor != NULL)
223 printf("-m %s:%s\n", b[i].lb_vendor, b[i].lb_part);
224 else
225 printf("(none, board is autodetected)\n");
226 }
227
Uwe Hermanne1aa75e2009-06-18 14:04:44 +0000228 print_supported_boards_helper(boards_ok,
229 "Supported boards which don't need write-enable code");
230 print_supported_boards_helper(boards_bad,
231 "Boards which have been verified to NOT work yet");
232 print_supported_boards_helper(laptops_ok,
233 "Laptops which have been verified to work");
234 print_supported_boards_helper(laptops_bad,
235 "Laptops which have been verified to NOT work yet");
Uwe Hermannba290d12009-06-17 12:07:12 +0000236}
Uwe Hermann20a293f2009-06-19 10:42:43 +0000237
Uwe Hermanna2d05012009-06-20 01:21:38 +0000238const char *wiki_header = "= Supported devices =\n\n\
239<div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \
240background-color:#eeeeee; align:right; border:1px solid #aabbcc;\"><small>\n\
241Please do '''not''' edit these tables in the wiki directly, they are \
242semi-automatically generated by pasting '''flashrom -z''' output.<br />\
243'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
244
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000245const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000246|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
247! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000248! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000249
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000250const char *board_th = "{| border=\"0\" style=\"font-size: smaller\" \
251valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
252! align=\"left\" | Mainboard\n! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000253
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000254const char *board_th2 = "{| border=\"0\" style=\"font-size: smaller\" \
255valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000256! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000257! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000258
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000259const char *board_intro = "\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000260\n== Supported mainboards ==\n\n\
261In general, it is very likely that flashrom works out of the box even if your \
262mainboard is not listed below.\n\nThis is a list of mainboards where we have \
263verified that they either do or do not need any special initialization to \
264make flashrom work (given flashrom supports the respective chipset and flash \
265chip), or that they do not yet work at all. If they do not work, support may \
266or may not be added later.\n\n\
267Mainboards which don't appear in the list may or may not work (we don't \
268know, someone has to give it a try). Please report any further verified \
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000269mainboards on the [[Mailinglist|mailing list]].\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000270
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000271const char *chip_th = "{| border=\"0\" style=\"font-size: smaller\" \
272valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000273! align=\"left\" | Device\n! align=\"left\" | Size / KB\n\
274! align=\"left\" | Type\n! align=\"left\" colspan=\"4\" | Status\n\n\
275|- bgcolor=\"#6699ff\"\n| colspan=\"4\" | &nbsp;\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000276| Probe\n| Read\n| Write\n| Erase\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000277
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000278const char *programmer_section = "\
279\n== Supported programmers ==\n\nThis is a list \
Uwe Hermann20a293f2009-06-19 10:42:43 +0000280of supported PCI devices flashrom can use as programmer:\n\n{| border=\"0\" \
281valign=\"top\"\n| valign=\"top\"|\n\n{| border=\"0\" style=\"font-size: \
282smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
283! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000284! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000285
Uwe Hermanna2d05012009-06-20 01:21:38 +0000286const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\
287In general, flashing laptops is more difficult because laptops\n\n\
288* often use the flash chip for stuff besides the BIOS,\n\
289* often have special protection stuff which has to be handled by flashrom,\n\
290* often use flash translation circuits which need drivers in flashrom.\n\n\
291<div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \
Uwe Hermann1432a602009-06-28 23:26:37 +0000292background-color:#ff6666; align:right; border:1px solid #000000;\">\n\
Uwe Hermanna2d05012009-06-20 01:21:38 +0000293'''IMPORTANT:''' At this point we recommend to '''not''' use flashrom on \
294untested laptops unless you have a means to recover from a flashing that goes \
295wrong (a working backup flash chip and/or good soldering skills).\n</div>\n";
296
297/* Please keep these lists alphabetically ordered by vendor/board. */
Uwe Hermann20a293f2009-06-19 10:42:43 +0000298const struct board_info_url boards_url[] = {
299 /* Verified working boards that don't need write-enables. */
Uwe Hermann20a293f2009-06-19 10:42:43 +0000300 { "Abit", "AX8", "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?DEFTITLE=Y&fMTYPE=Socket%20939&pMODEL_NAME=AX8" },
301 { "Advantech", "PCM-5820", "http://taiwan.advantech.com.tw/products/Model_Detail.asp?model_id=1-1TGZL8&BU=ACG&PD=" },
302 { "ASI", "MB-5BLMP", "http://www.hojerteknik.com/winnet.htm" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000303 { "ASRock", "A770CrossFire", "http://www.asrock.com/mb/overview.asp?Model=A770CrossFire&s=AM2\%2b" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000304 { "ASUS", "A7N8X Deluxe", "http://www.asus.com/Product.aspx?P_ID=wAsRYm41KTp78MFC" },
305 { "ASUS", "A7N8X-E Deluxe", "http://www.asus.com/products.aspx?l1=3&l2=13&l3=56&l4=0&model=217&modelmenu=1" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000306 { "ASUS", "A7V400-MX", "http://www.asus.com.tw/products.aspx?l1=3&l2=13&l3=63&l4=0&model=228&modelmenu=1" },
307 { "ASUS", "A7V8X-MX", "http://www.asus.com.tw/products.aspx?l1=3&l2=13&l3=64&l4=0&model=229&modelmenu=1" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000308 { "ASUS", "A8N-E", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=171&l4=0&model=455&modelmenu=2" },
309 { "ASUS", "A8NE-FM/S", "http://www.hardwareschotte.de/hardware/preise/proid_1266090/preis_ASUS+A8NE-FM" },
310 { "ASUS", "A8N-SLI", "http://asus.com/product.aspx?P_ID=J9FKa8z2xVId3pDK" },
311 { "ASUS", "A8N-SLI Premium", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=148&l4=0&model=539&modelmenu=1" },
312 { "ASUS", "A8V-E Deluxe", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=143&l4=0&model=376&modelmenu=1" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000313 { "ASUS", "A8V-E SE", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=143&l4=0&model=576&modelmenu=1" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000314 { "ASUS", "M2A-MX", "http://www.asus.com/products.aspx?l1=3&l2=101&l3=583&l4=0&model=1909&modelmenu=1" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000315 { "ASUS", "M2A-VM", "http://www.asus.com.tw/products.aspx?l1=3&l2=101&l3=496&l4=0&model=1568&modelmenu=1" },
316 { "ASUS", "M2N-E", "http://www.asus.com/products.aspx?l1=3&l2=101&l3=308&l4=0&model=1181&modelmenu=1" },
317 { "ASUS", "M2V", "http://asus.com/Product.aspx?P_ID=OqYlEDFfF6ZqZGvp" },
318 { "ASUS", "P2B", "http://www.motherboard.cz/mb/asus/P2B.htm" },
319 { "ASUS", "P2B-D", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p2b-d/" },
320 { "ASUS", "P2B-DS", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p2b-ds/" },
321 { "ASUS", "P2B-F", "http://www.motherboard.cz/mb/asus/P2B-F.htm" },
322 { "ASUS", "P2L97-S", "http://www.motherboard.cz/mb/asus/P2L97-S.htm" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000323 { "ASUS", "P5B-Deluxe", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-Deluxe/" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000324 { "ASUS", "P5KC", "http://www.asus.com/product.aspx?P_ID=fFZ8oUIGmLpwNMjj" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000325 { "ASUS", "P6T Deluxe V2", "http://www.asus.com/product.aspx?P_ID=iRlP8RG9han6saZx" },
326 { "A-Trend", "ATC-6220", "http://www.motherboard.cz/mb/atrend/atc6220.htm" },
327 { "BCOM", "WinNET100", "http://www.coreboot.org/BCOM_WINNET100_Build_Tutorial" },
328 { "GIGABYTE", "GA-6BXC", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ClassValue=Motherboard&ProductID=1445&ProductName=GA-6BXC" },
329 { "GIGABYTE", "GA-6BXDU", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=1429" },
330 { "GIGABYTE", "GA-6ZMA", "http://www.gigabyte.de/Support/Motherboard/BIOS_Model.aspx?ProductID=3289" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000331 { "GIGABYTE", "GA-EX58-UD4P", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2986" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000332 { "GIGABYTE", "GA-EP35-DS3L", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2778" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000333 { "Intel", "EP80759", NULL },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000334 { "Jetway", "J7F4K1G5D-PB", "http://www.jetway.com.tw/jetway/system/productshow2.asp?id=389&proname=J7F4K1G5D-P" },
335 { "MSI", "MS-6570 (K7N2)", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000336 { "MSI", "MS-7065", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000337 { "MSI", "MS-7168 (Orion)", "http://support.packardbell.co.uk/uk/item/index.php?i=spec_orion&pi=platform_honeymoon_istart" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000338 { "MSI", "MS-7236 (945PL Neo3)", "http://global.msi.com.tw/index.php?func=prodmbspec&maincat_no=1&cat2_no=&cat3_no=&prod_no=1173#menu" },
339 { "MSI", "MS-7255 (P4M890M)", "http://us.msi.com/product/p_spec.asp?model=P4M890M" },
340 { "MSI", "MS-7345 (P35 Neo2-FIR)","http://www.msi.com/index.php?func=prodcpusupport&maincat_no=1&cat2_no=170&cat3_no=&prod_no=1261#menu" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000341 { "NEC", "PowerMate 2000", "http://support.necam.com/mobilesolutions/hardware/Desktops/pm2000/celeron/" },
342 { "PC Engines", "Alix.1c", "http://pcengines.ch/alix1c.htm" },
343 { "PC Engines", "Alix.2c2", "http://pcengines.ch/alix2c2.htm" },
344 { "PC Engines", "Alix.2c3", "http://pcengines.ch/alix2c3.htm" },
345 { "PC Engines", "Alix.3c3", "http://pcengines.ch/alix3c3.htm" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000346 { "PC Engines", "Alix.3d3", "http://pcengines.ch/alix3d3.htm" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000347 { "RCA", "RM4100", "http://www.settoplinux.org" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000348 { "Sun", "Blade x6250", "http://www.sun.com/servers/blades/x6250/" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000349 { "Supermicro", "H8QC8", "http://www.supermicro.com/Aplus/motherboard/Opteron/nforce/H8QC8.cfm" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000350 { "Thomson", "IP1000", "http://www.settoplinux.org" },
351 { "T-Online", "S-100", "http://wiki.freifunk-hannover.de/T-Online_S_100" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000352 { "Tyan", "iS5375-1U", "http://www.tyan.com/product_board_detail.aspx?pid=610" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000353 { "Tyan", "S1846", "http://www.tyan.com/archive/products/html/tsunamiatx.html" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000354 { "Tyan", "S2881", "http://www.tyan.com/product_board_detail.aspx?pid=115" },
355 { "Tyan", "S2882", "http://www.tyan.com/product_board_detail.aspx?pid=121" },
356 { "Tyan", "S2882-D", "http://www.tyan.com/product_board_detail.aspx?pid=127" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000357 { "Tyan", "S2891", "http://www.tyan.com/product_board_detail.aspx?pid=144" },
358 { "Tyan", "S2892", "http://www.tyan.com/product_board_detail.aspx?pid=145" },
359 { "Tyan", "S2895", "http://www.tyan.com/archive/products/html/thunderk8we.html" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000360 { "Tyan", "S3095", "http://www.tyan.com/product_board_detail.aspx?pid=181" },
361 { "Tyan", "S5180", "http://www.tyan.com/product_board_detail.aspx?pid=456" },
362 { "Tyan", "S5191", "http://www.tyan.com/product_board_detail.aspx?pid=343" },
363 { "Tyan", "S5197", "http://www.tyan.com/product_board_detail.aspx?pid=349" },
364 { "Tyan", "S5211", "http://www.tyan.com/product_board_detail.aspx?pid=591" },
365 { "Tyan", "S5211-1U", "http://www.tyan.com/product_board_detail.aspx?pid=593" },
366 { "Tyan", "S5220", "http://www.tyan.com/product_board_detail.aspx?pid=597" },
367 { "Tyan", "S5375", "http://www.tyan.com/product_board_detail.aspx?pid=566" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000368 { "Tyan", "S5376G2NR/S5376WAG2NR","http://www.tyan.com/product_board_detail.aspx?pid=605" },
369 { "Tyan", "S5377", "http://www.tyan.com/product_board_detail.aspx?pid=601" },
370 { "Tyan", "S5397", "http://www.tyan.com/product_board_detail.aspx?pid=560" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000371 { "VIA", "EPIA-EX15000G", "http://www.via.com.tw/en/products/embedded/ProductDetail.jsp?productLine=1&motherboard_id=450" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000372 { "VIA", "EPIA-LN", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=473" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000373 { "VIA", "EPIA-M700", "http://via.com.tw/servlet/downloadSvl?motherboard_id=670&download_file_id=3700" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000374 { "VIA", "EPIA-NX15000G", "http://www.via.com.tw/en/products/embedded/ProductDetail.jsp?productLine=1&motherboard_id=470" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000375 { "VIA", "NAB74X0", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=590" },
376 { "VIA", "pc2500e", "http://www.via.com.tw/en/initiatives/empowered/pc2500_mainboard/index.jsp" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000377 { "VIA", "VB700X", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=490" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000378
379 /* Verified working boards that DO need write-enables. */
Uwe Hermann20a293f2009-06-19 10:42:43 +0000380 { "Acorp", "6A815EPD", NULL },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000381 { "agami", "Aruma", NULL },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000382 { "Albatron", "PM266A Pro", "http://www.albatron.com.tw/English/Product/MB/pro_detail.asp?rlink=Overview&no=56" }, /* FIXME */
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000383 { "Artec Group", "DBE61", "http://wiki.thincan.org/DBE61" },
384 { "Artec Group", "DBE62", "http://wiki.thincan.org/DBE62" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000385 { "ASUS", "A7V8X-MX SE", "http://www.asus.com/product.aspx?P_ID=1guVBT1qV5oqhHyZ" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000386 { "ASUS", "P4B266", "http://www.ciao.co.uk/ASUS_Intel_845D_Chipset_P4B266__5409807#productdetail" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000387 { "ASUS", "P5A", "ftp://ftp.asus.com.tw/pub/ASUS/mb/sock7/ali/p5a/" },
388 { "Biostar", "P4M80-M4", "http://www.biostar-usa.com/mbdetails.asp?model=p4m80-m4" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000389 { "Elitegroup", "K7VTA3", "http://www.ecs.com.tw/ECSWebSite/Products/ProductsDetail.aspx?detailid=264&CategoryID=1&DetailName=Specification&MenuID=52&LanID=0" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000390 { "EPoX", "EP-8K5A2", "http://www.epox.com/product.asp?ID=EP-8K5A2" },
391 { "EPoX", "EP-BX3", "http://www.epox.com/product.asp?ID=EP-BX3" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000392 { "GIGABYTE", "GA-2761GXDK", NULL },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000393 { "GIGABYTE", "GA-7VT600", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=1666" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000394 { "GIGABYTE", "GA-7ZM", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=1366" },
395 { "GIGABYTE", "GA-K8N-SLI", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=1928" },
396 { "GIGABYTE", "GA-M57SLI-S4", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2287&ModelName=GA-M57SLI-S4" },
397 { "GIGABYTE", "GA-M61P-S3", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=2434" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000398 { "GIGABYTE", "GA-MA78G-DS3H", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=2800" }, /* TODO: Rev 1.x or 2.x? */
399 { "GIGABYTE", "GA-MA78GM-S2H", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=2758" }, /* TODO: Rev. 1.0, 1.1, or 2.x? */
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000400 { "GIGABYTE", "GA-MA790FX-DQ6", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=2690" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000401 { "HP", "DL145 G3", NULL },
402 { "IBM", "x3455", NULL },
403 { "Intel", "D201GLY", NULL },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000404 { "IWILL", "DK8-HTX", "http://web.archive.org/web/20060507170150/http://www.iwill.net/product_2.asp?p_id=98" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000405 { "Kontron", "986LCD-M", "http://de.kontron.com/products/boards+and+mezzanines/embedded+motherboards/miniitx+motherboards/986lcdmmitx.html" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000406 { "Mitac", "6513WU", "http://web.archive.org/web/20050313054828/http://www.mitac.com/micweb/products/tyan/6513wu/6513wu.htm" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000407 { "MSI", "MS-6590 (KT4 Ultra)", NULL },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000408 { "MSI", "MS-6702E (K8T Neo2-F)",NULL },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000409 { "MSI", "MS-6712 (KT4V)", "http://www.msi.com/index.php?func=proddesc&maincat_no=1&cat2_no=&cat3_no=&prod_no=505" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000410 { "MSI", "MS-7046", NULL },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000411 { "MSI", "MS-7135 (K8N Neo3)", NULL },
412 { "Shuttle", "AK38N", "http://eu.shuttle.com/en/desktopdefault.aspx/tabid-36/558_read-9889/" },
413 { "Soyo", "SY-7VCA", "http://www.tomshardware.com/reviews/12-socket-370-motherboards,196-15.html" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000414 { "Tyan", "S2498 (Tomcat K7M)", "http://www.tyan.com/archive/products/html/tomcatk7m.html" },
415 { "VIA", "EPIA-CN", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=400" },
416 { "VIA", "EPIA M/MII/...", NULL },
417 { "VIA", "EPIA SP", NULL },
418 { "VIA", "PC3500G", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000419
420 /* Verified non-working boards (for now). */
Uwe Hermann20a293f2009-06-19 10:42:43 +0000421 { "Abit", "IS-10", "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?pMODEL_NAME=IS-10&fMTYPE=Socket+478" },
Uwe Hermanndd2e14c2009-06-23 20:27:33 +0000422 { "ASUS", "M3N78 Pro", "http://www.asus.com/product.aspx?P_ID=DVvm9CU0G1bCC4gp" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000423 { "ASUS", "MEW-AM", "ftp://ftp.asus.com.tw/pub/ASUS/mb/sock370/810/mew-am/" },
424 { "ASUS", "MEW-VM", "http://www.elhvb.com/mboards/OEM/HP/manual/ASUS%20MEW-VM.htm" },
425 { "ASUS", "P3B-F", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p3b-f/" },
426 { "ASUS", "P5B", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B/" },
427 { "ASUS", "P5BV-M", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-VM/" },
428 { "Biostar", "M6TBA", "ftp://ftp.biostar-usa.com/manuals/M6TBA/" },
429 { "Boser", "HS-6637", "http://www.boser.com.tw/manual/HS-62376637v3.4.pdf" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000430 { "DFI", "855GME-MGF", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000431 { "FIC", "VA-502", "ftp://ftp.fic.com.tw/motherboard/manual/socket7/va-502/" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000432 { "MSI", "MS-6178", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000433 { "MSI", "MS-7260 (K9N Neo)", "http://global.msi.com.tw/index.php?func=proddesc&prod_no=255&maincat_no=1" },
434 { "PCCHIPS", "M537DMA33", "http://motherboards.mbarron.net/models/pcchips/m537dma.htm" },
435 { "Soyo", "SY-5VD", "http://www.soyo.com/content/Downloads/163/&c=80&p=464&l=English" },
436 { "Sun", "Fire x4540", "http://www.sun.com/servers/x64/x4540/" },
437 { "Sun", "Fire x4150", "http://www.sun.com/servers/x64/x4150/" },
438 { "Sun", "Fire x4200", "http://www.sun.com/servers/entry/x4200/" },
439 { "Sun", "Fire x4600", "http://www.sun.com/servers/x64/x4600/" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000440
441 /* Verified working laptops. */
Uwe Hermanna2d05012009-06-20 01:21:38 +0000442 { "Lenovo", "3000 V100 TF05Cxx", "http://www5.pc.ibm.com/europe/products.nsf/products?openagent&brand=Lenovo3000Notebook&series=Lenovo+3000+V+Series#viewallmodelstop" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000443
444 /* Verified non-working laptops (for now). */
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000445 { "Acer", "Aspire One", NULL },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000446 { "ASUS", "Eee PC 701 4G", "http://www.asus.com/product.aspx?P_ID=h6SPd3tEzLEsrEiS" },
Uwe Hermanna2d05012009-06-20 01:21:38 +0000447 { "Dell", "Latitude CPi A366XT", "http://www.coreboot.org/Dell_Latitude_CPi_A366XT" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000448 { "HP/Compaq", "nx9010", "http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&objectID=c00348514" },
Uwe Hermanna2d05012009-06-20 01:21:38 +0000449 { "IBM/Lenovo", "Thinkpad T40p", "http://www.thinkwiki.org/wiki/Category:T40p" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000450 { "IBM/Lenovo", "240", NULL },
451
Uwe Hermann20a293f2009-06-19 10:42:43 +0000452 { NULL, NULL, 0 },
453};
454
Uwe Hermanna2d05012009-06-20 01:21:38 +0000455/* Please keep these lists alphabetically ordered by vendor/board. */
456const struct board_info_notes boards_notes[] = {
457 /* Verified working boards that don't need write-enables. */
458 { "ASI", "MB-5BLMP", "Used in the IGEL WinNET III thin client." },
459 { "ASUS", "A8V-E SE", "See http://www.coreboot.org/pipermail/coreboot/2007-October/026496.html." },
460 { "ASUS", "M2A-VM", "See http://www.coreboot.org/pipermail/coreboot/2007-September/025281.html." },
461 { "BCOM", "WinNET100", "Used in the IGEL-316 thin client." },
Uwe Hermannbca6aa12009-06-22 01:37:06 +0000462 { "GIGABYTE", "GA-7ZM", "Works fine iff you remove jumper JP9 on the board and disable the flash protection BIOS option." },
Uwe Hermanna2d05012009-06-20 01:21:38 +0000463
464 /* Verified working boards that DO need write-enables. */
465 { "Acer", "Aspire One", "See http://www.coreboot.org/pipermail/coreboot/2009-May/048041.html." },
466
467 /* Verified non-working boards (for now). */
468 { "MSI", "MS-6178", "Immediately powers off if you try to hot-plug the chip. However, this does '''not''' happen if you use coreboot." },
469 { "MSI", "MS-7260 (K9N Neo)", "Interestingly flashrom does not work when the vendor BIOS is booted, but it ''does'' work flawlessly when the machine is booted with coreboot." },
470
471 /* Verified working laptops. */
472 /* None which need comments, yet... */
473
474 /* Verified non-working laptops (for now). */
475 { "Acer", "Aspire One", "http://www.coreboot.org/pipermail/coreboot/2009-May/048041.html" },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000476 { "ASUS", "Eee PC 701 4G", "It seems the chip (25X40VSIG) is behind some SPI flash translation layer." },
Uwe Hermanna2d05012009-06-20 01:21:38 +0000477 { "Dell", "Latitude CPi A366XT", "The laptop immediately powers off if you try to hot-swap the chip. It's not yet tested if write/erase would work on this laptop." },
Uwe Hermann04d5dc42009-07-03 17:12:05 +0000478 { "HP/Compaq", "nx9010", "Hangs upon '''flashrom -V''' (needs hard power-cycle then)." },
Uwe Hermanna2d05012009-06-20 01:21:38 +0000479 { "IBM/Lenovo", "Thinkpad T40p", "Seems to (partially) work at first, but one block/sector cannot be written which then leaves you with a bricked laptop. Maybe this can be investigated and fixed in software later." },
480
481 { NULL, NULL, 0 },
482};
483
Uwe Hermann20a293f2009-06-19 10:42:43 +0000484static int url(const char *vendor, const char *board)
485{
486 int i;
487 const struct board_info_url *b = boards_url;
488
489 for (i = 0; b[i].vendor != NULL; i++) {
490 if (!strcmp(vendor, b[i].vendor) && !strcmp(board, b[i].name))
491 return i;
492 }
493
494 return -1;
495}
496
Uwe Hermanna2d05012009-06-20 01:21:38 +0000497static int note(const char *vendor, const char *board)
498{
499 int i;
500 const struct board_info_notes *n = boards_notes;
501
502 for (i = 0; n[i].vendor != NULL; i++) {
503 if (!strcmp(vendor, n[i].vendor) && !strcmp(board, n[i].name))
504 return i;
505 }
506
507 return -1;
508}
509
Uwe Hermann20a293f2009-06-19 10:42:43 +0000510void print_supported_chipsets_wiki(void)
511{
512 int i, j, enablescount = 0, color = 1;
513 const struct penable *e;
514
515 for (e = chipset_enables; e->vendor_name != NULL; e++)
516 enablescount++;
517
518 printf("\n== Supported chipsets ==\n\nTotal amount of supported "
519 "chipsets: '''%d'''\n\n{| border=\"0\" valign=\"top\"\n| "
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000520 "valign=\"top\"|\n\n%s", enablescount, chipset_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000521
522 e = chipset_enables;
523 for (i = 0, j = 0; e[i].vendor_name != NULL; i++, j++) {
524 /* Alternate colors if the vendor changes. */
525 if (i > 0 && strcmp(e[i].vendor_name, e[i - 1].vendor_name))
526 color = !color;
527
528 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s "
529 "|| %04x:%04x || %s\n", (color) ? "eeeeee" : "dddddd",
530 e[i].vendor_name, e[i].device_name,
531 e[i].vendor_id, e[i].device_id,
532 (e[i].status == OK) ? "{{OK}}" : "?");
533
534 /* Split table in three columns. */
535 if (j >= (enablescount / 3 + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000536 printf("\n|}\n\n| valign=\"top\"|\n\n%s", chipset_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000537 j = 0;
538 }
539 }
540
541 printf("\n|}\n\n|}\n");
542}
543
544static void wiki_helper(const char *heading, const char *status,
545 int cols, const struct board_info boards[])
546{
Uwe Hermanna2d05012009-06-20 01:21:38 +0000547 int i, j, k, c, boardcount = 0, color = 1, num_notes = 0;
Uwe Hermann20a293f2009-06-19 10:42:43 +0000548 const struct board_info *b;
549 const struct board_info_url *u = boards_url;
Uwe Hermanna2d05012009-06-20 01:21:38 +0000550 char *notes = calloc(1, 1);
551 char tmp[900 + 1];
Uwe Hermann20a293f2009-06-19 10:42:43 +0000552
553 for (b = boards; b->vendor != NULL; b++)
554 boardcount++;
555
556 printf("\n'''%s'''\n\nTotal amount of boards: '''%d'''\n\n"
557 "{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s",
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000558 heading, boardcount, board_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000559
560 for (i = 0, j = 0, b = boards; b[i].vendor != NULL; i++, j++) {
561 /* Alternate colors if the vendor changes. */
562 if (i > 0 && strcmp(b[i].vendor, b[i - 1].vendor))
563 color = !color;
564
565 k = url(b[i].vendor, b[i].name);
Uwe Hermanna2d05012009-06-20 01:21:38 +0000566 c = note(b[i].vendor, b[i].name);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000567
568 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s%s %s%s ||"
Uwe Hermanna2d05012009-06-20 01:21:38 +0000569 " {{%s}}", (color) ? "eeeeee" : "dddddd", b[i].vendor,
Uwe Hermann20a293f2009-06-19 10:42:43 +0000570 (k != -1 && u[k].url) ? "[" : "",
571 (k != -1 && u[k].url) ? u[k].url : "",
572 b[i].name, (k != -1 && u[k].url) ? "]" : "", status);
573
Uwe Hermanna2d05012009-06-20 01:21:38 +0000574 if (c != -1) {
575 printf("<sup>%d</sup>\n", num_notes + 1);
576 snprintf((char *)&tmp, 900, "<sup>%d</sup> %s<br />\n",
577 1 + num_notes++, boards_notes[c].note);
578 notes = strcat_realloc(notes, (char *)&tmp);
579 } else {
580 printf("\n");
581 }
582
Uwe Hermann20a293f2009-06-19 10:42:43 +0000583 /* Split table in 'cols' columns. */
584 if (j >= (boardcount / cols + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000585 printf("\n|}\n\n| valign=\"top\"|\n\n%s", board_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000586 j = 0;
587 }
588 }
589
590 printf("\n|}\n\n|}\n");
Uwe Hermanna2d05012009-06-20 01:21:38 +0000591
592 if (num_notes > 0)
593 printf("\n<small>\n%s</small>\n", notes);
594 free(notes);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000595}
596
597static void wiki_helper2(const char *heading, int cols)
598{
599 int i, j, boardcount = 0, color = 1;
600 struct board_pciid_enable *b;
601
602 for (b = board_pciid_enables; b->vendor_name != NULL; b++)
603 boardcount++;
604
605 printf("\n'''%s'''\n\nTotal amount of boards: '''%d'''\n\n"
606 "{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s",
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000607 heading, boardcount, board_th2);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000608
609 b = board_pciid_enables;
610 for (i = 0, j = 0; b[i].vendor_name != NULL; i++, j++) {
611 /* Alternate colors if the vendor changes. */
612 if (i > 0 && strcmp(b[i].vendor_name, b[i - 1].vendor_name))
613 color = !color;
614
615 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || "
616 "%s%s%s%s || {{OK}}\n", (color) ? "eeeeee" : "dddddd",
617 b[i].vendor_name, b[i].board_name,
618 (b[i].lb_vendor) ? "-m " : "&mdash;",
619 (b[i].lb_vendor) ? b[i].lb_vendor : "",
620 (b[i].lb_vendor) ? ":" : "",
621 (b[i].lb_vendor) ? b[i].lb_part : "");
622
623 /* Split table in three columns. */
624 if (j >= (boardcount / cols + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000625 printf("\n|}\n\n| valign=\"top\"|\n\n%s", board_th2);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000626 j = 0;
627 }
628 }
629
630 printf("\n|}\n\n|}\n");
631}
632
633void print_supported_boards_wiki(void)
634{
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000635 printf("%s", board_intro);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000636 wiki_helper("Known good (worked out of the box)", "OK", 3, boards_ok);
637 wiki_helper2("Known good (with write-enable code in flashrom)", 3);
638 wiki_helper("Not supported (yet)", "No", 3, boards_bad);
Uwe Hermanna2d05012009-06-20 01:21:38 +0000639
640 printf("%s", laptop_intro);
641 wiki_helper("Known good (worked out of the box)", "OK", 1, laptops_ok);
642 wiki_helper("Not supported (yet)", "No", 1, laptops_bad);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000643}
644
645void print_supported_chips_wiki(void)
646{
647 int i = 0, c = 1, chipcount = 0;
648 struct flashchip *f, *old = NULL;
649
650 for (f = flashchips; f->name != NULL; f++)
651 chipcount++;
652
653 printf("\n== Supported chips ==\n\nTotal amount of supported "
654 "chips: '''%d'''\n\n{| border=\"0\" valign=\"top\"\n"
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000655 "| valign=\"top\"|\n\n%s", chipcount, chip_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000656
657 for (f = flashchips; f->name != NULL; f++, i++) {
Uwe Hermann1432a602009-06-28 23:26:37 +0000658 /* Don't print "unknown XXXX SPI chip" entries. */
Uwe Hermann20a293f2009-06-19 10:42:43 +0000659 if (!strncmp(f->name, "unknown", 7))
660 continue;
661
662 /* Alternate colors if the vendor changes. */
663 if (old != NULL && strcmp(old->vendor, f->vendor))
664 c = !c;
665
666 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || %d "
667 "|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}\n",
668 (c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name,
669 f->total_size, flashbuses_to_text(f->bustype),
670 ((f->tested & TEST_OK_PROBE) ? "OK" : (c) ? "?2" : "?"),
671 ((f->tested & TEST_OK_READ) ? "OK" : (c) ? "?2" : "?"),
672 ((f->tested & TEST_OK_ERASE) ? "OK" : (c) ? "?2" : "?"),
673 ((f->tested & TEST_OK_WRITE) ? "OK" : (c) ? "?2" : "?"));
674
675 /* Split table into three columns. */
676 if (i >= (chipcount / 3 + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000677 printf("\n|}\n\n| valign=\"top\"|\n\n%s", chip_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000678 i = 0;
679 }
680
681 old = f;
682 }
683
684 printf("\n|}\n\n|}\n");
685}
686
Uwe Hermann20a293f2009-06-19 10:42:43 +0000687void print_supported_pcidevs_wiki(struct pcidev_status *devs)
688{
689 int i = 0;
690 static int c = 0;
691
692 /* Alternate colors if the vendor changes. */
693 c = !c;
694
695 for (i = 0; devs[i].vendor_name != NULL; i++) {
696 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || "
697 "%04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd",
698 devs[i].vendor_name, devs[i].device_name,
699 devs[i].vendor_id, devs[i].device_id,
700 (devs[i].status == PCI_NT) ? (c) ? "?2" : "?" : "OK");
701 }
702}
Uwe Hermanna2d05012009-06-20 01:21:38 +0000703
704void print_wiki_tables(void)
705{
706 time_t t = time(NULL);
707
708 printf(wiki_header, ctime(&t), FLASHROM_VERSION);
709 print_supported_chips_wiki();
710 print_supported_chipsets_wiki();
711 print_supported_boards_wiki();
712 printf("%s", programmer_section);
713 print_supported_pcidevs_wiki(nics_3com);
714 print_supported_pcidevs_wiki(satas_sii);
715 printf("\n|}\n");
716}
717