blob: 53883c32f058e30e307bb54beffabd04b382849b [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>
24#include "flash.h"
25#include "flashchips.h"
26
27/*
28 * Return a string corresponding to the bustype parameter.
29 * Memory is obtained with malloc() and can be freed with free().
30 */
31char *flashbuses_to_text(enum chipbustype bustype)
32{
33 char *ret = calloc(1, 1);
34 if (bustype == CHIP_BUSTYPE_UNKNOWN) {
35 ret = strcat_realloc(ret, "Unknown,");
36 /*
37 * FIXME: Once all chipsets and flash chips have been updated, NONSPI
38 * will cease to exist and should be eliminated here as well.
39 */
40 } else if (bustype == CHIP_BUSTYPE_NONSPI) {
41 ret = strcat_realloc(ret, "Non-SPI,");
42 } else {
43 if (bustype & CHIP_BUSTYPE_PARALLEL)
44 ret = strcat_realloc(ret, "Parallel,");
45 if (bustype & CHIP_BUSTYPE_LPC)
46 ret = strcat_realloc(ret, "LPC,");
47 if (bustype & CHIP_BUSTYPE_FWH)
48 ret = strcat_realloc(ret, "FWH,");
49 if (bustype & CHIP_BUSTYPE_SPI)
50 ret = strcat_realloc(ret, "SPI,");
51 if (bustype == CHIP_BUSTYPE_NONE)
52 ret = strcat_realloc(ret, "None,");
53 }
54 /* Kill last comma. */
55 ret[strlen(ret) - 1] = '\0';
56 ret = realloc(ret, strlen(ret) + 1);
57 return ret;
58}
59
60#define POS_PRINT(x) do { pos += strlen(x); printf(x); } while (0)
61
62static int digits(int n)
63{
64 int i;
65
66 if (!n)
67 return 1;
68
69 for (i = 0; n; ++i)
70 n /= 10;
71
72 return i;
73}
74
75void print_supported_chips(void)
76{
77 int okcol = 0, pos = 0, i, chipcount = 0;
78 struct flashchip *f;
79
80 for (f = flashchips; f->name != NULL; f++) {
81 if (GENERIC_DEVICE_ID == f->model_id)
82 continue;
83 okcol = max(okcol, strlen(f->vendor) + 1 + strlen(f->name));
84 }
85 okcol = (okcol + 7) & ~7;
86
87 for (f = flashchips; f->name != NULL; f++)
88 chipcount++;
89
90 printf("\nSupported flash chips (total: %d):\n\n", chipcount);
91 POS_PRINT("Vendor: Device:");
92 while (pos < okcol) {
93 printf("\t");
94 pos += 8 - (pos % 8);
95 }
96
97 printf("Tested OK:\tKnown BAD: Size/KB: Type:\n\n");
98 printf("(P = PROBE, R = READ, E = ERASE, W = WRITE)\n\n");
99
100 for (f = flashchips; f->name != NULL; f++) {
101 /* Don't print "unknown XXXX SPI chip" entries. */
102 if (!strncmp(f->name, "unknown", 7))
103 continue;
104
105 printf("%s", f->vendor);
106 for (i = 0; i < 10 - strlen(f->vendor); i++)
107 printf(" ");
108 printf("%s", f->name);
109
110 pos = 10 + strlen(f->name);
111 while (pos < okcol) {
112 printf("\t");
113 pos += 8 - (pos % 8);
114 }
115 if ((f->tested & TEST_OK_MASK)) {
116 if ((f->tested & TEST_OK_PROBE))
117 POS_PRINT("P ");
118 if ((f->tested & TEST_OK_READ))
119 POS_PRINT("R ");
120 if ((f->tested & TEST_OK_ERASE))
121 POS_PRINT("E ");
122 if ((f->tested & TEST_OK_WRITE))
123 POS_PRINT("W ");
124 }
125 while (pos < okcol + 9) {
126 printf("\t");
127 pos += 8 - (pos % 8);
128 }
129 if ((f->tested & TEST_BAD_MASK)) {
130 if ((f->tested & TEST_BAD_PROBE))
131 printf("P ");
132 if ((f->tested & TEST_BAD_READ))
133 printf("R ");
134 if ((f->tested & TEST_BAD_ERASE))
135 printf("E ");
136 if ((f->tested & TEST_BAD_WRITE))
137 printf("W ");
138 }
139
140 printf("\t %d", f->total_size);
141 for (i = 0; i < 10 - digits(f->total_size); i++)
142 printf(" ");
143 printf("%s\n", flashbuses_to_text(f->bustype));
144 }
145}
146
147void print_supported_chipsets(void)
148{
149 int i, j, chipsetcount = 0;
150 const struct penable *c = chipset_enables;
151
152 for (i = 0; c[i].vendor_name != NULL; i++)
153 chipsetcount++;
154
155 printf("\nSupported chipsets (total: %d):\n\nVendor: "
156 "Chipset: PCI IDs:\n\n", chipsetcount);
157
158 for (i = 0; c[i].vendor_name != NULL; i++) {
159 printf("%s", c[i].vendor_name);
160 for (j = 0; j < 25 - strlen(c[i].vendor_name); j++)
161 printf(" ");
162 printf("%s", c[i].device_name);
163 for (j = 0; j < 25 - strlen(c[i].device_name); j++)
164 printf(" ");
165 printf("%04x:%04x%s\n", c[i].vendor_id, c[i].device_id,
166 (c[i].status == OK) ? "" : " (untested)");
167 }
168}
169
Uwe Hermanne1aa75e2009-06-18 14:04:44 +0000170void print_supported_boards_helper(const struct board_info *b, const char *msg)
Uwe Hermannba290d12009-06-17 12:07:12 +0000171{
172 int i, j, boardcount = 0;
173
174 for (i = 0; b[i].vendor != NULL; i++)
175 boardcount++;
176
Uwe Hermanne1aa75e2009-06-18 14:04:44 +0000177 printf("\n%s (total: %d):\n\n", msg, boardcount);
178
Uwe Hermannba290d12009-06-17 12:07:12 +0000179 for (i = 0; b[i].vendor != NULL; i++) {
180 printf("%s", b[i].vendor);
181 for (j = 0; j < 25 - strlen(b[i].vendor); j++)
182 printf(" ");
183 printf("%s", b[i].name);
184 for (j = 0; j < 23 - strlen(b[i].name); j++)
185 printf(" ");
186 printf("\n");
187 }
188}
189
190void print_supported_boards(void)
191{
192 int i, j, boardcount = 0;
193 struct board_pciid_enable *b = board_pciid_enables;
194
195 for (i = 0; b[i].vendor_name != NULL; i++)
196 boardcount++;
197
198 printf("\nSupported boards which need write-enable code (total: %d):"
199 "\n\nVendor: Board: "
200 "Required option:\n\n", boardcount);
201
202 for (i = 0; b[i].vendor_name != NULL; i++) {
203 printf("%s", b[i].vendor_name);
204 for (j = 0; j < 25 - strlen(b[i].vendor_name); j++)
205 printf(" ");
206 printf("%s", b[i].board_name);
207 for (j = 0; j < 25 - strlen(b[i].board_name); j++)
208 printf(" ");
209 if (b[i].lb_vendor != NULL)
210 printf("-m %s:%s\n", b[i].lb_vendor, b[i].lb_part);
211 else
212 printf("(none, board is autodetected)\n");
213 }
214
Uwe Hermanne1aa75e2009-06-18 14:04:44 +0000215 print_supported_boards_helper(boards_ok,
216 "Supported boards which don't need write-enable code");
217 print_supported_boards_helper(boards_bad,
218 "Boards which have been verified to NOT work yet");
219 print_supported_boards_helper(laptops_ok,
220 "Laptops which have been verified to work");
221 print_supported_boards_helper(laptops_bad,
222 "Laptops which have been verified to NOT work yet");
Uwe Hermannba290d12009-06-17 12:07:12 +0000223}
Uwe Hermann20a293f2009-06-19 10:42:43 +0000224
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000225const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000226|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
227! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000228! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000229
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000230const char *board_th = "{| border=\"0\" style=\"font-size: smaller\" \
231valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
232! align=\"left\" | Mainboard\n! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000233
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000234const char *board_th2 = "{| border=\"0\" style=\"font-size: smaller\" \
235valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000236! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000237! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000238
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000239const char *board_intro = "\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000240\n== Supported mainboards ==\n\n\
241In general, it is very likely that flashrom works out of the box even if your \
242mainboard is not listed below.\n\nThis is a list of mainboards where we have \
243verified that they either do or do not need any special initialization to \
244make flashrom work (given flashrom supports the respective chipset and flash \
245chip), or that they do not yet work at all. If they do not work, support may \
246or may not be added later.\n\n\
247Mainboards which don't appear in the list may or may not work (we don't \
248know, someone has to give it a try). Please report any further verified \
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000249mainboards on the [[Mailinglist|mailing list]].\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000250
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000251const char *chip_th = "{| border=\"0\" style=\"font-size: smaller\" \
252valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
Uwe Hermann20a293f2009-06-19 10:42:43 +0000253! align=\"left\" | Device\n! align=\"left\" | Size / KB\n\
254! align=\"left\" | Type\n! align=\"left\" colspan=\"4\" | Status\n\n\
255|- bgcolor=\"#6699ff\"\n| colspan=\"4\" | &nbsp;\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000256| Probe\n| Read\n| Write\n| Erase\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000257
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000258const char *programmer_section = "\
259\n== Supported programmers ==\n\nThis is a list \
Uwe Hermann20a293f2009-06-19 10:42:43 +0000260of supported PCI devices flashrom can use as programmer:\n\n{| border=\"0\" \
261valign=\"top\"\n| valign=\"top\"|\n\n{| border=\"0\" style=\"font-size: \
262smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
263! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000264! align=\"left\" | Status\n\n";
Uwe Hermann20a293f2009-06-19 10:42:43 +0000265
266const struct board_info_url boards_url[] = {
267 /* Verified working boards that don't need write-enables. */
268 /* Please keep this list alphabetically ordered by vendor/board. */
269 { "Abit", "AX8", "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?DEFTITLE=Y&fMTYPE=Socket%20939&pMODEL_NAME=AX8" },
270 { "Advantech", "PCM-5820", "http://taiwan.advantech.com.tw/products/Model_Detail.asp?model_id=1-1TGZL8&BU=ACG&PD=" },
271 { "ASI", "MB-5BLMP", "http://www.hojerteknik.com/winnet.htm" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000272 { "ASRock", "A770CrossFire", NULL },
273 { "ASUS", "A7N8X Deluxe", "http://www.asus.com/Product.aspx?P_ID=wAsRYm41KTp78MFC" },
274 { "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 +0000275 { "ASUS", "A7V400-MX", "http://www.asus.com.tw/products.aspx?l1=3&l2=13&l3=63&l4=0&model=228&modelmenu=1" },
276 { "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 +0000277 { "ASUS", "A8N-E", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=171&l4=0&model=455&modelmenu=2" },
278 { "ASUS", "A8NE-FM/S", "http://www.hardwareschotte.de/hardware/preise/proid_1266090/preis_ASUS+A8NE-FM" },
279 { "ASUS", "A8N-SLI", "http://asus.com/product.aspx?P_ID=J9FKa8z2xVId3pDK" },
280 { "ASUS", "A8N-SLI Premium", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=148&l4=0&model=539&modelmenu=1" },
281 { "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 +0000282 { "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 +0000283 { "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 +0000284 { "ASUS", "M2A-VM", "http://www.asus.com.tw/products.aspx?l1=3&l2=101&l3=496&l4=0&model=1568&modelmenu=1" },
285 { "ASUS", "M2N-E", "http://www.asus.com/products.aspx?l1=3&l2=101&l3=308&l4=0&model=1181&modelmenu=1" },
286 { "ASUS", "M2V", "http://asus.com/Product.aspx?P_ID=OqYlEDFfF6ZqZGvp" },
287 { "ASUS", "P2B", "http://www.motherboard.cz/mb/asus/P2B.htm" },
288 { "ASUS", "P2B-D", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p2b-d/" },
289 { "ASUS", "P2B-DS", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p2b-ds/" },
290 { "ASUS", "P2B-F", "http://www.motherboard.cz/mb/asus/P2B-F.htm" },
291 { "ASUS", "P2L97-S", "http://www.motherboard.cz/mb/asus/P2L97-S.htm" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000292 { "ASUS", "P5B-Deluxe", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-Deluxe/" },
293 { "ASUS", "P6T Deluxe V2", "http://www.asus.com/product.aspx?P_ID=iRlP8RG9han6saZx" },
294 { "A-Trend", "ATC-6220", "http://www.motherboard.cz/mb/atrend/atc6220.htm" },
295 { "BCOM", "WinNET100", "http://www.coreboot.org/BCOM_WINNET100_Build_Tutorial" },
296 { "GIGABYTE", "GA-6BXC", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ClassValue=Motherboard&ProductID=1445&ProductName=GA-6BXC" },
297 { "GIGABYTE", "GA-6BXDU", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=1429" },
298 { "GIGABYTE", "GA-6ZMA", "http://www.gigabyte.de/Support/Motherboard/BIOS_Model.aspx?ProductID=3289" },
299 { "Intel", "EP80759", NULL },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000300 { "Jetway", "J7F4K1G5D-PB", "http://www.jetway.com.tw/jetway/system/productshow2.asp?id=389&proname=J7F4K1G5D-P" },
301 { "MSI", "MS-6570 (K7N2)", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000302 { "MSI", "MS-7065", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000303 { "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 +0000304 { "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" },
305 { "MSI", "MS-7255 (P4M890M)", "http://us.msi.com/product/p_spec.asp?model=P4M890M" },
306 { "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 +0000307 { "NEC", "PowerMate 2000", "http://support.necam.com/mobilesolutions/hardware/Desktops/pm2000/celeron/" },
308 { "PC Engines", "Alix.1c", "http://pcengines.ch/alix1c.htm" },
309 { "PC Engines", "Alix.2c2", "http://pcengines.ch/alix2c2.htm" },
310 { "PC Engines", "Alix.2c3", "http://pcengines.ch/alix2c3.htm" },
311 { "PC Engines", "Alix.3c3", "http://pcengines.ch/alix3c3.htm" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000312 { "PC Engines", "Alix.3d3", "http://pcengines.ch/alix3d3.htm" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000313 { "RCA", "RM4100", "http://www.settoplinux.org" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000314 { "Sun", "Blade x6250", "http://www.sun.com/servers/blades/x6250/" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000315 { "Supermicro", "H8QC8", "http://www.supermicro.com/Aplus/motherboard/Opteron/nforce/H8QC8.cfm" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000316 { "Thomson", "IP1000", "http://www.settoplinux.org" },
317 { "T-Online", "S-100", "http://wiki.freifunk-hannover.de/T-Online_S_100" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000318 { "Tyan", "iS5375-1U", "http://www.tyan.com/product_board_detail.aspx?pid=610" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000319 { "Tyan", "S1846", "http://www.tyan.com/archive/products/html/tsunamiatx.html" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000320 { "Tyan", "S2881", "http://www.tyan.com/product_board_detail.aspx?pid=115" },
321 { "Tyan", "S2882", "http://www.tyan.com/product_board_detail.aspx?pid=121" },
322 { "Tyan", "S2882-D", "http://www.tyan.com/product_board_detail.aspx?pid=127" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000323 { "Tyan", "S2891", "http://www.tyan.com/product_board_detail.aspx?pid=144" },
324 { "Tyan", "S2892", "http://www.tyan.com/product_board_detail.aspx?pid=145" },
325 { "Tyan", "S2895", "http://www.tyan.com/archive/products/html/thunderk8we.html" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000326 { "Tyan", "S3095", "http://www.tyan.com/product_board_detail.aspx?pid=181" },
327 { "Tyan", "S5180", "http://www.tyan.com/product_board_detail.aspx?pid=456" },
328 { "Tyan", "S5191", "http://www.tyan.com/product_board_detail.aspx?pid=343" },
329 { "Tyan", "S5197", "http://www.tyan.com/product_board_detail.aspx?pid=349" },
330 { "Tyan", "S5211", "http://www.tyan.com/product_board_detail.aspx?pid=591" },
331 { "Tyan", "S5211-1U", "http://www.tyan.com/product_board_detail.aspx?pid=593" },
332 { "Tyan", "S5220", "http://www.tyan.com/product_board_detail.aspx?pid=597" },
333 { "Tyan", "S5375", "http://www.tyan.com/product_board_detail.aspx?pid=566" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000334 { "Tyan", "S5376G2NR/S5376WAG2NR","http://www.tyan.com/product_board_detail.aspx?pid=605" },
335 { "Tyan", "S5377", "http://www.tyan.com/product_board_detail.aspx?pid=601" },
336 { "Tyan", "S5397", "http://www.tyan.com/product_board_detail.aspx?pid=560" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000337 { "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 +0000338 { "VIA", "EPIA-LN", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=473" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000339 { "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 +0000340 { "VIA", "NAB74X0", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=590" },
341 { "VIA", "pc2500e", "http://www.via.com.tw/en/initiatives/empowered/pc2500_mainboard/index.jsp" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000342 { "VIA", "VB700X", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=490" },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000343
344 /* Verified working boards that DO need write-enables. */
345 /* Please keep this list alphabetically ordered by vendor/board. */
346 { "Acorp", "6A815EPD", NULL },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000347 { "agami", "Aruma", NULL },
348 { "Albatron", "PM266A", NULL },
349 { "Artec Group", "DBE61", NULL },
350 { "Artec Group", "DBE62", NULL },
351 { "ASUS", "A7V8-MX SE", NULL },
352 { "ASUS", "P4B266", "http://www.ciao.co.uk/ASUS_Intel_845D_Chipset_P4B266__5409807#productdetail" },
353 { "ASUS", "P5A", NULL },
354 { "BioStar", "P4M80-M4", NULL },
355 { "EPoX", "EP-8K5A2", NULL },
356 { "EPoX", "EP-BX3", NULL },
357 { "GIGABYTE", "GA-2761GXDK", NULL },
358 { "GIGABYTE", "GA-7VT600", NULL },
359 { "GIGABYTE", "GA-K8N-SLI", NULL },
360 { "GIGABYTE", "GA-M57SLI-S4", NULL },
361 { "GIGABYTE", "GA-M61P-S3", NULL },
362 { "GIGABYTE", "GA-MA78G-DS3H", NULL },
363 { "GIGABYTE", "GA-MA78GM-S2H", NULL },
364 { "GIGABYTE", "GA-MA790FX-DQ6", NULL },
365 { "HP", "DL145 G3", NULL },
366 { "IBM", "x3455", NULL },
367 { "Intel", "D201GLY", NULL },
368 { "IWILL", "DK8-HTX", NULL },
369 { "Kontron", "986LCD-M", NULL },
370 { "MSI", "MS-7135 (K8N Neo3)", NULL },
371 { "MSI", "MS-6702E (K8T Neo2-F)",NULL },
372 { "MSI", "MS-6712 (KT4V)", NULL },
373 { "MSI", "MS-6590 (KT4 Ultra)", NULL },
374 { "MSI", "MS-7046", NULL },
375 { "Soyo", "SY-7VCA", NULL },
376 { "Tyan", "S2498 (Tomcat K7M)", "http://www.tyan.com/archive/products/html/tomcatk7m.html" },
377 { "VIA", "EPIA-CN", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=400" },
378 { "VIA", "EPIA M/MII/...", NULL },
379 { "VIA", "EPIA SP", NULL },
380 { "VIA", "PC3500G", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000381
382 /* Verified non-working boards (for now). */
383 /* Please keep this list alphabetically ordered by vendor/board. */
384 { "Abit", "IS-10", "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?pMODEL_NAME=IS-10&fMTYPE=Socket+478" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000385 { "ASUS", "M3N78 Pro", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000386 { "ASUS", "MEW-AM", "ftp://ftp.asus.com.tw/pub/ASUS/mb/sock370/810/mew-am/" },
387 { "ASUS", "MEW-VM", "http://www.elhvb.com/mboards/OEM/HP/manual/ASUS%20MEW-VM.htm" },
388 { "ASUS", "P3B-F", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p3b-f/" },
389 { "ASUS", "P5B", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B/" },
390 { "ASUS", "P5BV-M", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-VM/" },
391 { "Biostar", "M6TBA", "ftp://ftp.biostar-usa.com/manuals/M6TBA/" },
392 { "Boser", "HS-6637", "http://www.boser.com.tw/manual/HS-62376637v3.4.pdf" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000393 { "DFI", "855GME-MGF", NULL },
394 { "Elitegroup", "K7VTA3", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000395 { "FIC", "VA-502", "ftp://ftp.fic.com.tw/motherboard/manual/socket7/va-502/" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000396 { "GIGABYTE", "GA-7ZM", NULL },
397 { "MSI", "MS-6178", NULL },
Uwe Hermann20a293f2009-06-19 10:42:43 +0000398 { "MSI", "MS-7260 (K9N Neo)", "http://global.msi.com.tw/index.php?func=proddesc&prod_no=255&maincat_no=1" },
399 { "PCCHIPS", "M537DMA33", "http://motherboards.mbarron.net/models/pcchips/m537dma.htm" },
400 { "Soyo", "SY-5VD", "http://www.soyo.com/content/Downloads/163/&c=80&p=464&l=English" },
401 { "Sun", "Fire x4540", "http://www.sun.com/servers/x64/x4540/" },
402 { "Sun", "Fire x4150", "http://www.sun.com/servers/x64/x4150/" },
403 { "Sun", "Fire x4200", "http://www.sun.com/servers/entry/x4200/" },
404 { "Sun", "Fire x4600", "http://www.sun.com/servers/x64/x4600/" },
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000405
406 /* Verified working laptops. */
407 /* Please keep this list alphabetically ordered by vendor/board. */
408 { "Lenovo", "3000 V100 TF05Cxx", NULL },
409
410 /* Verified non-working laptops (for now). */
411 /* Please keep this list alphabetically ordered by vendor/board. */
412 { "Acer", "Aspire One", NULL },
413 { "Dell", "Latitude CPi A366XT", NULL },
414 { "IBM/Lenovo", "Thinkpad T40p", NULL },
415 { "IBM/Lenovo", "240", NULL },
416
Uwe Hermann20a293f2009-06-19 10:42:43 +0000417 { NULL, NULL, 0 },
418};
419
420static int url(const char *vendor, const char *board)
421{
422 int i;
423 const struct board_info_url *b = boards_url;
424
425 for (i = 0; b[i].vendor != NULL; i++) {
426 if (!strcmp(vendor, b[i].vendor) && !strcmp(board, b[i].name))
427 return i;
428 }
429
430 return -1;
431}
432
433void print_supported_chipsets_wiki(void)
434{
435 int i, j, enablescount = 0, color = 1;
436 const struct penable *e;
437
438 for (e = chipset_enables; e->vendor_name != NULL; e++)
439 enablescount++;
440
441 printf("\n== Supported chipsets ==\n\nTotal amount of supported "
442 "chipsets: '''%d'''\n\n{| border=\"0\" valign=\"top\"\n| "
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000443 "valign=\"top\"|\n\n%s", enablescount, chipset_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000444
445 e = chipset_enables;
446 for (i = 0, j = 0; e[i].vendor_name != NULL; i++, j++) {
447 /* Alternate colors if the vendor changes. */
448 if (i > 0 && strcmp(e[i].vendor_name, e[i - 1].vendor_name))
449 color = !color;
450
451 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s "
452 "|| %04x:%04x || %s\n", (color) ? "eeeeee" : "dddddd",
453 e[i].vendor_name, e[i].device_name,
454 e[i].vendor_id, e[i].device_id,
455 (e[i].status == OK) ? "{{OK}}" : "?");
456
457 /* Split table in three columns. */
458 if (j >= (enablescount / 3 + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000459 printf("\n|}\n\n| valign=\"top\"|\n\n%s", chipset_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000460 j = 0;
461 }
462 }
463
464 printf("\n|}\n\n|}\n");
465}
466
467static void wiki_helper(const char *heading, const char *status,
468 int cols, const struct board_info boards[])
469{
470 int i, j, k, boardcount = 0, color = 1;
471 const struct board_info *b;
472 const struct board_info_url *u = boards_url;
473
474 for (b = boards; b->vendor != NULL; b++)
475 boardcount++;
476
477 printf("\n'''%s'''\n\nTotal amount of boards: '''%d'''\n\n"
478 "{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s",
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000479 heading, boardcount, board_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000480
481 for (i = 0, j = 0, b = boards; b[i].vendor != NULL; i++, j++) {
482 /* Alternate colors if the vendor changes. */
483 if (i > 0 && strcmp(b[i].vendor, b[i - 1].vendor))
484 color = !color;
485
486 k = url(b[i].vendor, b[i].name);
487
488 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s%s %s%s ||"
489 " {{%s}}\n", (color) ? "eeeeee" : "dddddd", b[i].vendor,
490 (k != -1 && u[k].url) ? "[" : "",
491 (k != -1 && u[k].url) ? u[k].url : "",
492 b[i].name, (k != -1 && u[k].url) ? "]" : "", status);
493
494 /* Split table in 'cols' columns. */
495 if (j >= (boardcount / cols + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000496 printf("\n|}\n\n| valign=\"top\"|\n\n%s", board_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000497 j = 0;
498 }
499 }
500
501 printf("\n|}\n\n|}\n");
502}
503
504static void wiki_helper2(const char *heading, int cols)
505{
506 int i, j, boardcount = 0, color = 1;
507 struct board_pciid_enable *b;
508
509 for (b = board_pciid_enables; b->vendor_name != NULL; b++)
510 boardcount++;
511
512 printf("\n'''%s'''\n\nTotal amount of boards: '''%d'''\n\n"
513 "{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s",
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000514 heading, boardcount, board_th2);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000515
516 b = board_pciid_enables;
517 for (i = 0, j = 0; b[i].vendor_name != NULL; i++, j++) {
518 /* Alternate colors if the vendor changes. */
519 if (i > 0 && strcmp(b[i].vendor_name, b[i - 1].vendor_name))
520 color = !color;
521
522 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || "
523 "%s%s%s%s || {{OK}}\n", (color) ? "eeeeee" : "dddddd",
524 b[i].vendor_name, b[i].board_name,
525 (b[i].lb_vendor) ? "-m " : "&mdash;",
526 (b[i].lb_vendor) ? b[i].lb_vendor : "",
527 (b[i].lb_vendor) ? ":" : "",
528 (b[i].lb_vendor) ? b[i].lb_part : "");
529
530 /* Split table in three columns. */
531 if (j >= (boardcount / cols + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000532 printf("\n|}\n\n| valign=\"top\"|\n\n%s", board_th2);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000533 j = 0;
534 }
535 }
536
537 printf("\n|}\n\n|}\n");
538}
539
540void print_supported_boards_wiki(void)
541{
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000542 printf("%s", board_intro);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000543 wiki_helper("Known good (worked out of the box)", "OK", 3, boards_ok);
544 wiki_helper2("Known good (with write-enable code in flashrom)", 3);
545 wiki_helper("Not supported (yet)", "No", 3, boards_bad);
546}
547
548void print_supported_chips_wiki(void)
549{
550 int i = 0, c = 1, chipcount = 0;
551 struct flashchip *f, *old = NULL;
552
553 for (f = flashchips; f->name != NULL; f++)
554 chipcount++;
555
556 printf("\n== Supported chips ==\n\nTotal amount of supported "
557 "chips: '''%d'''\n\n{| border=\"0\" valign=\"top\"\n"
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000558 "| valign=\"top\"|\n\n%s", chipcount, chip_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000559
560 for (f = flashchips; f->name != NULL; f++, i++) {
561 if (!strncmp(f->name, "unknown", 7))
562 continue;
563
564 /* Alternate colors if the vendor changes. */
565 if (old != NULL && strcmp(old->vendor, f->vendor))
566 c = !c;
567
568 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || %d "
569 "|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}\n",
570 (c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name,
571 f->total_size, flashbuses_to_text(f->bustype),
572 ((f->tested & TEST_OK_PROBE) ? "OK" : (c) ? "?2" : "?"),
573 ((f->tested & TEST_OK_READ) ? "OK" : (c) ? "?2" : "?"),
574 ((f->tested & TEST_OK_ERASE) ? "OK" : (c) ? "?2" : "?"),
575 ((f->tested & TEST_OK_WRITE) ? "OK" : (c) ? "?2" : "?"));
576
577 /* Split table into three columns. */
578 if (i >= (chipcount / 3 + 1)) {
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000579 printf("\n|}\n\n| valign=\"top\"|\n\n%s", chip_th);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000580 i = 0;
581 }
582
583 old = f;
584 }
585
586 printf("\n|}\n\n|}\n");
587}
588
589void print_supported_pcidevs_wiki_header(void)
590{
Uwe Hermann0b0cc162009-06-19 19:00:48 +0000591 printf("%s", programmer_section);
Uwe Hermann20a293f2009-06-19 10:42:43 +0000592}
593
594void print_supported_pcidevs_wiki_footer(void)
595{
596 printf("\n|}\n");
597}
598
599void print_supported_pcidevs_wiki(struct pcidev_status *devs)
600{
601 int i = 0;
602 static int c = 0;
603
604 /* Alternate colors if the vendor changes. */
605 c = !c;
606
607 for (i = 0; devs[i].vendor_name != NULL; i++) {
608 printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || "
609 "%04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd",
610 devs[i].vendor_name, devs[i].device_name,
611 devs[i].vendor_id, devs[i].device_id,
612 (devs[i].status == PCI_NT) ? (c) ? "?2" : "?" : "OK");
613 }
614}