resource: Add helpers for memory resources
These should help to make the reviews as platforms remove KiB scaling. Change-Id: I40644f873c0ea993353753c0ef40df4c83233355 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55474 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
@@ -841,6 +841,21 @@ const struct resource *fixed_resource_range_idx(struct device *dev, unsigned lon
|
||||
return resource;
|
||||
}
|
||||
|
||||
const struct resource *lower_ram_end(struct device *dev, unsigned long index, uint64_t end)
|
||||
{
|
||||
return ram_from_to(dev, index, 0, end);
|
||||
}
|
||||
|
||||
const struct resource *upper_ram_end(struct device *dev, unsigned long index, uint64_t end)
|
||||
{
|
||||
if (end <= 4ull * GiB)
|
||||
return NULL;
|
||||
|
||||
printk(BIOS_INFO, "Available memory above 4GB: %lluM\n", (end - 4ull * GiB) / MiB);
|
||||
|
||||
return ram_from_to(dev, index, 4ull * GiB, end);
|
||||
}
|
||||
|
||||
void mmconf_resource(struct device *dev, unsigned long index)
|
||||
{
|
||||
struct resource *resource = new_resource(dev, index);
|
||||
|
Reference in New Issue
Block a user