fix 'deprecated' warnings
[coreboot.git] / src / mainboard / via / epia / auto.c
1 #define ASSEMBLY 1
2
3
4 #include <stdint.h>
5 #include <device/pci_def.h>
6 #include <cpu/p6/apic.h>
7 #include <arch/io.h>
8 #include <device/pnp.h>
9 #include <arch/romcc_io.h>
10 #include "pc80/serial.c"
11 #include "arch/i386/lib/console.c"
12 #include "ram/ramtest.c"
13 #include "northbridge/via/vt8601/raminit.h"
14 void udelay(int usecs) {
15   int i;
16   for(i = 0; i < usecs; i++)
17     outb(0x80, 0x80);
18 }
19
20 #include "lib/delay.c"
21 #include "cpu/p6/boot_cpu.c"
22 #include "debug.c"
23
24 #include "southbridge/via/vt8231/vt8231_early_smbus.c"
25 #define SIO_BASE 0x2e
26 #define MAXIMUM_CONSOLE_LOGLEVEL 9
27 #define DEFAULT_CONSOLE_LOGLEVEL 9
28
29 static void memreset_setup(void)
30 {
31 }
32
33 /*
34 static void memreset(int controllers, const struct mem_controller *ctrl)
35 {
36 }
37 */
38 static inline int spd_read_byte(unsigned device, unsigned address)
39 {
40         return smbus_read_byte(device, address);
41 }
42
43
44
45 #include "northbridge/via/vt8601/raminit.c"
46 #include "sdram/generic_sdram.c"
47 /*
48  */
49
50 static void main(void)
51 {
52   struct mem_controller cpu[1];
53   //    init_timer();
54
55         uart_init();
56         console_init();
57         
58         enable_smbus();
59         memreset_setup();
60 //      sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
61
62
63         /* Check all of memory */
64 #if 0
65         msr_t msr;
66         msr = rdmsr(TOP_MEM);
67         print_debug("TOP_MEM: ");
68         print_debug_hex32(msr.hi);
69         print_debug_hex32(msr.lo);
70         print_debug("\r\n");
71 #endif
72 #if 0
73         ram_check(0x00000000, msr.lo);
74 #endif
75 #if 0
76         static const struct {
77                 unsigned long lo, hi;
78         } check_addrs[] = {
79                 /* Check 16MB of memory @ 0*/
80                 { 0x00000000, 0x01000000 },
81 #if TOTAL_CPUS > 1
82                 /* Check 16MB of memory @ 2GB */
83                 { 0x80000000, 0x81000000 },
84 #endif
85         };
86         int i;
87         for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
88                 ram_check(check_addrs[i].lo, check_addrs[i].hi);
89         }
90 #endif
91 }