2 * This file is part of the coreboot project.
4 * Copyright (C) 2012 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <device/pci_def.h>
23 #include <device/pci_ids.h>
25 #include <arch/stages.h>
26 #include <device/pnp_def.h>
27 #include <arch/romcc_io.h>
28 #include <cpu/x86/lapic.h>
29 #include <console/console.h>
30 #include <console/loglevel.h>
31 #include "cpu/x86/bist.h"
32 #include "superio/smsc/sch4037/sch4037_early_init.c"
33 #include "superio/smsc/sio1036/sio1036_early_init.c"
34 #include "cpu/x86/lapic/boot_cpu.c"
35 #include "pc80/i8254.c"
36 #include "pc80/i8259.c"
42 #define SERIAL_DEV PNP_DEV(CONFIG_SIO_PORT, SMSCSUPERIO_SP1)
44 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx);
45 u32 agesawrapper_amdinitmmio (void);
46 u32 agesawrapper_amdinitreset (void);
47 u32 agesawrapper_amdinitearly (void);
48 u32 agesawrapper_amdinitenv (void);
49 u32 agesawrapper_amdinitlate (void);
50 u32 agesawrapper_amdinitpost (void);
51 u32 agesawrapper_amdinitmid (void);
55 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
59 if (!cpu_init_detectedx && boot_cpu()) {
63 sch4037_early_init (CONFIG_SIO_PORT);
65 /* Detect SMSC SIO1036 LPC Debug Card status */
66 if (detect_sio1036_chip(0x4E)) {
67 /* Found SMSC SIO1036 LPC Debug Card */
68 sio1036_early_init(0x4E);
76 * SR5650/5670/5690 RD890 chipset, read pci config space hang at POR,
77 * Disable all Pcie Bridges to work around It.
79 sr56x0_rd890_disable_pcie_bridge();
84 val = agesawrapper_amdinitmmio();
86 printk(BIOS_DEBUG, "agesawrapper_amdinitmmio failed: %x \n", val);
88 printk(BIOS_DEBUG, "agesawrapper_amdinitmmio passed\n");
91 /* Halt if there was a built in self test failure */
93 report_bist_failure(bist);
97 printk(BIOS_DEBUG, "BSP Family_Model: %08x \n", val);
98 printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
106 val = agesawrapper_amdinitreset();
108 printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
110 printk(BIOS_DEBUG, "agesawrapper_amdinitreset passed\n");
114 val = agesawrapper_amdinitearly ();
116 printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
118 printk(BIOS_DEBUG, "agesawrapper_amdinitearly passed\n");
128 val = agesawrapper_amdinitpost ();
130 printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
132 printk(BIOS_DEBUG, "agesawrapper_amdinitpost passed\n");
136 val = agesawrapper_amdinitenv ();
138 printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
140 printk(BIOS_DEBUG, "agesawrapper_amdinitenv passed\n");
144 /* Initialize i8259 pic */
148 /* Initialize i8254 timers */
153 print_debug("Disabling cache as ram ");
154 disable_cache_as_ram();
155 print_debug("done\n");
160 post_code(0x45); // Should never see this post code.