2 * This file is part of the coreboot project.
4 * Copyright (C) 2008 Joseph Smith <joe@settoplinux.org>
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #include <device/pci_def.h>
27 #include <device/pnp_def.h>
28 #include <arch/romcc_io.h>
30 #include "pc80/serial.c"
31 #include "pc80/udelay_io.c"
32 #include "arch/i386/lib/console.c"
33 #include "ram/ramtest.c"
34 #include "superio/smsc/smscsuperio/smscsuperio_early_serial.c"
35 #include "northbridge/intel/i82830/raminit.h"
36 #include "northbridge/intel/i82830/memory_initialized.c"
37 #include "southbridge/intel/i82801xx/i82801xx.h"
38 #include "southbridge/intel/i82801xx/i82801xx_reset.c"
39 #include "cpu/x86/mtrr/earlymtrr.c"
40 #include "cpu/x86/bist.h"
41 #include "spd_table.h"
44 #define SERIAL_DEV PNP_DEV(0x2e, SMSCSUPERIO_SP1)
46 #include "southbridge/intel/i82801xx/i82801xx_early_smbus.c"
47 #include "southbridge/intel/i82801xx/i82801xx_early_lpc.c"
50 * The onboard 64MB PC133 memory does not have a SPD EEPROM so the
51 * values have to be set manually, the SO-DIMM socket is located in
52 * socket0 (0x50), and the onboard memory is located in socket1 (0x51).
54 static inline int spd_read_byte(unsigned device, unsigned address)
59 return smbus_read_byte(device, address);
60 } else if (device == 0x51) {
61 for (i = 0; i < ARRAY_SIZE(spd_table); i++) {
62 if (spd_table[i].address == address)
63 return spd_table[i].data;
65 return 0xFF; /* Return 0xFF when address is not found. */
67 return 0xFF; /* Return 0xFF on any failures. */
71 #include "northbridge/intel/i82830/raminit.c"
72 #include "sdram/generic_sdram.c"
75 * The AC'97 Audio Controller I/O space registers are read only by default
76 * so we need to enable them by setting register 0x41 to 0x01.
78 static void ac97_io_enable(void)
82 /* Set the ac97 audio device staticly. */
83 dev = PCI_DEV(0x0, 0x1f, 0x5);
85 /* Enable access to the IO space. */
86 pci_write_config8(dev, 0x41, 0x01);
89 static void main(unsigned long bist)
91 static const struct mem_controller memctrl[] = {
93 .d0 = PCI_DEV(0, 0, 0),
94 .channel0 = {0x50, 0x51},
100 if (memory_initialized()) {
104 smscsuperio_enable_serial(SERIAL_DEV, TTYS0_BASE);
111 /* Prevent the TCO timer from rebooting us */
112 i82801xx_halt_tco_timer();
114 /* Halt if there was a built in self test failure. */
115 report_bist_failure(bist);
117 sdram_set_registers(memctrl);
118 sdram_set_spd_registers(memctrl);
119 sdram_enable(0, memctrl);
122 /* ram_check(0, 640 * 1024); */
123 /* ram_check(64512 * 1024, 65536 * 1024); */