[coreboot] [tool] inteltool

Peter Stuge peter at stuge.se
Tue May 13 21:35:02 CEST 2008


On Tue, May 13, 2008 at 07:06:01PM +0200, Stefan Reinauer wrote:
> So I joined my utility collection and made one bigger tool out of it:
> inteltool

Great idea.


> I suggest dropping my first attempt in utils/inteltools and take this
> much better utility instead in utils/inteltool.
> 
> Signed-off-by: Stefan Reinauer <stepan at coresystems.de>

I like that suggestion.


> 	io_register_t ich7_gpio_registers[] =  {
> 		{ 0x00, 4, "GPIO_USE_SEL" },
> 		{ 0x04, 4, "GP_IO_SEL" },
> 		{ 0x08, 4, "RESERVED" },
> 		{ 0x0c, 4, "GP_LVL" },
> 		{ 0x10, 4, "RESERVED" },
> 		{ 0x14, 4, "RESERVED" },
> 		{ 0x18, 4, "GPO_BLINK" },
> 		{ 0x1c, 4, "RESERVED" },
> 		{ 0x20, 4, "RESERVED" },
> 		{ 0x24, 4, "RESERVED" },
> 		{ 0x28, 4, "RESERVED" },
> 		{ 0x2c, 4, "GPI_INV" },
> 		{ 0x30, 4, "GPIO_USE_SEL2" },
> 		{ 0x34, 4, "GP_IO_SEL2" },
> 		{ 0x38, 4, "GP_LVL2" },
> 		{ 0x3C, 4, "RESERVED" }
> 	};
..

> 	switch (sb->device_id) {
> 	case 0x27b8: // ICH7
> 		gpiobase = pci_read_word(sb, 0x48) & 0xfffc;
> 		break;
> 	case 0x1234: // Dummy for non-existent functionality
> 		printf("Error: This southbridge does not have GPIOBASE.\n");
> 		return 1;

Maybe device ID #defines would be nice?


> 	case 0x27b8: // ICH7
> 	case 0x27b8: // ICH7
> 	case 0x27a0: // i945
> 	case 0x27a0: // i945
> 	case 0x27a0: // i945
> 	case 0x27a0: // i945
> 	if (sb->vendor_id != 0x8086) {
> 	if (nb->vendor_id != 0x8086) {

These IDs are after all in a few places.


> 	/* Determine names */
> 	switch(nb->device_id) {
> 	case 0x27a0: nbname="i945"; break;
> 	default: nbname="unknown";
> 	}
> 
> 	switch(sb->device_id) {
> 	case 0x27b8: sbname="ICH7"; break;
> 	default: sbname="unknown";
> 	}

I'd prefer to have a table for this, maybe the same one that has
register definitions?


Nice tool!


On Tue, May 13, 2008 at 10:08:16AM -0700, ron minnich wrote:
> I like it. I am afraid to ack because others do better reviews. but
> if it takes too long to get an ack let me know :-)

You could ack with reservation. :)

No ack from me yet, but next time, Gadget!


//Peter




More information about the coreboot mailing list