2 #include <device/pci_def.h>
4 #include <device/pnp_def.h>
5 #include <arch/romcc_io.h>
6 #include <cpu/x86/lapic.h>
9 #include "option_table.h"
10 #include "pc80/mc146818rtc_early.c"
11 #include <console/console.h>
12 #include "lib/ramtest.c"
13 #include "southbridge/intel/i82801cx/i82801cx_early_smbus.c"
14 #include "northbridge/intel/e7501/raminit.h"
15 #include "cpu/x86/lapic/boot_cpu.c"
16 #include "northbridge/intel/e7501/debug.c"
17 #include "superio/smsc/lpc47b272/lpc47b272_early_serial.c"
18 #include "cpu/x86/mtrr/earlymtrr.c"
19 #include "cpu/x86/bist.h"
21 #define SUPERIO_PORT 0x2e
22 #define SERIAL_DEV PNP_DEV(SUPERIO_PORT, LPC47B272_SP1)
24 static void hard_reset(void)
29 static inline int spd_read_byte(unsigned device, unsigned address)
31 return smbus_read_byte(device, address);
34 #include "northbridge/intel/e7501/raminit.c"
35 #include "northbridge/intel/e7501/reset_test.c"
36 #include "lib/generic_sdram.c"
38 // This function MUST appear last (ROMCC limitation)
39 static void main(unsigned long bist)
41 static const struct mem_controller memctrl[] = {
43 .d0 = PCI_DEV(0, 0, 0),
44 .d0f1 = PCI_DEV(0, 0, 1),
45 .channel0 = { (0xa<<3)|0, (0xa<<3)|1, (0xa<<3)|2, 0 },
46 .channel1 = { (0xa<<3)|4, (0xa<<3)|5, (0xa<<3)|6, 0 },
52 // Skip this if there was a built in self test failure
57 // Get the serial port running and print a welcome banner
59 lpc47b272_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
63 // Halt if there was a built in self test failure
64 report_bist_failure(bist);
66 // print_pci_devices();
68 // If this is a warm boot, some initialization can be skipped
70 if (!bios_reset_detected())
73 // dump_spd_registers(&memctrl[0]);
74 // dump_smbus_registers();
75 sdram_initialize(ARRAY_SIZE(memctrl), memctrl);
78 // NOTE: ROMCC dies with an internal compiler error
79 // if the following line is removed.
80 print_debug("SDRAM is up.\n");