run uart_init() from console_init, just like the other console initialization functions.
[coreboot.git] / src / mainboard / tyan / s2735 / romstage.c
1 #include <stdint.h>
2 #include <string.h>
3 #include <device/pci_def.h>
4 #include <arch/io.h>
5 #include <device/pnp_def.h>
6 #include <arch/romcc_io.h>
7 #include <cpu/x86/lapic.h>
8 #include <pc80/mc146818rtc.h>
9 #include <console/console.h>
10 #include <lib.h>
11 #include <spd.h>
12 #include "southbridge/intel/i82801ex/early_smbus.c"
13 #include "northbridge/intel/e7501/raminit.h"
14 #include "northbridge/intel/e7501/debug.c"
15 #include "superio/winbond/w83627hf/early_serial.c"
16 #include "cpu/x86/bist.h"
17
18 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
19
20 // FIXME: There's another hard_reset() in reset.c. Why?
21 static void hard_reset(void)
22 {
23         /* full reset */
24         outb(0x0a, 0x0cf9);
25         outb(0x0e, 0x0cf9);
26 }
27
28 static inline int spd_read_byte(unsigned device, unsigned address)
29 {
30         return smbus_read_byte(device, address);
31 }
32
33 #include "northbridge/intel/e7501/raminit.c"
34 #include "northbridge/intel/e7501/reset_test.c"
35 #include "lib/generic_sdram.c"
36
37 void main(unsigned long bist)
38 {
39         static const struct mem_controller memctrl[] = {
40                 {
41                         .d0 = PCI_DEV(0, 0, 0),
42                         .d0f1 = PCI_DEV(0, 0, 1),
43                         .channel0 = { DIMM0, DIMM1, DIMM2, 0 },
44                         .channel1 = { DIMM4, DIMM5, DIMM6, 0 },
45                 },
46         };
47
48         if (bist == 0)
49                 enable_lapic();
50
51         w83627hf_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
52         console_init();
53
54         /* Halt if there was a built in self test failure */
55         report_bist_failure(bist);
56
57         if (bios_reset_detected())
58                 hard_reset();
59
60         enable_smbus();
61 #if 0
62         dump_spd_registers(&memctrl[0]);
63         dump_smbus_registers();
64 #endif
65
66         sdram_initialize(1, memctrl);
67
68 #if 0
69         dump_pci_devices();
70 #endif
71
72 #if 1
73         dump_pci_device(PCI_DEV(0, 0, 0));
74 #endif
75 }