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
25 #define SET_NB_CFG_54 1
29 #define K8_REV_F_SUPPORT_F0_F1_WORKAROUND 0
32 #include <device/pci_def.h>
33 #include <device/pci_ids.h>
35 #include <device/pnp_def.h>
36 #include <arch/romcc_io.h>
37 #include <cpu/x86/lapic.h>
38 #include <pc80/mc146818rtc.h>
39 #include "pc80/serial.c"
41 #include "lib/uart8250.c"
42 #include "arch/i386/lib/printk_init.c"
43 #include "console/vtxprintf.c"
44 #include "console/console.c"
46 #include <cpu/amd/model_fxx_rev.h>
47 #include "northbridge/amd/amdk8/raminit.h"
48 #include "cpu/amd/model_fxx/apic_timer.c"
50 #include "lib/delay.c"
52 //#include "cpu/x86/lapic/boot_cpu.c"
53 #include "northbridge/amd/amdk8/reset_test.c"
55 #include "northbridge/amd/amdk8/debug.c"
57 #include "southbridge/nvidia/mcp55/mcp55_early_ctrl.c"
59 #include "northbridge/amd/amdk8/amdk8_f.h"
61 #include "cpu/x86/mtrr.h"
62 #include "cpu/amd/mtrr.h"
63 #include "cpu/x86/tsc.h"
65 #include "northbridge/amd/amdk8/amdk8_f_pci.c"
66 #include "northbridge/amd/amdk8/raminit_f_dqs.c"
68 #include "cpu/amd/dualcore/dualcore.c"
70 void hardwaremain(int ret_addr)
72 struct sys_info *sysinfo = (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - CONFIG_DCACHE_RAM_GLOBAL_VAR_SIZE); // in CACHE
73 struct sys_info *sysinfox = ((CONFIG_RAMTOP) - CONFIG_DCACHE_RAM_GLOBAL_VAR_SIZE); // in RAM
75 struct node_core_id id;
77 id = get_node_core_id_x();
79 //FIXME: for USBDEBUG you need to make sure dbg_info get assigned in AP
80 print_debug("CODE IN CACHE ON NODE:"); print_debug_hex8(id.nodeid); print_debug("\n");
82 train_ram(id.nodeid, sysinfo, sysinfox);
85 go back, but can not use stack any more, because we only keep ret_addr and can not restore esp, and ebp
98 #include <arch/registers.h>
100 void x86_exception(struct eregs *info)