*/
#include "defaults.h"
+#include <stdlib.h>
+#include <cpu/x86/lapic.h>
+#include <cpu/x86/mtrr.h>
+#include <northbridge/amd/amdfam10/amdfam10.h>
+#include <northbridge/amd/amdht/AsPsDefs.h>
+#include <northbridge/amd/amdht/porting.h>
+
+#include <cpu/x86/mtrr/earlymtrr.c>
+#include <northbridge/amd/amdfam10/raminit_amdmct.c>
//it takes the CONFIG_ENABLE_APIC_EXT_ID and CONFIG_APIC_ID_OFFSET and CONFIG_LIFT_BSP_APIC_ID
#ifndef SET_FIDVID
#define SET_FIDVID_CORE0_ONLY 0
#endif
-void update_microcode(u32 cpu_deviceid);
static void prep_fid_change(void);
static void init_fidvid_stage2(u32 apicid, u32 nodeid);
void cpuSetAMDMSR(void);
/* get_nodes define in ht_wrapper.c */
nodes = get_nodes();
- disable_siblings = !CONFIG_LOGICAL_CPUS;
-
-#if CONFIG_LOGICAL_CPUS == 1 && CONFIG_HAVE_OPTION_TABLE == 1
- if (read_option(CMOS_VSTART_multi_core, CMOS_VLEN_multi_core, 0) != 0) { // 0 mean multi core
+ if (!CONFIG_LOGICAL_CPUS ||
+ read_option(CMOS_VSTART_multi_core, CMOS_VLEN_multi_core, 0) != 0) { // 0 means multi core
disable_siblings = 1;
+ } else {
+ disable_siblings = 0;
}
-#endif
/* Assume that all node are same stepping, otherwise we can use use
nb_cfg_54 from bsp for all nodes */
}
}
-static void wait_all_other_cores_started(u32 bsp_apicid)
+void wait_all_other_cores_started(u32 bsp_apicid)
{
// all aps other than core0
printk(BIOS_DEBUG, "started ap apicid: ");
printk(BIOS_DEBUG, "\n");
}
-static void allow_all_aps_stop(u32 bsp_apicid)
+void allow_all_aps_stop(u32 bsp_apicid)
{
/* Called by the BSP to indicate AP can stop */
- /* FIXME Do APs use this?
- Looks like wait_till_sysinfo_in_ram is used instead. */
+ /* FIXME Do APs use this? */
// allow aps to stop use 6 bits for state
lapic_write(LAPIC_MSG_REG, (bsp_apicid << 24) | 0x14);
}
#endif
- /* AP is ready, Wait for the BSP to get memory configured */
- /* FIXME: many cores spinning on node0 pci register seems to be bad.
- * Why do we need to wait? These APs are just going to go sit in a hlt.
- */
- //wait_till_sysinfo_in_ram();
-
+ /* AP is ready, configure MTRRs and go to sleep */
set_var_mtrr(0, 0x00000000, CONFIG_RAMTOP, MTRR_TYPE_WRBACK);
STOP_CAR_AND_CPU();
+
printk(BIOS_DEBUG,
"\nAP %02x should be halted but you are reading this....\n",
apicid);
return htic;
}
-static void wait_all_core0_started(void)
+void wait_all_core0_started(void)
{
/* When core0 is started, it will distingush_cpu_resets
* So wait for that to finish */
/* HT Phy settings either apply to both sublinks or have
* separate registers for sublink zero and one, so there
* will be two table entries. So, here we only loop
- cd t * through the sublink zeros in function zero.
+ * through the sublink zeros in function zero.
*/
for (j = 0; j < 4; j++) {
if (AMD_CpuFindCapability(node, j, &offset)) {
printk(BIOS_DEBUG, " done\n");
}
+#ifdef UNUSED_CODE
static void cpuInitializeMCA(void)
{
/* Clears Machine Check Architecture (MCA) registers, which power on
}
}
}
+#endif
/**
* finalize_node_setup()
}
#endif
}
+
+#include "fidvid.c"