2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 - 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
24 #include <arch/romcc_io.h>
26 #include <console/console.h>
27 #include <arch/stages.h>
28 #include "cpu/x86/bist.h"
29 #include "cpu/x86/lapic/boot_cpu.c"
30 #include "agesawrapper.h"
31 #include "northbridge/amd/agesa/family10/reset_test.h"
34 #include "superio/nuvoton/wpcm450/wpcm450.h"
35 #include "superio/winbond/w83627dhg/w83627dhg.h"
37 extern void disable_cache_as_ram(void); /* cache_as_ram.inc */
39 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
44 agesawrapper_amdinitmmio();
47 /* Halt if there was a built in self test failure */
49 report_bist_failure(bist);
51 sb7xx_51xx_enable_wideio(0, 0x1600); /* though UARTs are on the NUVOTON BMC */
52 wpcm450_enable_dev(WPCM450_SP1, CONFIG_SIO_PORT, CONFIG_TTYS0_BASE);
53 sb7xx_51xx_disable_wideio(0);
61 printk(BIOS_DEBUG, "BSP Family_Model: %08x \n", val);
62 printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
65 val = agesawrapper_amdinitreset();
67 printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
69 printk(BIOS_DEBUG, "agesawrapper_amdinitreset passed\n");
72 if (!cpu_init_detectedx && boot_cpu()) {
75 * SR5650/5670/5690 RD890 chipset, read pci config space hang at POR,
76 * Disable all Pcie Bridges to work around It.
78 sr56x0_rd890_disable_pcie_bridge();
85 val = agesawrapper_amdinitearly();
87 printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
89 printk(BIOS_DEBUG, "agesawrapper_amdinitearly passed\n");
95 /* Reset for HT, FIDVID, PLL and ucode patch(errata) changes to take affect. */
96 if (!warm_reset_detect(0)) {
97 print_info("...WARM RESET...\n\n\n");
98 distinguish_cpu_resets(0);
100 die("After soft_reset_x - shouldn't see this message!!!\n");
104 val = agesawrapper_amdinitpost();
106 printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
108 printk(BIOS_DEBUG, "agesawrapper_amdinitpost passed\n");
112 val = agesawrapper_amdinitenv();
114 printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
116 printk(BIOS_DEBUG, "agesawrapper_amdinitenv passed\n");
121 print_debug("Disabling cache as ram ");
122 disable_cache_as_ram();
123 print_debug("done\n");
128 /* We will not return, Should never see this message and post code. */
129 print_debug("should not be here -\n");