We hardcode highmemory size in every northbridge! This is bad, and especially if...
[coreboot.git] / src / northbridge / intel / i82810 / northbridge.c
index 2dae1493e8ff55437806072f75df4d1eb560ebd9..3434c6d71b7618301c1f709473b046cd98eb092e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
- * Copyright (C) 2007 Corey Osgood <corey@slightlyhackish.com>
+ * Copyright (C) 2007 Corey Osgood <corey.osgood@gmail.com>
  * Copyright (C) 2010 Joseph Smith <joe@settoplinux.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -62,46 +62,6 @@ static const struct pci_driver i810e_northbridge_driver __pci_driver = {
        .device = 0x7124,
 };
 
-static void ram_resource(device_t dev, unsigned long index,
-                        unsigned long basek, unsigned long sizek)
-{
-       struct resource *resource;
-
-       if (!sizek) {
-               return;
-       }
-       resource = new_resource(dev, index);
-       resource->base = ((resource_t) basek) << 10;
-       resource->size = ((resource_t) sizek) << 10;
-       resource->flags = IORESOURCE_MEM | IORESOURCE_CACHEABLE |
-           IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
-}
-
-static void tolm_test(void *gp, struct device *dev, struct resource *new)
-{
-       struct resource **best_p = gp;
-       struct resource *best;
-       best = *best_p;
-       if (!best || (best->base > new->base)) {
-               best = new;
-       }
-       *best_p = best;
-}
-
-static uint32_t find_pci_tolm(struct bus *bus)
-{
-       struct resource *min;
-       uint32_t tolm;
-       min = 0;
-       search_bus_resources(bus, IORESOURCE_MEM, IORESOURCE_MEM, tolm_test,
-                            &min);
-       tolm = 0xffffffffUL;
-       if (min && tolm > min->base) {
-               tolm = min->base;
-       }
-       return tolm;
-}
-
 /* IGD UMA memory */
 uint64_t uma_memory_base=0, uma_memory_size=0;
 
@@ -124,8 +84,7 @@ static int translate_i82810_to_mb[] = {
 };
 
 #if CONFIG_WRITE_HIGH_TABLES==1
-#define HIGH_TABLES_SIZE 64    // maximum size of high tables in KB
-extern uint64_t high_tables_base, high_tables_size;
+#include <cbmem.h>
 #endif
 
 static void pci_domain_set_resources(device_t dev)
@@ -190,8 +149,8 @@ static void pci_domain_set_resources(device_t dev)
 
 #if CONFIG_WRITE_HIGH_TABLES==1
        /* Leave some space for ACPI, PIRQ and MP tables */
-       high_tables_base = (tomk - HIGH_TABLES_SIZE) * 1024;
-       high_tables_size = HIGH_TABLES_SIZE * 1024;
+       high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;
+       high_tables_size = HIGH_MEMORY_SIZE;
 #endif
        assign_resources(dev->link_list);
 }