diff options
author | Ronald G. Minnich <rminnich@gmail.com> | 2003-05-08 19:33:19 +0000 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2003-05-08 19:33:19 +0000 |
commit | 7bd1dee5b3d8c4ae687bb3a24c7a10867210fb5d (patch) | |
tree | baba7b06afabbcd0f40e0dad298271ae2f0b70e2 /flash_rom.c | |
parent | b9d27708a76d98be70f70954884eb484ef1b07bc (diff) | |
download | ast2050-flashrom-7bd1dee5b3d8c4ae687bb3a24c7a10867210fb5d.zip ast2050-flashrom-7bd1dee5b3d8c4ae687bb3a24c7a10867210fb5d.tar.gz |
Fix for sis 5595
Corresponding to coreboot v1 svn r805.
Diffstat (limited to 'flash_rom.c')
-rw-r--r-- | flash_rom.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/flash_rom.c b/flash_rom.c index d80db6c..59d8197 100644 --- a/flash_rom.c +++ b/flash_rom.c @@ -188,6 +188,29 @@ enable_flash_cs5530(struct pci_dev *dev, char *name) { return 0; } +int +enable_flash_sis5595(struct pci_dev *dev, char *name) { + unsigned char new, newer; + + new = pci_read_byte(dev, 0x45); + + /* clear bit 5 */ + new &= (~ 0x20); + /* set bit 2 */ + new |= 0x4; + + pci_write_byte(dev, 0x45, new); + + newer = pci_read_byte(dev, 0x45); + if (newer != new) { + printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n", + 0x45, new, name); + printf("Stuck at 0x%x\n", newer); + return -1; + } + return 0; +} + struct flashchip * probe_flash(struct flashchip * flash) { int fd_mem; @@ -303,6 +326,7 @@ FLASH_ENABLE enables[] = { {0x8086, 0x2480, "E7500", enable_flash_e7500}, {0x1106, 0x8231, "VT8231", enable_flash_vt8231}, {0x1078, 0x0100, "CS5530", enable_flash_cs5530}, + {0x1039, 0x8, "SIS5595", enable_flash_sis5595}, }; int |