1 #include <console/console.h>
5 #include <part/sizeram.h>
6 #include <device/device.h>
7 #include <device/pci.h>
8 #include <device/hypertransport.h>
13 #include "northbridge.h"
17 printk_err("Hard_RESET!!!\n");
20 struct mem_range *sizeram(void)
22 unsigned long mmio_basek;
23 static struct mem_range mem[10];
26 unsigned char rambits;
28 dev = dev_find_slot(0, 0);
30 printk_err("Cannot find PCI: 0:0\n");
37 while(idx < sizeof(mem)/sizeof(mem[0])) {
42 for(rambits = 0, i = 0; i < sizeof(ramregs)/sizeof(ramregs[0]); i++) {
44 reg = pci_read_config8(dev, ramregs[i]);
45 /* these are ENDING addresses, not sizes.
46 * if there is memory in this slot, then reg will be > rambits.
47 * So we just take the max, that gives us total.
48 * We take the highest one to cover for once and future linuxbios
49 * bugs. We warn about bugs.
54 printk_err("ERROR! register 0x%x is not set!\n",
58 printk_debug("I would set ram size to 0x%x Kbytes\n", (rambits)*8*1024);
59 mem[0].sizek = rambits*8*1024;
62 for(i = 0; i < idx; i++) {
63 printk_debug("mem[%d].basek = %08x mem[%d].sizek = %08x\n",
64 i, mem[i].basek, i, mem[i].sizek);
71 static void enumerate(struct chip *chip)
73 extern struct device_operations default_pci_ops_bus;
75 chip->dev->ops = &default_pci_ops_bus;
78 static void random_fixup() {
79 device_t pcidev = dev_find_slot(0, 0);
81 printk_warning("QEMU random fixup ...\n");
83 // pci_write_config8(pcidev, 0x0, 0x0);
87 static void northbridge_init(struct chip *chip, enum chip_pass pass)
90 struct northbridge_dummy_qemu_i386_config *conf =
91 (struct northbridge_dummy_qemu_i386_config *)chip->chip_info;
94 case CONF_PASS_PRE_PCI:
97 case CONF_PASS_POST_PCI:
100 case CONF_PASS_PRE_BOOT:
110 struct chip_control northbridge_emulation_qemu_i386_control = {
111 .enumerate = enumerate,
112 .enable = northbridge_init,
113 .name = "QEMU Northbridge",