The epia now works.
[coreboot.git] / src / northbridge / via / vt8601 / northbridge.c
1 #include <console/console.h>
2 #include <arch/io.h>
3 #include <stdint.h>
4 #include <mem.h>
5 #include <part/sizeram.h>
6 #include <device/device.h>
7 #include <device/pci.h>
8 #include <device/hypertransport.h>
9 #include <device/chip.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include <bitops.h>
13 #include "chip.h"
14 #include "northbridge.h"
15
16 struct mem_range *sizeram(void)
17 {
18         unsigned long mmio_basek;
19         static struct mem_range mem[10];
20         device_t dev;
21         int i, idx;
22
23         dev = dev_find_slot(0, 0);
24         if (!dev) {
25                 printk_err("Cannot find PCI: 0:0\n");
26                 return 0;
27         }
28         mem[0].basek = 0;
29         mem[0].sizek = 65536;
30         idx = 1;
31         while(idx < sizeof(mem)/sizeof(mem[0])) {
32                 mem[idx].basek = 0;
33                 mem[idx].sizek = 0;
34                 idx++;
35         }
36
37 #if 1
38         for(i = 0; i < idx; i++) {
39                 printk_debug("mem[%d].basek = %08x mem[%d].sizek = %08x\n",
40                         i, mem[i].basek, i, mem[i].sizek);
41         }
42 #endif
43
44         return mem;
45 }
46 static void enumerate(struct chip *chip)
47 {
48         extern struct device_operations default_pci_ops_bus;
49         chip_enumerate(chip);
50         chip->dev->ops = &default_pci_ops_bus;
51 }
52
53 struct chip_control northbridge_via_vt8601_control = {
54         .enumerate = enumerate,
55         .name   = "VIA vt8601 Northbridge",
56 };