From patchwork Tue Mar 23 14:56:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: fam10 patch (offset calculation) Date: Tue, 23 Mar 2010 14:56:16 -0000 From: Maximilian Thuermer X-Patchwork-Id: 1128 Message-Id: <4BA8D690.80308@ziti.uni-heidelberg.de> To: "coreboot@coreboot.org" Sorry this took so long, here's the patch again with a sign off: if (!cap_count) return TRUE; Signed-off-by: Maximilian Thuermer Index: src/cpu/amd/model_10xxx/init_cpus.c =================================================================== --- src/cpu/amd/model_10xxx/init_cpus.c (revision 5256) +++ src/cpu/amd/model_10xxx/init_cpus.c (working copy) @@ -702,29 +702,32 @@ */ BOOL AMD_CpuFindCapability (u8 node, u8 cap_count, u8 *offset) { + u32 reg; u32 val; - + /* get start of CPU HT Host Capabilities */ val = pci_read_config32(NODE_PCI(node, 0), 0x34); - val &= 0xFF; + val &= 0xFF; //reg offset of first link cap_count++; /* Traverse through the capabilities. */ do { - val = pci_read_config32(NODE_PCI(node, 0), val); + reg = pci_read_config32(NODE_PCI(node, 0), val); /* Is the capability block a HyperTransport capability block? */ - if ((val & 0xFF) == 0x08) { + if ((reg & 0xFF) == 0x08) { /* Is the HT capability block an HT Host Capability? */ - if ((val & 0xE0000000) == (1 << 29)) + if ((reg & 0xE0000000) == (1 << 29)) cap_count--; } - if (cap_count) - val = (val >> 8) & 0xFF; + + if(cap_count) + val = (reg >> 8) & 0xFF; //update reg offset } while (cap_count && val); *offset = (u8) val; + /* If requested capability found val != 0 */