Uwe Hermann | ba290d1 | 2009-06-17 12:07:12 +0000 | [diff] [blame] | 1 | /* |
| 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 Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 24 | #include <time.h> |
Uwe Hermann | ba290d1 | 2009-06-17 12:07:12 +0000 | [diff] [blame] | 25 | #include "flash.h" |
| 26 | #include "flashchips.h" |
| 27 | |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 28 | struct board_info_url { |
| 29 | const char *vendor; |
| 30 | const char *name; |
| 31 | const char *url; |
| 32 | }; |
| 33 | |
| 34 | struct board_info_notes { |
| 35 | const char *vendor; |
| 36 | const char *name; |
| 37 | const char *note; |
| 38 | }; |
| 39 | |
Uwe Hermann | ba290d1 | 2009-06-17 12:07:12 +0000 | [diff] [blame] | 40 | /* |
| 41 | * Return a string corresponding to the bustype parameter. |
| 42 | * Memory is obtained with malloc() and can be freed with free(). |
| 43 | */ |
| 44 | char *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 | |
| 75 | static 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 | |
| 88 | void 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 | |
| 160 | void 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 Hermann | e1aa75e | 2009-06-18 14:04:44 +0000 | [diff] [blame] | 183 | void print_supported_boards_helper(const struct board_info *b, const char *msg) |
Uwe Hermann | ba290d1 | 2009-06-17 12:07:12 +0000 | [diff] [blame] | 184 | { |
| 185 | int i, j, boardcount = 0; |
| 186 | |
| 187 | for (i = 0; b[i].vendor != NULL; i++) |
| 188 | boardcount++; |
| 189 | |
Uwe Hermann | e1aa75e | 2009-06-18 14:04:44 +0000 | [diff] [blame] | 190 | printf("\n%s (total: %d):\n\n", msg, boardcount); |
| 191 | |
Uwe Hermann | ba290d1 | 2009-06-17 12:07:12 +0000 | [diff] [blame] | 192 | 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 | |
| 203 | void 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 Hermann | e1aa75e | 2009-06-18 14:04:44 +0000 | [diff] [blame] | 228 | 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 Hermann | ba290d1 | 2009-06-17 12:07:12 +0000 | [diff] [blame] | 236 | } |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 237 | |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 238 | const char *wiki_header = "= Supported devices =\n\n\ |
| 239 | <div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \ |
| 240 | background-color:#eeeeee; align:right; border:1px solid #aabbcc;\"><small>\n\ |
| 241 | Please do '''not''' edit these tables in the wiki directly, they are \ |
| 242 | semi-automatically generated by pasting '''flashrom -z''' output.<br />\ |
| 243 | '''Last update:''' %s(generated by flashrom %s)\n</small></div>\n"; |
| 244 | |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 245 | const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 246 | |- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |
| 247 | ! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\ |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 248 | ! align=\"left\" | Status\n\n"; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 249 | |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 250 | const char *board_th = "{| border=\"0\" style=\"font-size: smaller\" \ |
| 251 | valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |
| 252 | ! align=\"left\" | Mainboard\n! align=\"left\" | Status\n\n"; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 253 | |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 254 | const char *board_th2 = "{| border=\"0\" style=\"font-size: smaller\" \ |
| 255 | valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 256 | ! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n\ |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 257 | ! align=\"left\" | Status\n\n"; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 258 | |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 259 | const char *board_intro = "\ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 260 | \n== Supported mainboards ==\n\n\ |
| 261 | In general, it is very likely that flashrom works out of the box even if your \ |
| 262 | mainboard is not listed below.\n\nThis is a list of mainboards where we have \ |
| 263 | verified that they either do or do not need any special initialization to \ |
| 264 | make flashrom work (given flashrom supports the respective chipset and flash \ |
| 265 | chip), or that they do not yet work at all. If they do not work, support may \ |
| 266 | or may not be added later.\n\n\ |
| 267 | Mainboards which don't appear in the list may or may not work (we don't \ |
| 268 | know, someone has to give it a try). Please report any further verified \ |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 269 | mainboards on the [[Mailinglist|mailing list]].\n"; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 270 | |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 271 | const char *chip_th = "{| border=\"0\" style=\"font-size: smaller\" \ |
| 272 | valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 273 | ! 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\" | \n\ |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 276 | | Probe\n| Read\n| Write\n| Erase\n\n"; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 277 | |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 278 | const char *programmer_section = "\ |
| 279 | \n== Supported programmers ==\n\nThis is a list \ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 280 | of supported PCI devices flashrom can use as programmer:\n\n{| border=\"0\" \ |
| 281 | valign=\"top\"\n| valign=\"top\"|\n\n{| border=\"0\" style=\"font-size: \ |
| 282 | smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |
| 283 | ! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\ |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 284 | ! align=\"left\" | Status\n\n"; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 285 | |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 286 | const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ |
| 287 | In 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; \ |
| 292 | background-color:#ff9f9f; align:right; border:1px solid #aabbcc;\">\n\ |
| 293 | '''IMPORTANT:''' At this point we recommend to '''not''' use flashrom on \ |
| 294 | untested laptops unless you have a means to recover from a flashing that goes \ |
| 295 | wrong (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 Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 298 | const struct board_info_url boards_url[] = { |
| 299 | /* Verified working boards that don't need write-enables. */ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 300 | { "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 Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 303 | { "ASRock", "A770CrossFire", NULL }, |
| 304 | { "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 Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 306 | { "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 Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 308 | { "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 Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 313 | { "ASUS", "A8V-E SE", "http://www.asus.com.tw/products.aspx?l1=3&l2=15&l3=143&l4=0&model=576&modelmenu=1" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 314 | { "ASUS", "M2A-MX", "http://www.asus.com/products.aspx?l1=3&l2=101&l3=583&l4=0&model=1909&modelmenu=1" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 315 | { "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 Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 323 | { "ASUS", "P5B-Deluxe", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-Deluxe/" }, |
| 324 | { "ASUS", "P6T Deluxe V2", "http://www.asus.com/product.aspx?P_ID=iRlP8RG9han6saZx" }, |
| 325 | { "A-Trend", "ATC-6220", "http://www.motherboard.cz/mb/atrend/atc6220.htm" }, |
| 326 | { "BCOM", "WinNET100", "http://www.coreboot.org/BCOM_WINNET100_Build_Tutorial" }, |
| 327 | { "GIGABYTE", "GA-6BXC", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ClassValue=Motherboard&ProductID=1445&ProductName=GA-6BXC" }, |
| 328 | { "GIGABYTE", "GA-6BXDU", "http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ProductID=1429" }, |
| 329 | { "GIGABYTE", "GA-6ZMA", "http://www.gigabyte.de/Support/Motherboard/BIOS_Model.aspx?ProductID=3289" }, |
| 330 | { "Intel", "EP80759", NULL }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 331 | { "Jetway", "J7F4K1G5D-PB", "http://www.jetway.com.tw/jetway/system/productshow2.asp?id=389&proname=J7F4K1G5D-P" }, |
| 332 | { "MSI", "MS-6570 (K7N2)", NULL }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 333 | { "MSI", "MS-7065", NULL }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 334 | { "MSI", "MS-7168 (Orion)", "http://support.packardbell.co.uk/uk/item/index.php?i=spec_orion&pi=platform_honeymoon_istart" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 335 | { "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" }, |
| 336 | { "MSI", "MS-7255 (P4M890M)", "http://us.msi.com/product/p_spec.asp?model=P4M890M" }, |
| 337 | { "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 Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 338 | { "NEC", "PowerMate 2000", "http://support.necam.com/mobilesolutions/hardware/Desktops/pm2000/celeron/" }, |
| 339 | { "PC Engines", "Alix.1c", "http://pcengines.ch/alix1c.htm" }, |
| 340 | { "PC Engines", "Alix.2c2", "http://pcengines.ch/alix2c2.htm" }, |
| 341 | { "PC Engines", "Alix.2c3", "http://pcengines.ch/alix2c3.htm" }, |
| 342 | { "PC Engines", "Alix.3c3", "http://pcengines.ch/alix3c3.htm" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 343 | { "PC Engines", "Alix.3d3", "http://pcengines.ch/alix3d3.htm" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 344 | { "RCA", "RM4100", "http://www.settoplinux.org" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 345 | { "Sun", "Blade x6250", "http://www.sun.com/servers/blades/x6250/" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 346 | { "Supermicro", "H8QC8", "http://www.supermicro.com/Aplus/motherboard/Opteron/nforce/H8QC8.cfm" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 347 | { "Thomson", "IP1000", "http://www.settoplinux.org" }, |
| 348 | { "T-Online", "S-100", "http://wiki.freifunk-hannover.de/T-Online_S_100" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 349 | { "Tyan", "iS5375-1U", "http://www.tyan.com/product_board_detail.aspx?pid=610" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 350 | { "Tyan", "S1846", "http://www.tyan.com/archive/products/html/tsunamiatx.html" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 351 | { "Tyan", "S2881", "http://www.tyan.com/product_board_detail.aspx?pid=115" }, |
| 352 | { "Tyan", "S2882", "http://www.tyan.com/product_board_detail.aspx?pid=121" }, |
| 353 | { "Tyan", "S2882-D", "http://www.tyan.com/product_board_detail.aspx?pid=127" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 354 | { "Tyan", "S2891", "http://www.tyan.com/product_board_detail.aspx?pid=144" }, |
| 355 | { "Tyan", "S2892", "http://www.tyan.com/product_board_detail.aspx?pid=145" }, |
| 356 | { "Tyan", "S2895", "http://www.tyan.com/archive/products/html/thunderk8we.html" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 357 | { "Tyan", "S3095", "http://www.tyan.com/product_board_detail.aspx?pid=181" }, |
| 358 | { "Tyan", "S5180", "http://www.tyan.com/product_board_detail.aspx?pid=456" }, |
| 359 | { "Tyan", "S5191", "http://www.tyan.com/product_board_detail.aspx?pid=343" }, |
| 360 | { "Tyan", "S5197", "http://www.tyan.com/product_board_detail.aspx?pid=349" }, |
| 361 | { "Tyan", "S5211", "http://www.tyan.com/product_board_detail.aspx?pid=591" }, |
| 362 | { "Tyan", "S5211-1U", "http://www.tyan.com/product_board_detail.aspx?pid=593" }, |
| 363 | { "Tyan", "S5220", "http://www.tyan.com/product_board_detail.aspx?pid=597" }, |
| 364 | { "Tyan", "S5375", "http://www.tyan.com/product_board_detail.aspx?pid=566" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 365 | { "Tyan", "S5376G2NR/S5376WAG2NR","http://www.tyan.com/product_board_detail.aspx?pid=605" }, |
| 366 | { "Tyan", "S5377", "http://www.tyan.com/product_board_detail.aspx?pid=601" }, |
| 367 | { "Tyan", "S5397", "http://www.tyan.com/product_board_detail.aspx?pid=560" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 368 | { "VIA", "EPIA-EX15000G", "http://www.via.com.tw/en/products/embedded/ProductDetail.jsp?productLine=1&motherboard_id=450" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 369 | { "VIA", "EPIA-LN", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=473" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 370 | { "VIA", "EPIA-NX15000G", "http://www.via.com.tw/en/products/embedded/ProductDetail.jsp?productLine=1&motherboard_id=470" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 371 | { "VIA", "NAB74X0", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=590" }, |
| 372 | { "VIA", "pc2500e", "http://www.via.com.tw/en/initiatives/empowered/pc2500_mainboard/index.jsp" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 373 | { "VIA", "VB700X", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=490" }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 374 | |
| 375 | /* Verified working boards that DO need write-enables. */ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 376 | { "Acorp", "6A815EPD", NULL }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 377 | { "agami", "Aruma", NULL }, |
| 378 | { "Albatron", "PM266A", NULL }, |
| 379 | { "Artec Group", "DBE61", NULL }, |
| 380 | { "Artec Group", "DBE62", NULL }, |
| 381 | { "ASUS", "A7V8-MX SE", NULL }, |
| 382 | { "ASUS", "P4B266", "http://www.ciao.co.uk/ASUS_Intel_845D_Chipset_P4B266__5409807#productdetail" }, |
| 383 | { "ASUS", "P5A", NULL }, |
| 384 | { "BioStar", "P4M80-M4", NULL }, |
| 385 | { "EPoX", "EP-8K5A2", NULL }, |
| 386 | { "EPoX", "EP-BX3", NULL }, |
| 387 | { "GIGABYTE", "GA-2761GXDK", NULL }, |
| 388 | { "GIGABYTE", "GA-7VT600", NULL }, |
| 389 | { "GIGABYTE", "GA-K8N-SLI", NULL }, |
| 390 | { "GIGABYTE", "GA-M57SLI-S4", NULL }, |
| 391 | { "GIGABYTE", "GA-M61P-S3", NULL }, |
| 392 | { "GIGABYTE", "GA-MA78G-DS3H", NULL }, |
| 393 | { "GIGABYTE", "GA-MA78GM-S2H", NULL }, |
| 394 | { "GIGABYTE", "GA-MA790FX-DQ6", NULL }, |
| 395 | { "HP", "DL145 G3", NULL }, |
| 396 | { "IBM", "x3455", NULL }, |
| 397 | { "Intel", "D201GLY", NULL }, |
| 398 | { "IWILL", "DK8-HTX", NULL }, |
| 399 | { "Kontron", "986LCD-M", NULL }, |
| 400 | { "MSI", "MS-7135 (K8N Neo3)", NULL }, |
| 401 | { "MSI", "MS-6702E (K8T Neo2-F)",NULL }, |
| 402 | { "MSI", "MS-6712 (KT4V)", NULL }, |
| 403 | { "MSI", "MS-6590 (KT4 Ultra)", NULL }, |
| 404 | { "MSI", "MS-7046", NULL }, |
| 405 | { "Soyo", "SY-7VCA", NULL }, |
| 406 | { "Tyan", "S2498 (Tomcat K7M)", "http://www.tyan.com/archive/products/html/tomcatk7m.html" }, |
| 407 | { "VIA", "EPIA-CN", "http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=400" }, |
| 408 | { "VIA", "EPIA M/MII/...", NULL }, |
| 409 | { "VIA", "EPIA SP", NULL }, |
| 410 | { "VIA", "PC3500G", NULL }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 411 | |
| 412 | /* Verified non-working boards (for now). */ |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 413 | { "Abit", "IS-10", "http://www.abit.com.tw/page/en/motherboard/motherboard_detail.php?pMODEL_NAME=IS-10&fMTYPE=Socket+478" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 414 | { "ASUS", "M3N78 Pro", NULL }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 415 | { "ASUS", "MEW-AM", "ftp://ftp.asus.com.tw/pub/ASUS/mb/sock370/810/mew-am/" }, |
| 416 | { "ASUS", "MEW-VM", "http://www.elhvb.com/mboards/OEM/HP/manual/ASUS%20MEW-VM.htm" }, |
| 417 | { "ASUS", "P3B-F", "ftp://ftp.asus.com.tw/pub/ASUS/mb/slot1/440bx/p3b-f/" }, |
| 418 | { "ASUS", "P5B", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B/" }, |
| 419 | { "ASUS", "P5BV-M", "ftp://ftp.asus.com.tw/pub/ASUS/mb/socket775/P5B-VM/" }, |
| 420 | { "Biostar", "M6TBA", "ftp://ftp.biostar-usa.com/manuals/M6TBA/" }, |
| 421 | { "Boser", "HS-6637", "http://www.boser.com.tw/manual/HS-62376637v3.4.pdf" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 422 | { "DFI", "855GME-MGF", NULL }, |
| 423 | { "Elitegroup", "K7VTA3", NULL }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 424 | { "FIC", "VA-502", "ftp://ftp.fic.com.tw/motherboard/manual/socket7/va-502/" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 425 | { "GIGABYTE", "GA-7ZM", NULL }, |
| 426 | { "MSI", "MS-6178", NULL }, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 427 | { "MSI", "MS-7260 (K9N Neo)", "http://global.msi.com.tw/index.php?func=proddesc&prod_no=255&maincat_no=1" }, |
| 428 | { "PCCHIPS", "M537DMA33", "http://motherboards.mbarron.net/models/pcchips/m537dma.htm" }, |
| 429 | { "Soyo", "SY-5VD", "http://www.soyo.com/content/Downloads/163/&c=80&p=464&l=English" }, |
| 430 | { "Sun", "Fire x4540", "http://www.sun.com/servers/x64/x4540/" }, |
| 431 | { "Sun", "Fire x4150", "http://www.sun.com/servers/x64/x4150/" }, |
| 432 | { "Sun", "Fire x4200", "http://www.sun.com/servers/entry/x4200/" }, |
| 433 | { "Sun", "Fire x4600", "http://www.sun.com/servers/x64/x4600/" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 434 | |
| 435 | /* Verified working laptops. */ |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 436 | { "Lenovo", "3000 V100 TF05Cxx", "http://www5.pc.ibm.com/europe/products.nsf/products?openagent&brand=Lenovo3000Notebook&series=Lenovo+3000+V+Series#viewallmodelstop" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 437 | |
| 438 | /* Verified non-working laptops (for now). */ |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 439 | { "Acer", "Aspire One", NULL }, |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 440 | { "Dell", "Latitude CPi A366XT", "http://www.coreboot.org/Dell_Latitude_CPi_A366XT" }, |
| 441 | { "IBM/Lenovo", "Thinkpad T40p", "http://www.thinkwiki.org/wiki/Category:T40p" }, |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 442 | { "IBM/Lenovo", "240", NULL }, |
| 443 | |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 444 | { NULL, NULL, 0 }, |
| 445 | }; |
| 446 | |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 447 | /* Please keep these lists alphabetically ordered by vendor/board. */ |
| 448 | const struct board_info_notes boards_notes[] = { |
| 449 | /* Verified working boards that don't need write-enables. */ |
| 450 | { "ASI", "MB-5BLMP", "Used in the IGEL WinNET III thin client." }, |
| 451 | { "ASUS", "A8V-E SE", "See http://www.coreboot.org/pipermail/coreboot/2007-October/026496.html." }, |
| 452 | { "ASUS", "M2A-VM", "See http://www.coreboot.org/pipermail/coreboot/2007-September/025281.html." }, |
| 453 | { "BCOM", "WinNET100", "Used in the IGEL-316 thin client." }, |
| 454 | |
| 455 | /* Verified working boards that DO need write-enables. */ |
| 456 | { "Acer", "Aspire One", "See http://www.coreboot.org/pipermail/coreboot/2009-May/048041.html." }, |
| 457 | |
| 458 | /* Verified non-working boards (for now). */ |
| 459 | { "MSI", "MS-6178", "Immediately powers off if you try to hot-plug the chip. However, this does '''not''' happen if you use coreboot." }, |
| 460 | { "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." }, |
| 461 | |
| 462 | /* Verified working laptops. */ |
| 463 | /* None which need comments, yet... */ |
| 464 | |
| 465 | /* Verified non-working laptops (for now). */ |
| 466 | { "Acer", "Aspire One", "http://www.coreboot.org/pipermail/coreboot/2009-May/048041.html" }, |
| 467 | { "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." }, |
| 468 | { "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." }, |
| 469 | |
| 470 | { NULL, NULL, 0 }, |
| 471 | }; |
| 472 | |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 473 | static int url(const char *vendor, const char *board) |
| 474 | { |
| 475 | int i; |
| 476 | const struct board_info_url *b = boards_url; |
| 477 | |
| 478 | for (i = 0; b[i].vendor != NULL; i++) { |
| 479 | if (!strcmp(vendor, b[i].vendor) && !strcmp(board, b[i].name)) |
| 480 | return i; |
| 481 | } |
| 482 | |
| 483 | return -1; |
| 484 | } |
| 485 | |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 486 | static int note(const char *vendor, const char *board) |
| 487 | { |
| 488 | int i; |
| 489 | const struct board_info_notes *n = boards_notes; |
| 490 | |
| 491 | for (i = 0; n[i].vendor != NULL; i++) { |
| 492 | if (!strcmp(vendor, n[i].vendor) && !strcmp(board, n[i].name)) |
| 493 | return i; |
| 494 | } |
| 495 | |
| 496 | return -1; |
| 497 | } |
| 498 | |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 499 | void print_supported_chipsets_wiki(void) |
| 500 | { |
| 501 | int i, j, enablescount = 0, color = 1; |
| 502 | const struct penable *e; |
| 503 | |
| 504 | for (e = chipset_enables; e->vendor_name != NULL; e++) |
| 505 | enablescount++; |
| 506 | |
| 507 | printf("\n== Supported chipsets ==\n\nTotal amount of supported " |
| 508 | "chipsets: '''%d'''\n\n{| border=\"0\" valign=\"top\"\n| " |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 509 | "valign=\"top\"|\n\n%s", enablescount, chipset_th); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 510 | |
| 511 | e = chipset_enables; |
| 512 | for (i = 0, j = 0; e[i].vendor_name != NULL; i++, j++) { |
| 513 | /* Alternate colors if the vendor changes. */ |
| 514 | if (i > 0 && strcmp(e[i].vendor_name, e[i - 1].vendor_name)) |
| 515 | color = !color; |
| 516 | |
| 517 | printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s " |
| 518 | "|| %04x:%04x || %s\n", (color) ? "eeeeee" : "dddddd", |
| 519 | e[i].vendor_name, e[i].device_name, |
| 520 | e[i].vendor_id, e[i].device_id, |
| 521 | (e[i].status == OK) ? "{{OK}}" : "?"); |
| 522 | |
| 523 | /* Split table in three columns. */ |
| 524 | if (j >= (enablescount / 3 + 1)) { |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 525 | printf("\n|}\n\n| valign=\"top\"|\n\n%s", chipset_th); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 526 | j = 0; |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | printf("\n|}\n\n|}\n"); |
| 531 | } |
| 532 | |
| 533 | static void wiki_helper(const char *heading, const char *status, |
| 534 | int cols, const struct board_info boards[]) |
| 535 | { |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 536 | int i, j, k, c, boardcount = 0, color = 1, num_notes = 0; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 537 | const struct board_info *b; |
| 538 | const struct board_info_url *u = boards_url; |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 539 | char *notes = calloc(1, 1); |
| 540 | char tmp[900 + 1]; |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 541 | |
| 542 | for (b = boards; b->vendor != NULL; b++) |
| 543 | boardcount++; |
| 544 | |
| 545 | printf("\n'''%s'''\n\nTotal amount of boards: '''%d'''\n\n" |
| 546 | "{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s", |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 547 | heading, boardcount, board_th); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 548 | |
| 549 | for (i = 0, j = 0, b = boards; b[i].vendor != NULL; i++, j++) { |
| 550 | /* Alternate colors if the vendor changes. */ |
| 551 | if (i > 0 && strcmp(b[i].vendor, b[i - 1].vendor)) |
| 552 | color = !color; |
| 553 | |
| 554 | k = url(b[i].vendor, b[i].name); |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 555 | c = note(b[i].vendor, b[i].name); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 556 | |
| 557 | printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s%s %s%s ||" |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 558 | " {{%s}}", (color) ? "eeeeee" : "dddddd", b[i].vendor, |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 559 | (k != -1 && u[k].url) ? "[" : "", |
| 560 | (k != -1 && u[k].url) ? u[k].url : "", |
| 561 | b[i].name, (k != -1 && u[k].url) ? "]" : "", status); |
| 562 | |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 563 | if (c != -1) { |
| 564 | printf("<sup>%d</sup>\n", num_notes + 1); |
| 565 | snprintf((char *)&tmp, 900, "<sup>%d</sup> %s<br />\n", |
| 566 | 1 + num_notes++, boards_notes[c].note); |
| 567 | notes = strcat_realloc(notes, (char *)&tmp); |
| 568 | } else { |
| 569 | printf("\n"); |
| 570 | } |
| 571 | |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 572 | /* Split table in 'cols' columns. */ |
| 573 | if (j >= (boardcount / cols + 1)) { |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 574 | printf("\n|}\n\n| valign=\"top\"|\n\n%s", board_th); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 575 | j = 0; |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | printf("\n|}\n\n|}\n"); |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 580 | |
| 581 | if (num_notes > 0) |
| 582 | printf("\n<small>\n%s</small>\n", notes); |
| 583 | free(notes); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | static void wiki_helper2(const char *heading, int cols) |
| 587 | { |
| 588 | int i, j, boardcount = 0, color = 1; |
| 589 | struct board_pciid_enable *b; |
| 590 | |
| 591 | for (b = board_pciid_enables; b->vendor_name != NULL; b++) |
| 592 | boardcount++; |
| 593 | |
| 594 | printf("\n'''%s'''\n\nTotal amount of boards: '''%d'''\n\n" |
| 595 | "{| border=\"0\" valign=\"top\"\n| valign=\"top\"|\n\n%s", |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 596 | heading, boardcount, board_th2); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 597 | |
| 598 | b = board_pciid_enables; |
| 599 | for (i = 0, j = 0; b[i].vendor_name != NULL; i++, j++) { |
| 600 | /* Alternate colors if the vendor changes. */ |
| 601 | if (i > 0 && strcmp(b[i].vendor_name, b[i - 1].vendor_name)) |
| 602 | color = !color; |
| 603 | |
| 604 | printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || " |
| 605 | "%s%s%s%s || {{OK}}\n", (color) ? "eeeeee" : "dddddd", |
| 606 | b[i].vendor_name, b[i].board_name, |
| 607 | (b[i].lb_vendor) ? "-m " : "—", |
| 608 | (b[i].lb_vendor) ? b[i].lb_vendor : "", |
| 609 | (b[i].lb_vendor) ? ":" : "", |
| 610 | (b[i].lb_vendor) ? b[i].lb_part : ""); |
| 611 | |
| 612 | /* Split table in three columns. */ |
| 613 | if (j >= (boardcount / cols + 1)) { |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 614 | printf("\n|}\n\n| valign=\"top\"|\n\n%s", board_th2); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 615 | j = 0; |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | printf("\n|}\n\n|}\n"); |
| 620 | } |
| 621 | |
| 622 | void print_supported_boards_wiki(void) |
| 623 | { |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 624 | printf("%s", board_intro); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 625 | wiki_helper("Known good (worked out of the box)", "OK", 3, boards_ok); |
| 626 | wiki_helper2("Known good (with write-enable code in flashrom)", 3); |
| 627 | wiki_helper("Not supported (yet)", "No", 3, boards_bad); |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 628 | |
| 629 | printf("%s", laptop_intro); |
| 630 | wiki_helper("Known good (worked out of the box)", "OK", 1, laptops_ok); |
| 631 | wiki_helper("Not supported (yet)", "No", 1, laptops_bad); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 632 | } |
| 633 | |
| 634 | void print_supported_chips_wiki(void) |
| 635 | { |
| 636 | int i = 0, c = 1, chipcount = 0; |
| 637 | struct flashchip *f, *old = NULL; |
| 638 | |
| 639 | for (f = flashchips; f->name != NULL; f++) |
| 640 | chipcount++; |
| 641 | |
| 642 | printf("\n== Supported chips ==\n\nTotal amount of supported " |
| 643 | "chips: '''%d'''\n\n{| border=\"0\" valign=\"top\"\n" |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 644 | "| valign=\"top\"|\n\n%s", chipcount, chip_th); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 645 | |
| 646 | for (f = flashchips; f->name != NULL; f++, i++) { |
| 647 | if (!strncmp(f->name, "unknown", 7)) |
| 648 | continue; |
| 649 | |
| 650 | /* Alternate colors if the vendor changes. */ |
| 651 | if (old != NULL && strcmp(old->vendor, f->vendor)) |
| 652 | c = !c; |
| 653 | |
| 654 | printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || %d " |
| 655 | "|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}\n", |
| 656 | (c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name, |
| 657 | f->total_size, flashbuses_to_text(f->bustype), |
| 658 | ((f->tested & TEST_OK_PROBE) ? "OK" : (c) ? "?2" : "?"), |
| 659 | ((f->tested & TEST_OK_READ) ? "OK" : (c) ? "?2" : "?"), |
| 660 | ((f->tested & TEST_OK_ERASE) ? "OK" : (c) ? "?2" : "?"), |
| 661 | ((f->tested & TEST_OK_WRITE) ? "OK" : (c) ? "?2" : "?")); |
| 662 | |
| 663 | /* Split table into three columns. */ |
| 664 | if (i >= (chipcount / 3 + 1)) { |
Uwe Hermann | 0b0cc16 | 2009-06-19 19:00:48 +0000 | [diff] [blame] | 665 | printf("\n|}\n\n| valign=\"top\"|\n\n%s", chip_th); |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 666 | i = 0; |
| 667 | } |
| 668 | |
| 669 | old = f; |
| 670 | } |
| 671 | |
| 672 | printf("\n|}\n\n|}\n"); |
| 673 | } |
| 674 | |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 675 | void print_supported_pcidevs_wiki(struct pcidev_status *devs) |
| 676 | { |
| 677 | int i = 0; |
| 678 | static int c = 0; |
| 679 | |
| 680 | /* Alternate colors if the vendor changes. */ |
| 681 | c = !c; |
| 682 | |
| 683 | for (i = 0; devs[i].vendor_name != NULL; i++) { |
| 684 | printf("|- bgcolor=\"#%s\" valign=\"top\"\n| %s || %s || " |
| 685 | "%04x:%04x || {{%s}}\n", (c) ? "eeeeee" : "dddddd", |
| 686 | devs[i].vendor_name, devs[i].device_name, |
| 687 | devs[i].vendor_id, devs[i].device_id, |
| 688 | (devs[i].status == PCI_NT) ? (c) ? "?2" : "?" : "OK"); |
| 689 | } |
| 690 | } |
Uwe Hermann | a2d0501 | 2009-06-20 01:21:38 +0000 | [diff] [blame^] | 691 | |
| 692 | void print_wiki_tables(void) |
| 693 | { |
| 694 | time_t t = time(NULL); |
| 695 | |
| 696 | printf(wiki_header, ctime(&t), FLASHROM_VERSION); |
| 697 | print_supported_chips_wiki(); |
| 698 | print_supported_chipsets_wiki(); |
| 699 | print_supported_boards_wiki(); |
| 700 | printf("%s", programmer_section); |
| 701 | print_supported_pcidevs_wiki(nics_3com); |
| 702 | print_supported_pcidevs_wiki(satas_sii); |
| 703 | printf("\n|}\n"); |
| 704 | } |
| 705 | |