diff options
author | arch <arch@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2005-07-06 17:13:46 +0000 |
---|---|---|
committer | arch <arch@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2005-07-06 17:13:46 +0000 |
commit | 3ab34217cd50ec64f572cf6ae4fddbde39f610ae (patch) | |
tree | 73c9bd186b7d9a907406b687552e70ab74cd4922 /flash_enable.c | |
parent | 1d0f00437fa8cd1cdec904b6ac35f415eaca92bd (diff) | |
download | flashrom-3ab34217cd50ec64f572cf6ae4fddbde39f610ae.tar.gz |
Original v2 revision: 1946
Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-30
Creator: Yinghai Lu <yhlu@tyan.com>
Nvidia Ck804 support
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@32 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'flash_enable.c')
-rw-r--r-- | flash_enable.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/flash_enable.c b/flash_enable.c index 6a78434..19fd9b0 100644 --- a/flash_enable.c +++ b/flash_enable.c @@ -249,6 +249,41 @@ static int enable_flash_amd8111(struct pci_dev *dev, char *name) return 0; } +//By yhlu +static int enable_flash_ck804(struct pci_dev *dev, char *name) +{ + /* register 4e.b gets or'ed with one */ + unsigned char old, new; + /* if it fails, it fails. There are so many variations of broken mobos + * that it is hard to argue that we should quit at this point. + */ + + //dump_pci_device(dev); + + old = pci_read_byte(dev, 0x88); + new = old | 0xc0; + if (new != old) { + pci_write_byte(dev, 0x88, new); + if (pci_read_byte(dev, 0x88) != new) { + printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", + 0x88, new, name); + } + } + + old = pci_read_byte(dev, 0x6d); + new = old | 0x01; + if (new == old) + return 0; + pci_write_byte(dev, 0x6d, new); + + if (pci_read_byte(dev, 0x6d) != new) { + printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", + 0x6d, new, name); + return -1; + } + return 0; +} + typedef struct penable { unsigned short vendor, device; char *name; @@ -265,6 +300,9 @@ static FLASH_ENABLE enables[] = { {0x100b, 0x0510, "SC1100", enable_flash_sc1100}, {0x1039, 0x0008, "SIS5595", enable_flash_sis5595}, {0x1022, 0x7468, "AMD8111", enable_flash_amd8111}, + {0x10de, 0x0050, "NVIDIA CK804", enable_flash_ck804}, // LPC + {0x10de, 0x0051, "NVIDIA CK804", enable_flash_ck804}, // Pro + {0x10de, 0x00d3, "NVIDIA CK804", enable_flash_ck804}, // Slave, should not be here, to fix known bug for A01. }; int enable_flash_write() |