2 * This file is part of the LinuxBIOS project.
4 * Copyright (C) 2006 AMD
5 * Written by Yinghai Lu <yinghailu@amd.com> for AMD.
7 * Copyright (C) 2006 MSI
8 * Written by Bingxun Shi <bingxunshi@gmail.com> for MSI.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #include <device/pci_def.h>
28 #include <device/pci_ids.h>
30 #include <arch/romcc_io.h>
31 #include <cpu/x86/lapic.h>
32 #include "pc80/mc146818rtc_early.c"
34 #include "southbridge/nvidia/mcp55/mcp55_enable_rom.c"
35 #include "northbridge/amd/amdk8/early_ht.c"
36 #include "cpu/x86/lapic/boot_cpu.c"
37 #include "cpu/x86/mtrr/earlymtrr.c"
38 #include "northbridge/amd/amdk8/reset_test.c"
40 static void sio_setup(void)
47 byte = pci_read_config32(PCI_DEV(0, MCP55_DEVN_BASE+1 , 0), 0x7b);
49 pci_write_config8(PCI_DEV(0, MCP55_DEVN_BASE+1 , 0), 0x7b, byte);
51 dword = pci_read_config32(PCI_DEV(0, MCP55_DEVN_BASE+1 , 0), 0xa0);
53 pci_write_config32(PCI_DEV(0, MCP55_DEVN_BASE+1 , 0), 0xa0, dword);
58 #if CONFIG_LOGICAL_CPUS==1
59 #include "cpu/amd/dualcore/dualcore_id.c"
62 static unsigned long main(unsigned long bist)
64 /* Make cerain my local apic is useable */
67 /* Is this a cpu only reset? */
68 if (early_mtrr_init_detected()) {
69 if (last_boot_normal()) {
76 /* Is this a secondary cpu? */
78 if (last_boot_normal()) {
85 /* Nothing special needs to be done to find bus 0 */
86 /* Allow the HT devices to be found */
95 /* Is this a deliberate reset by the bios */
96 if (bios_reset_detected() && last_boot_normal()) {
99 /* This is the primary cpu how should I boot? */
100 else if (do_normal_boot()) {
107 asm volatile ("jmp __normal_image"
109 : "a" (bist) /* inputs */