diff options
author | arch import user (historical) <svn@openbios.org> | 2005-07-06 17:13:46 +0000 |
---|---|---|
committer | arch import user (historical) <svn@openbios.org> | 2005-07-06 17:13:46 +0000 |
commit | 98d0d30f6b8237f888cd44b33292319e3c167a47 (patch) | |
tree | 0571a9e863b7a7749c2e4fd5bda7ec080831a73c /src/northbridge/amd/amdk8/early_ht.c | |
parent | 577f185d382c8130f20f0ee7e8466ed8bbebbacc (diff) | |
download | coreboot-98d0d30f6b8237f888cd44b33292319e3c167a47.tar.xz |
Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-30
Creator: Yinghai Lu <yhlu@tyan.com>
Nvidia Ck804 support
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1946 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/amd/amdk8/early_ht.c')
-rw-r--r-- | src/northbridge/amd/amdk8/early_ht.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/northbridge/amd/amdk8/early_ht.c b/src/northbridge/amd/amdk8/early_ht.c index af9453492b..ab9d4592dd 100644 --- a/src/northbridge/amd/amdk8/early_ht.c +++ b/src/northbridge/amd/amdk8/early_ht.c @@ -7,6 +7,7 @@ static int enumerate_ht_chain(void) */ unsigned next_unitid, last_unitid; int reset_needed = 0; + next_unitid = 1; do { uint32_t id; @@ -16,18 +17,25 @@ static int enumerate_ht_chain(void) id = pci_read_config32(PCI_DEV(0,0,0), PCI_VENDOR_ID); /* If the chain is enumerated quit */ if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) || - (((id >> 16) & 0xffff) == 0xffff) || - (((id >> 16) & 0xffff) == 0x0000)) - { + (((id >> 16) & 0xffff) == 0xffff) || + (((id >> 16) & 0xffff) == 0x0000)) { break; } + +#if CK804_DEVN_BASE==0 + //CK804 workaround: + // CK804 UnitID changes not use + if(id == 0x005e10de) { + break; + } +#endif + hdr_type = pci_read_config8(PCI_DEV(0,0,0), PCI_HEADER_TYPE); pos = 0; hdr_type &= 0x7f; if ((hdr_type == PCI_HEADER_TYPE_NORMAL) || - (hdr_type == PCI_HEADER_TYPE_BRIDGE)) - { + (hdr_type == PCI_HEADER_TYPE_BRIDGE)) { pos = pci_read_config8(PCI_DEV(0,0,0), PCI_CAPABILITY_LIST); } while(pos != 0) { @@ -38,17 +46,22 @@ static int enumerate_ht_chain(void) flags = pci_read_config16(PCI_DEV(0,0,0), pos + PCI_CAP_FLAGS); if ((flags >> 13) == 0) { unsigned count; + flags &= ~0x1f; flags |= next_unitid & 0x1f; count = (flags >> 5) & 0x1f; + pci_write_config16(PCI_DEV(0, 0, 0), pos + PCI_CAP_FLAGS, flags); + next_unitid += count; break; } } pos = pci_read_config8(PCI_DEV(0, 0, 0), pos + PCI_CAP_LIST_NEXT); } - } while((last_unitid != next_unitid) && (next_unitid <= 0x1f)); + } while((last_unitid != next_unitid) && (next_unitid <= 0x1f)); + + return reset_needed; } |