summaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-03-22 22:03:09 -0500
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-03-23 19:40:36 +0100
commitc965076c3ecec6ccf8eb0eb1d57d6a0a312dab04 (patch)
tree6f5238941a7dd03c66a665025cc414156484667b /src/include/device
parent0135702802601c19937eec57513f3a6e2f4d1e00 (diff)
downloadcoreboot-c965076c3ecec6ccf8eb0eb1d57d6a0a312dab04.tar.xz
resources: introduce reserved_ram_resource()
mmio_resource() was previously being used for reserving RAM from the OS by using IORESOURCE_IGNORE_MTRR atrribute. Instead, be more explicit for those uses with reserved_ram_resource(). bad_ram_resource() now calls reserved_ram_resource(). Those resources are marked as cacheable but reserved. The sandybridge and haswell code were relying on the implementation fo the MTRR algorithm's interaction for reserved regions. Instead be explicit about what ranges are MMIO reserved and what are RAM reserved. Change-Id: I1e47026970fb37c0305e4d49a12c98b0cdd1abe5 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2886 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/device.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 5219310202..b8dfbf51cf 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -206,8 +206,11 @@ void fixed_mem_resource(device_t dev, unsigned long index,
#define ram_resource(dev, idx, basek, sizek) \
fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE)
+#define reserved_ram_resource(dev, idx, basek, sizek) \
+ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE | IORESOURCE_RESERVE | IORESOURCE_IGNORE_MTRR)
+
#define bad_ram_resource(dev, idx, basek, sizek) \
- fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE | IORESOURCE_IGNORE_MTRR)
+ reserved_ram_resource((dev), (idx), (basek), (sizek))
#define uma_resource(dev, idx, basek, sizek) \
fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE | IORESOURCE_UMA_FB)