From: Yinghai Lu Date: Fri, 7 Jan 2005 21:12:05 +0000 (+0000) Subject: enable apic ext id to keep bsp using 0 X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=90a04ee5a93c0e99cbc46febf5556be6affef03b;p=coreboot.git enable apic ext id to keep bsp using 0 git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1846 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- diff --git a/src/northbridge/amd/amdk8/coherent_ht.c b/src/northbridge/amd/amdk8/coherent_ht.c index e056f53da..db6ffc812 100644 --- a/src/northbridge/amd/amdk8/coherent_ht.c +++ b/src/northbridge/amd/amdk8/coherent_ht.c @@ -145,7 +145,7 @@ static void enable_apic_ext_id(u8 node) u32 val; val = pci_read_config32(NODE_HT(node), 0x68); - val |= HTTC_APIC_EXT_ID | HTTC_APIC_EXT_BRD_CST ; + val |= (HTTC_APIC_EXT_SPUR | HTTC_APIC_EXT_ID | HTTC_APIC_EXT_BRD_CST); pci_write_config32(NODE_HT(node), 0x68, val); #endif } diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index 5534a1137..16f8919ce 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -712,11 +712,24 @@ static struct device_operations pci_domain_ops = { .ops_pci_bus = &pci_cf8_conf1, }; +#define APIC_ID_OFFSET 0x10 + static unsigned int cpu_bus_scan(device_t dev, unsigned int max) { struct bus *cpu_bus; + device_t dev_mc; int i; - int apic_id_offset = lapicid(); // bsp apicid + int enable_apic_ext_id = 0; + int bsp_apic_id = lapicid(); // bsp apicid + int apic_id_offset = bsp_apic_id; + + dev_mc = dev_find_slot(0, PCI_DEVFN(0x18, 0)); + if(pci_read_config32(dev_mc, 0x68) & ( HTTC_APIC_EXT_ID | HTTC_APIC_EXT_BRD_CST)) { + enable_apic_ext_id = 1; + if(apic_id_offset==0) { //bsp apic id is not changed + apic_id_offset = APIC_ID_OFFSET; + } + } /* Find which cpus are present */ cpu_bus = &dev->link[0]; @@ -751,8 +764,11 @@ static unsigned int cpu_bus_scan(device_t dev, unsigned int max) /* Report what I have done */ if (cpu) { - if(cpu->path.u.apic.apic_idpath.u.apic.apic_id += apic_id_offset; + if(enable_apic_ext_id) { + if(cpu->path.u.apic.apic_idpath.u.apic.apic_id > siblings) || (bsp_apic_id!=0) ) + cpu->path.u.apic.apic_id += apic_id_offset; + } } printk_debug("CPU: %s %s\n", dev_path(cpu), cpu->enabled?"enabled":"disabled");