summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2012-07-27 08:37:12 +0300
committerAnton Kochkov <anton.kochkov@gmail.com>2012-07-27 11:15:41 +0200
commitecf1ed49c72168c3d5b613a5d5198b5dd22777b4 (patch)
treeda0dce9686a6c8b9cc5efe931ad8332ab2b52721 /src/include
parent19e99f5cf1659bc3731774087de3208b4a52fd2a (diff)
Allocators for different memory regions types
Hide some details of the resource allocator from rest of the world. These should come in handy when fixing some aspects of MTRR setup. Change-Id: I8acad98f25e56cd8bae64fb52539d81ce94f9c73 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/1367 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/device/device.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 8cc937f94d..1515b45e02 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -170,10 +170,21 @@ void pci_domain_read_resources(struct device *dev);
unsigned int pci_domain_scan_bus(struct device *dev, unsigned int max);
unsigned int scan_static_bus(device_t bus, unsigned int max);
-void ram_resource(device_t dev, unsigned long index,
- unsigned long basek, unsigned long sizek);
-void uma_resource(device_t dev, unsigned long index,
- unsigned long basek, unsigned long sizek);
+void fixed_mem_resource(device_t dev, unsigned long index,
+ unsigned long basek, unsigned long sizek, unsigned long type);
+
+#define ram_resource(dev, idx, basek, sizek) \
+ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE)
+
+#define bad_ram_resource(dev, idx, basek, sizek) \
+ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE | IORESOURCE_CACHEABLE )
+
+#define uma_resource(dev, idx, basek, sizek) \
+ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE | IORESOURCE_UMA_FB)
+
+#define mmio_resource(dev, idx, basek, sizek) \
+ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
+
void tolm_test(void *gp, struct device *dev, struct resource *new);
u32 find_pci_tolm(struct bus *bus);