Commit f74a7b9c authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Add printing of chip voltage ranges to print_wiki.c


- add voltage ranges
- center some headers (test values OK, No, ? are centered via wiki templates)
- fix style error in header (align:right -> text-align:right)

Corresponding to flashrom svn r1441.
Signed-off-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
parent a28087fa
......@@ -29,7 +29,8 @@
static const char wiki_header[] = "= Supported devices =\n\n\
<div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \
background-color:#eeeeee; align:right; border:1px solid #aabbcc;\"><small>\n\
background-color:#eeeeee; text-align:right; border:1px solid #aabbcc;\">\
<small>\n\
Please do '''not''' edit these tables in the wiki directly, they are \
generated by pasting '''flashrom -z''' output.<br />\
'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
......@@ -37,12 +38,13 @@ generated by pasting '''flashrom -z''' output.<br />\
#if CONFIG_INTERNAL == 1
static const char chipset_th[] = "{| border=\"0\" style=\"font-size: smaller\"\n\
|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
! align=\"left\" | Status\n\n";
! align=\"left\" | Southbridge\n! align=\"center\" | PCI IDs\n\
! align=\"center\" | Status\n\n";
static const char board_th[] = "{| border=\"0\" style=\"font-size: smaller\" \
valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n! align=\"left\" | Status\n\n";
! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n\
! align=\"center\" | Status\n\n";
static const char board_intro[] = "\
\n== Supported mainboards ==\n\n\
......@@ -57,20 +59,26 @@ not work (we don't know, someone has to give it a try). Please report any \
further verified mainboards on the [[Mailinglist|mailing list]].\n";
#endif
static const char chip_th[] = "{| border=\"0\" style=\"font-size: smaller\" \
valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Device\n! align=\"left\" | Size / kB\n\
! align=\"left\" | Type\n! align=\"left\" colspan=\"4\" | Status\n\n\
static const char chip_th[] = "{\
| border=\"0\" style=\"font-size: smaller\" valign=\"top\"\n\
|- bgcolor=\"#6699dd\"\n\
! align=\"left\" | Vendor\n\
! align=\"left\" | Device\n\
! align=\"center\" | Size [kB]\n\
! align=\"center\" | Type\n\
! align=\"center\" colspan=\"4\" | Status\n\
! align=\"center\" colspan=\"2\" | Voltage [V]\n\n\
|- bgcolor=\"#6699ff\"\n| colspan=\"4\" | &nbsp;\n\
| Probe\n| Read\n| Erase\n| Write\n\n";
| Probe\n| Read\n| Erase\n| Write\n\
| align=\"center\" | min \n| align=\"center\" | max\n\n";
static const char programmer_section[] = "\
\n== Supported programmers ==\n\nThis is a list \
of supported PCI devices flashrom can use as programmer:\n\n{| border=\"0\" \
valign=\"top\"\n| valign=\"top\"|\n\n{| border=\"0\" style=\"font-size: \
smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
! align=\"left\" | Status\n\n";
! align=\"left\" | Device\n! align=\"center\" | PCI IDs\n\
! align=\"center\" | Status\n\n";
#if CONFIG_INTERNAL == 1
static const char laptop_intro[] = "\n== Supported laptops/notebooks ==\n\n\
......@@ -204,6 +212,8 @@ static void print_supported_chips_wiki(int cols)
const struct flashchip *f, *old = NULL;
uint32_t t;
char *s;
char vmax[6];
char vmin[6];
for (f = flashchips; f->name != NULL; f++) {
/* Don't count "unknown XXXX SPI chip" entries. */
......@@ -227,8 +237,13 @@ static void print_supported_chips_wiki(int cols)
t = f->tested;
s = flashbuses_to_text(f->bustype);
printf("|- bgcolor=\"#%s\"\n| %s || %s || %d "
"|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}\n",
sprintf(vmin, "%0.03f", f->voltage.min / (double)1000);
sprintf(vmax, "%0.03f", f->voltage.max / (double)1000);
/* '{{%s}}' is used in combination with 'OK', 'No' and '?3' to
* select special formatting templates for the bg color. */
printf("|- bgcolor=\"#%s\"\n| %s || %s || align=\"right\" | %d "
"|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}"
"|| %s || %s \n",
(c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name,
f->total_size, s,
(t & TEST_OK_PROBE) ? "OK" :
......@@ -238,7 +253,9 @@ static void print_supported_chips_wiki(int cols)
(t & TEST_OK_ERASE) ? "OK" :
(t & TEST_BAD_ERASE) ? "No" : "?3",
(t & TEST_OK_WRITE) ? "OK" :
(t & TEST_BAD_WRITE) ? "No" : "?3");
(t & TEST_BAD_WRITE) ? "No" : "?3",
f->voltage.min ? vmin : "N/A",
f->voltage.min ? vmax : "N/A");
free(s);
/* Split table into 'cols' columns. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment