4 #include <device/pci_def.h>
6 #include <device/pnp_def.h>
7 #include <arch/romcc_io.h>
9 #include "pc80/serial.c"
10 #include "arch/i386/lib/console.c"
11 #include "ram/ramtest.c"
12 #include "northbridge/via/vt8601/raminit.h"
13 #include "cpu/x86/mtrr/earlymtrr.c"
14 #include "cpu/x86/bist.h"
18 void udelay(int usecs)
21 for (i = 0; i < usecs; i++)
25 #include "lib/delay.c"
26 #include "cpu/x86/lapic/boot_cpu.c"
29 #include "southbridge/via/vt8231/vt8231_early_smbus.c"
30 #include "southbridge/via/vt8231/vt8231_early_serial.c"
32 static inline int spd_read_byte(unsigned device, unsigned address)
35 c = smbus_read_byte(device, address);
39 #include "northbridge/via/vt8601/raminit.c"
41 #include "sdram/generic_sdram.c"
44 static void enable_mainboard_devices(void)
47 /* dev 0 for southbridge */
49 dev = pci_locate_device(PCI_ID(0x1106,0x8231), 0);
51 if (dev == PCI_DEV_INVALID) {
52 die("Southbridge not found!!!\n");
55 pci_write_config8(dev, 0x50, 7);
56 pci_write_config8(dev, 0x51, 0xff);
58 // This early setup switches IDE into compatibility mode before PCI gets
59 // // a chance to assign I/Os
60 // movl $CONFIG_ADDR(0, 0x89, 0x42), %eax
63 // PCI_WRITE_CONFIG_BYTE
66 /* we do this here as in V2, we can not yet do raw operations
69 dev += 0x100; /* ICKY */
71 pci_write_config8(dev, 0x42, 0);
74 static void enable_shadow_ram(void)
77 unsigned char shadowreg;
79 shadowreg = pci_read_config8(dev, 0x63);
82 pci_write_config8(dev, 0x63, shadowreg);
85 static void main(unsigned long bist)
92 enable_vt8231_serial();
96 /* Halt if there was a built in self test failure */
97 report_bist_failure(bist);
99 enable_mainboard_devices();
104 this is way more generic than we need.
105 sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
107 sdram_set_registers((const struct mem_controller *) 0);
108 sdram_set_spd_registers((const struct mem_controller *) 0);
109 sdram_enable(0, (const struct mem_controller *) 0);
111 /* Check all of memory */
113 ram_check(0x00000000, msr.lo);
116 static const struct {
117 unsigned long lo, hi;
119 /* Check 16MB of memory @ 0*/
120 { 0x00000000, 0x01000000 },
122 /* Check 16MB of memory @ 2GB */
123 { 0x80000000, 0x81000000 },
127 for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
128 ram_check(check_addrs[i].lo, check_addrs[i].hi);