cpu/amd/fam10h-fam15h: Correctly create APIC ID on single node systems

The existing code generated an incorrect boot APIC ID from node and
core number for single node packages, leading to a boot failure when
the second node was installed.

Properly generate the boot APIC ID from node and core number.

Change-Id: I7a00e216a6841c527b0a016fa07befb42162414a
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: https://review.coreboot.org/13149
Tested-by: build bot (Jenkins)
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Timothy Pearson 2015-11-24 14:11:53 -06:00 committed by Martin Roth
parent 9253ce60c4
commit 71f864191f
2 changed files with 8 additions and 2 deletions

View File

@ -127,13 +127,17 @@ uint32_t get_boot_apic_id(uint8_t node, uint32_t core) {
} }
} else { } else {
if (fam15h) { if (fam15h) {
ap_apicid = (node * (siblings + 1)) + core; ap_apicid = 0;
ap_apicid |= (node & 0x7) << 4; /* Node ID */
ap_apicid |= core & 0xf; /* Core ID */
} else { } else {
ap_apicid = node * (nb_cfg_54 ? (siblings + 1) : 1) + ap_apicid = node * (nb_cfg_54 ? (siblings + 1) : 1) +
core * (nb_cfg_54 ? 1 : 64); core * (nb_cfg_54 ? 1 : 64);
} }
} }
printk(BIOS_DEBUG, "%s: using %d as APIC ID for node %d, core %d\n", __func__, ap_apicid, node, core);
return ap_apicid; return ap_apicid;
} }

View File

@ -1637,7 +1637,9 @@ static void cpu_bus_scan(device_t dev)
} }
} else { } else {
if (fam15h) { if (fam15h) {
apic_id = (i * (siblings + 1)) + j; apic_id = 0;
apic_id |= (i & 0x7) << 4; /* Node ID */
apic_id |= j & 0xf; /* Core ID */
} else { } else {
apic_id = i * (nb_cfg_54?(siblings+1):1) + j * (nb_cfg_54?1:64); // ? apic_id = i * (nb_cfg_54?(siblings+1):1) + j * (nb_cfg_54?1:64); // ?
} }