summaryrefslogtreecommitdiff
path: root/src/cpu/amd/dualcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/amd/dualcore')
-rw-r--r--src/cpu/amd/dualcore/amd_sibling.c10
-rw-r--r--src/cpu/amd/dualcore/dualcore.c2
-rw-r--r--src/cpu/amd/dualcore/dualcore_id.c10
3 files changed, 18 insertions, 4 deletions
diff --git a/src/cpu/amd/dualcore/amd_sibling.c b/src/cpu/amd/dualcore/amd_sibling.c
index f961f50b2c..3bd604a79f 100644
--- a/src/cpu/amd/dualcore/amd_sibling.c
+++ b/src/cpu/amd/dualcore/amd_sibling.c
@@ -11,6 +11,7 @@
#include <cpu/x86/mtrr.h>
#include <cpu/amd/model_fxx_msr.h>
#include <cpu/amd/model_fxx_rev.h>
+#include <cpu/amd/amdk8_sysconf.h>
static int first_time = 1;
static int disable_siblings = !CONFIG_LOGICAL_CPUS;
@@ -168,6 +169,15 @@ void amd_sibling_init(device_t cpu)
/* Build the cpu device path */
cpu_path.type = DEVICE_PATH_APIC;
cpu_path.u.apic.apic_id = cpu->path.u.apic.apic_id + i * (nb_cfg_54?1:8);
+ if(id.nodeid == 0) {
+ // need some special processing, because may the bsp is not lifted, but the core1 is lifted
+ //defined in northbridge.c
+ if(sysconf.enabled_apic_ext_id && (!sysconf.lift_bsp_apicid)) {
+ cpu->path.u.apic.apic_id += sysconf.apicid_offset;
+ }
+
+ }
+
/* See if I can find the cpu */
new = find_dev_path(cpu->bus, &cpu_path);
diff --git a/src/cpu/amd/dualcore/dualcore.c b/src/cpu/amd/dualcore/dualcore.c
index e2158424e6..51ef6034f7 100644
--- a/src/cpu/amd/dualcore/dualcore.c
+++ b/src/cpu/amd/dualcore/dualcore.c
@@ -19,7 +19,9 @@ static inline unsigned get_core_num_in_bsp(unsigned nodeid)
#if SET_NB_CFG_54 == 1
static inline uint8_t set_apicid_cpuid_lo(void)
{
+#if K8_REV_F_SUPPORT == 0
if(is_cpu_pre_e0()) return 0; // pre_e0 can not be set
+#endif
// set the NB_CFG[54]=1; why the OS will be happy with that ???
msr_t msr;
diff --git a/src/cpu/amd/dualcore/dualcore_id.c b/src/cpu/amd/dualcore/dualcore_id.c
index 389969795b..c8c8d8d443 100644
--- a/src/cpu/amd/dualcore/dualcore_id.c
+++ b/src/cpu/amd/dualcore/dualcore_id.c
@@ -20,6 +20,8 @@ static inline unsigned get_initial_apicid(void)
}
//called by amd_siblings too
+#define CORE_ID_BIT 1
+#define NODE_ID_BIT 3
struct node_core_id get_node_core_id(unsigned nb_cfg_54)
{
struct node_core_id id;
@@ -27,15 +29,15 @@ struct node_core_id get_node_core_id(unsigned nb_cfg_54)
if( nb_cfg_54) {
// when NB_CFG[54] is set, nodeid = ebx[27:25], coreid = ebx[24]
id.coreid = (cpuid_ebx(1) >> 24) & 0xf;
- id.nodeid = (id.coreid>>1);
- id.coreid &= 1;
+ id.nodeid = (id.coreid>>CORE_ID_BIT);
+ id.coreid &= ((1<<CORE_ID_BIT)-1);
}
else
{
// when NB_CFG[54] is clear, nodeid = ebx[26:24], coreid = ebx[27]
id.nodeid = (cpuid_ebx(1) >> 24) & 0xf;
- id.coreid = (id.nodeid>>3);
- id.nodeid &= 7;
+ id.coreid = (id.nodeid>>NODE_ID_BIT);
+ id.nodeid &= ((1<<NODE_ID_BIT)-1);
}
return id;
}