it's getting through the 8601 but the values are still not right.
[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 /*
15  */
16 void udelay(int usecs) {
17   int i;
18   for(i = 0; i < usecs; i++)
19     outb(i&0xff, 0x80);
20 }
21
22 #include "lib/delay.c"
23 #include "cpu/p6/boot_cpu.c"
24 #include "debug.c"
25
26 #include "southbridge/via/vt8231/vt8231_early_smbus.c"
27
28 #define MAXIMUM_CONSOLE_LOGLEVEL 9
29 #define DEFAULT_CONSOLE_LOGLEVEL 9
30
31 #include "southbridge/via/vt8231/vt8231_early_serial.c"
32 static void memreset_setup(void)
33 {
34 }
35
36 /*
37 static void memreset(int controllers, const struct mem_controller *ctrl)
38 {
39 }
40 */
41 static inline int spd_read_byte(unsigned device, unsigned address)
42 {
43         return smbus_read_byte(device, address);
44 }
45
46
47
48 #include "northbridge/via/vt8601/raminit.c"
49 /*
50 #include "sdram/generic_sdram.c"
51  */
52
53 static void main(void)
54 {
55   unsigned long x;
56   /*    init_timer();*/
57   outb(5, 0x80);
58
59         enable_vt8231_serial();
60         uart_init();
61         console_init();
62         
63         enable_smbus();
64         /*
65         memreset_setup();
66          this is way more generic than we need.
67         sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
68         */
69         sdram_set_registers((const struct mem_controller *) 0);
70
71
72         /* Check all of memory */
73 #if 0
74         msr_t msr;
75         msr = rdmsr(TOP_MEM);
76         print_debug("TOP_MEM: ");
77         print_debug_hex32(msr.hi);
78         print_debug_hex32(msr.lo);
79         print_debug("\r\n");
80 #endif
81 #if 0
82         ram_check(0x00000000, msr.lo);
83 #endif
84 #if 0
85         static const struct {
86                 unsigned long lo, hi;
87         } check_addrs[] = {
88                 /* Check 16MB of memory @ 0*/
89                 { 0x00000000, 0x01000000 },
90 #if TOTAL_CPUS > 1
91                 /* Check 16MB of memory @ 2GB */
92                 { 0x80000000, 0x81000000 },
93 #endif
94         };
95         int i;
96         for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
97                 ram_check(check_addrs[i].lo, check_addrs[i].hi);
98         }
99 #endif
100 }