Hi Ron, I've updated the patch slightly to add a routine to enable flash writes on the epia mainboard with out the need for the seperate setpci command.
Mark
On Friday 28 Feb 2003 22:13, Ronald G. Minnich wrote:
thanks for the patch!
I'll try to get it in today or monday.
ron
--- freebios/util/flash_and_burn/flash_rom.c Fri Feb 28 17:21:37 2003 +++ mod-freebios/util/flash_and_burn/flash_rom.c Sat Mar 1 15:37:40 2003 @@ -146,6 +146,30 @@ return 0; }
+int +enable_flash_epia(struct pci_dev *dev, char *name) { +/* register 40.b gets bit 4 set to enable flash access + * information from README file for epia mainboard + * + * Should I put a check to make sure it only gets set on device 0:11.0 ? + * + */ + unsigned char old, new; + int ok; + + old = pci_read_byte(dev, 0x40); + + new = old | 0x10; + + ok = pci_write_byte(dev, 0x40, new); + if (!ok) { + printf("Failed to set 0x%x to 0x%x on %s and got 0x%x (WARNING ONLY)\n", + old, new, name, ok); + return -1; + } + return 0; +} + struct flashchip * probe_flash(struct flashchip * flash) { int fd_mem; @@ -260,6 +284,7 @@
{0x1, 0x1, "sis630 -- what's the ID?", enable_flash_sis630}, {0x8086, 0x2480, "E7500", enable_flash_e7500}, + {0x1106, 0x8231, "Via EPIA", enable_flash_epia}, };
int @@ -291,7 +316,8 @@ }
/* now do the deed. */ - enable->doit(dev, enable->name); + if ( enable ) + enable->doit(dev, enable->name); return 0; }
Thanks for that too
anyone who has an 'enable write' patch for the flash_rom.c program, I'll take it.
ron