blob: 5bcee0c544271a91af9cf7a8564a2490aa99077d [file] [log] [blame]
Joseph Smithb94a79f2010-06-21 23:25:06 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 Joseph Smith <joe@settoplinux.org>
5 *
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Joseph Smithb94a79f2010-06-21 23:25:06 +000015 */
16
17#include <stdint.h>
18#include <stdlib.h>
19#include <device/pci_def.h>
20#include <arch/io.h>
21#include <device/pnp_def.h>
Joseph Smithb94a79f2010-06-21 23:25:06 +000022#include <console/console.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +110023#include <southbridge/intel/i82801bx/i82801bx.h>
24#include <northbridge/intel/i82810/raminit.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +110025#include <cpu/x86/bist.h>
Kyösti Mälkki07921540d2016-06-17 17:22:00 +030026#include <cpu/intel/romstage.h>
Edward O'Callaghanfdceb482014-06-02 07:58:14 +100027#include <superio/smsc/smscsuperio/smscsuperio.h>
Joseph Smithb94a79f2010-06-21 23:25:06 +000028#include "gpio.c"
Patrick Georgid0835952010-10-05 09:07:10 +000029#include <lib.h>
Joseph Smithb94a79f2010-06-21 23:25:06 +000030
31#define SERIAL_DEV PNP_DEV(0x4e, SMSCSUPERIO_SP1)
32
Kyösti Mälkki07921540d2016-06-17 17:22:00 +030033void mainboard_romstage_entry(unsigned long bist)
Joseph Smithb94a79f2010-06-21 23:25:06 +000034{
Uwe Hermannab50d622010-10-13 08:21:44 +000035 /* Set southbridge and Super I/O GPIOs. */
Joseph Smithb94a79f2010-06-21 23:25:06 +000036 mb_gpio_init();
37
38 smscsuperio_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
Joseph Smithb94a79f2010-06-21 23:25:06 +000039 console_init();
40
41 report_bist_failure(bist);
42 enable_smbus();
Uwe Hermann212d0a22010-10-13 23:00:41 +000043 dump_spd_registers();
Joseph Smithb94a79f2010-06-21 23:25:06 +000044 sdram_set_registers();
45 sdram_set_spd_registers();
46 sdram_enable();
Joseph Smithb94a79f2010-06-21 23:25:06 +000047}