2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 AMD
5 * Written by Yinghai Lu <yinghailu@amd.com> for AMD.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #define K8_REV_F_SUPPORT_F0_F1_WORKAROUND 0
25 #include <device/pci_def.h>
26 #include <device/pci_ids.h>
28 #include <device/pnp_def.h>
29 #include <arch/romcc_io.h>
30 #include <cpu/x86/lapic.h>
31 #include <pc80/mc146818rtc.h>
33 #include "console/console.c"
34 #include "lib/uart8250.c"
35 #include "console/vtxprintf.c"
36 #include "./arch/x86/lib/printk_init.c"
38 #include <cpu/amd/model_fxx_rev.h>
39 #include "northbridge/amd/amdk8/raminit.h"
40 #include "cpu/amd/model_fxx/apic_timer.c"
42 #include "lib/delay.c"
44 //#include "cpu/x86/lapic/boot_cpu.c"
45 #include "northbridge/amd/amdk8/reset_test.c"
47 #include "northbridge/amd/amdk8/debug.c"
49 #include "southbridge/nvidia/mcp55/mcp55_early_ctrl.c"
51 #include "northbridge/amd/amdk8/amdk8_f.h"
53 #include "cpu/x86/mtrr.h"
54 #include "cpu/amd/mtrr.h"
55 #include "cpu/x86/tsc.h"
57 #include "northbridge/amd/amdk8/amdk8_f_pci.c"
58 #include "northbridge/amd/amdk8/raminit_f_dqs.c"
60 static inline unsigned get_nodes(void)
62 return ((pci_read_config32(PCI_DEV(0, 0x18, 0), 0x60)>>4) & 7) + 1;
65 #include "cpu/amd/dualcore/dualcore.c"
67 void hardwaremain(int ret_addr)
69 struct sys_info *sysinfo = (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - CONFIG_DCACHE_RAM_GLOBAL_VAR_SIZE); // in CACHE
70 struct sys_info *sysinfox = ((CONFIG_RAMTOP) - CONFIG_DCACHE_RAM_GLOBAL_VAR_SIZE); // in RAM
72 struct node_core_id id;
74 id = get_node_core_id_x();
76 print_debug("CODE IN CACHE ON NODE:"); print_debug_hex8(id.nodeid); print_debug("\n");
78 train_ram(id.nodeid, sysinfo, sysinfox);
81 * go back, but can not use stack any more, because we only keep ret_addr and can not restore esp, and ebp
91 #include <arch/registers.h>
93 void x86_exception(struct eregs *info)