5 #include <device/pci_def.h>
6 #include <cpu/p6/apic.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"
16 void udelay(int usecs) {
18 for(i = 0; i < usecs; i++)
22 #include "lib/delay.c"
23 #include "cpu/p6/boot_cpu.c"
26 #include "southbridge/via/vt8231/vt8231_early_smbus.c"
28 #define MAXIMUM_CONSOLE_LOGLEVEL 9
29 #define DEFAULT_CONSOLE_LOGLEVEL 9
31 #include "southbridge/via/vt8231/vt8231_early_serial.c"
32 static void memreset_setup(void)
37 static void memreset(int controllers, const struct mem_controller *ctrl)
41 static inline int spd_read_byte(unsigned device, unsigned address)
44 c = smbus_read_byte(device, address);
50 #include "northbridge/via/vt8601/raminit.c"
52 #include "sdram/generic_sdram.c"
56 enable_mainboard_devices(void) {
58 /* dev 0 for southbridge */
60 dev = pci_locate_device(PCI_ID(0x1106,0x8231), 0);
62 if (dev == PCI_DEV_INVALID) {
63 die("Southbridge not found!!!\n");
65 pci_write_config8(dev, 0x50, 7);
66 pci_write_config8(dev, 0x51, 0xff);
70 enable_shadow_ram(void) {
71 device_t dev = 0; /* no need to look up 0:0.0 */
72 unsigned char shadowreg;
73 /* dev 0 for southbridge */
74 shadowreg = pci_read_config8(dev, 0x63);
77 pci_write_config8(dev, 0x63, shadowreg);
79 static void main(void)
85 enable_vt8231_serial();
86 enable_mainboard_devices();
94 this is way more generic than we need.
95 sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
97 sdram_set_registers((const struct mem_controller *) 0);
100 /* Check all of memory */
103 msr = rdmsr(TOP_MEM);
104 print_debug("TOP_MEM: ");
105 print_debug_hex32(msr.hi);
106 print_debug_hex32(msr.lo);
110 ram_check(0x00000000, msr.lo);
113 static const struct {
114 unsigned long lo, hi;
116 /* Check 16MB of memory @ 0*/
117 { 0x00000000, 0x01000000 },
119 /* Check 16MB of memory @ 2GB */
120 { 0x80000000, 0x81000000 },
124 for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
125 ram_check(check_addrs[i].lo, check_addrs[i].hi);