a3c1f20af055ea290c935fdaefea1482329a7b44
[coreboot.git] / src / mainboard / ecs / p6iwp-fe / romstage.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
5  * Copyright (C) 2010 Anders Jenbo <anders@jenbo.dk>
6  *
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.
11  *
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.
16  *
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
20  */
21
22 #include <stdint.h>
23 #include <stdlib.h>
24 #include <device/pci_def.h>
25 #include <arch/io.h>
26 #include <device/pnp_def.h>
27 #include <arch/hlt.h>
28 #include <console/console.h>
29 #include "southbridge/intel/i82801ax/i82801ax.h"
30 #include "northbridge/intel/i82810/raminit.h"
31 #include "pc80/udelay_io.c"
32 #include "cpu/x86/bist.h"
33 #include "superio/ite/it8712f/it8712f_early_serial.c"
34 #include <lib.h>
35
36 void enable_smbus(void);
37 int smbus_read_byte(u8 device, u8 address);
38
39 void main(unsigned long bist)
40 {
41         it8712f_24mhz_clkin();
42         it8712f_enable_serial(0, CONFIG_TTYS0_BASE); // Does not use its 1st parameter
43         uart_init();
44         console_init();
45         report_bist_failure(bist);
46         enable_smbus();
47         dump_spd_registers();
48         sdram_set_registers();
49         sdram_set_spd_registers();
50         sdram_enable();
51         dump_spd_registers();
52 }