a75d60f07a2d74c591d1daf2c57126baf40fa543
[coreboot.git] / src / mainboard / digitallogic / adl855pc / romstage.c
1 #include <stdint.h>
2 #include <device/pci_def.h>
3 #include <arch/io.h>
4 #include <device/pnp_def.h>
5 #include <arch/romcc_io.h>
6 #include <arch/hlt.h>
7 #include <stdlib.h>
8 #include <lib.h>
9 #include "pc80/udelay_io.c"
10 #include <pc80/mc146818rtc.h>
11 #include <console/console.h>
12 #include "southbridge/intel/i82801dx/i82801dx.h"
13 #include "southbridge/intel/i82801dx/i82801dx_early_smbus.c"
14 #include "northbridge/intel/i855/raminit.h"
15 #include "northbridge/intel/i855/debug.c"
16 #include "superio/winbond/w83627hf/w83627hf_early_serial.c"
17 #include "cpu/x86/mtrr/earlymtrr.c"
18 #include "cpu/x86/bist.h"
19 #include <spd.h>
20
21 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
22
23 static inline int spd_read_byte(unsigned device, unsigned address)
24 {
25         return smbus_read_byte(device, address);
26 }
27
28 #include "northbridge/intel/i855/raminit.c"
29 #include "northbridge/intel/i855/reset_test.c"
30
31 void main(unsigned long bist)
32 {
33         if (bist == 0) {
34 #if 0
35                 enable_lapic();
36                 init_timer();
37 #endif
38         }
39
40         w83627hf_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
41         uart_init();
42         console_init();
43
44         /* Halt if there was a built in self test failure */
45         report_bist_failure(bist);
46
47 #if 0
48         print_pci_devices();
49 #endif
50
51         if (!bios_reset_detected()) {
52                 enable_smbus();
53 #if 0
54                 dump_spd_registers();
55                 dump_smbus_registers();
56 #endif
57                 sdram_set_registers();
58                 sdram_set_spd_registers();
59                 sdram_enable();
60         }
61
62 #if 0
63         dump_pci_devices();
64         dump_pci_device(PCI_DEV(0, 0, 0));
65
66         // Check all of memory
67         ram_check(0x00000000, msr.lo+(msr.hi<<32));
68         // Check 16MB of memory @ 0
69         ram_check(0x00000000, 0x01000000);
70         // Check 16MB of memory @ 2GB
71         ram_check(0x80000000, 0x81000000);
72 #endif
73 }