[coreboot] [LinuxBIOS] adding "--list-supported" feature to superiotool #91

Uwe Hermann uwe at hermann-uwe.de
Sun Jan 13 02:57:05 CET 2008


On Sat, Jan 12, 2008 at 05:46:38PM -0500, Robinson Tryon wrote:
> On the wiki page it looked like there were links to several mailing
> list posts -- those emails probably contained the dumps for each chip.

Yes.


> Should that information be included in the data section of each vendor
> file?  If so, should there be a new field in the superio_registers
> STRUCT to handle that?

Not sure I understand what you mean, but I think the answer is no.
_One_ link to http://coreboot.org/Superiotool#Supported_devices
is more than enough. I don't think it makes sense to have an extra
wiki page for each chip or an extra link for each chip in the
--list-supported output, if that's what you mean.

 
> Actually, here's another question for you:
> Why is all of the data for superiotool stored in arrays terminated
> with EOT?  Can't we just use ARRAY_SIZE (or some similar construct) to
> figure out the length of a given array before we iterate over it?

Not all entries have the same length. Using the EOT method is nice, IMO.


> > Also - isn't the vendor inclued in the reg_table? Why is it needed at
> > all in this function? Sorry if I'm being slow.
> 
> I don't believe that the vendor name is included in the reg_table --
> just the chip id, chip name, and registers, right?

Yep.
 
 
> Here's the updated patch.  Let me know how the dump URLs should be
> stored, and I'll add support for that as well.

Not needed. One link to http://coreboot.org/Superiotool#Supported_devices
at the bottom of the output or so should be enough.

 
> +/* Print information about a specific chip. */
> +void print_chip(const struct superio_registers reg) {
> +	printf("    %s", reg.name);

I'd make this function take a "const char *vendor" as argument and
print the vendor in each line, without indentation. I find that format
looks more readable (and is probably easier to parse/grep/sed if we ever
want that). Example output from a quick test I did:

Fintek F71862FG
Fintek F71872F/FG / F71806F/FG
Fintek F71882FG/F71883FG
Fintek F71805F/FG (dump)

ITE IT8661F (dump)
ITE IT8702F
ITE IT8705F/AF / IT8700F (dump)
ITE IT8706R
ITE IT8708F (dump)
ITE IT8710F
ITE IT8712F (dump)
ITE IT8716F (dump)
ITE IT8718F (dump)
ITE IT8726F

NSC PC97307 (dump)
NSC PC87317 (dump)
NSC PC97317 (dump)
NSC PC87309 (dump)
NSC PC87360 (dump)
NSC PC87351 (dump)
NSC PC87364
NSC PC87365
NSC PC87363
NSC PC87366 (dump)
NSC PC8739x
NSC PC87591x
NSC PC8741x (dump)
NSC PC87372
NSC PC8374L (dump)
NSC PC87427
NSC PC87373

SMSC FDC37C93xFR
SMSC FDC37N971
SMSC FDC37N972
SMSC LPC47N252
[...]


> +	/* Unless the ldn is empty, assume this chip has a dump. */
> +	if(reg.ldn[0].ldn != EOT)
> +		printf(" (dump)");

"dump available" is probably a bit clearer.


> +	printf("\n");
> +}
> +
> +/* Print a list of all supported chips from the given vendor. */
> +void print_vendor_chips(const char *vendor,
> +			const struct superio_registers reg_table[]) {	
> +	int i;
> +	
> +	printf("  Chips from %s:\n", vendor);
> +	
> +	for (i = 0; reg_table[i].superio_id != EOT; i++) {
> +		print_chip(reg_table[i]);
> +	}
> +
> +	if (i == 0)
> +		printf("    None.\n");
> +}
> +
> +/* Print a list of all chips supported by superiotool. */
> +void print_list_of_supported_chips(void)
> +{
> +	int i;
> +	
> +	printf("Supported Super I/O Chips:\n");


> +	printf("  Notes:\n");
> +	printf("  - See http://linuxbios.org/Superiotool for more information.\n");
> +	printf("  - Chips with (dump) after them have support for dumping registers.\n");
> +	printf("\n");

I'd drop these (4) lines here (maybe add them in the manpage).


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org




More information about the coreboot mailing list