Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 1 | /* |
| 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 Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 15 | */ |
| 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 Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 22 | #include <console/console.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame] | 23 | #include <southbridge/intel/i82801bx/i82801bx.h> |
| 24 | #include <northbridge/intel/i82810/raminit.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame] | 25 | #include <cpu/x86/bist.h> |
Kyösti Mälkki | 07921540d | 2016-06-17 17:22:00 +0300 | [diff] [blame] | 26 | #include <cpu/intel/romstage.h> |
Edward O'Callaghan | fdceb48 | 2014-06-02 07:58:14 +1000 | [diff] [blame] | 27 | #include <superio/smsc/smscsuperio/smscsuperio.h> |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 28 | #include "gpio.c" |
Patrick Georgi | d083595 | 2010-10-05 09:07:10 +0000 | [diff] [blame] | 29 | #include <lib.h> |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 30 | |
| 31 | #define SERIAL_DEV PNP_DEV(0x4e, SMSCSUPERIO_SP1) |
| 32 | |
Kyösti Mälkki | 07921540d | 2016-06-17 17:22:00 +0300 | [diff] [blame] | 33 | void mainboard_romstage_entry(unsigned long bist) |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 34 | { |
Uwe Hermann | ab50d62 | 2010-10-13 08:21:44 +0000 | [diff] [blame] | 35 | /* Set southbridge and Super I/O GPIOs. */ |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 36 | mb_gpio_init(); |
| 37 | |
| 38 | smscsuperio_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 39 | console_init(); |
| 40 | |
| 41 | report_bist_failure(bist); |
| 42 | enable_smbus(); |
Uwe Hermann | 212d0a2 | 2010-10-13 23:00:41 +0000 | [diff] [blame] | 43 | dump_spd_registers(); |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 44 | sdram_set_registers(); |
| 45 | sdram_set_spd_registers(); |
| 46 | sdram_enable(); |
Joseph Smith | b94a79f | 2010-06-21 23:25:06 +0000 | [diff] [blame] | 47 | } |