From 885efa1102fd39bb7d0558d6d0ad9d10284e1a72 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 5 Jul 2023 12:11:12 +0200 Subject: [PATCH] soc/amd/stoneyridge: Use newer function for resource declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Arthur Heymans Change-Id: I2d01424731b149daa3d3378d66855ee5e074473b Reviewed-on: https://review.coreboot.org/c/coreboot/+/76290 Reviewed-by: Kyösti Mälkki Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth Reviewed-by: Felix Held --- src/soc/amd/stoneyridge/northbridge.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index b4c18d3587..ecdbe4fee9 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -363,24 +363,22 @@ void domain_read_resources(struct device *dev) fixed_io_range_reserved(dev, idx++, PCI_IO_CONFIG_INDEX, PCI_IO_CONFIG_PORT_COUNT); /* 0x0 -> 0x9ffff */ - ram_resource_kb(dev, idx++, 0, 0xa0000 / KiB); + ram_range(dev, idx++, 0, 0xa0000); /* 0xa0000 -> 0xbffff: legacy VGA */ - mmio_resource_kb(dev, idx++, VGA_MMIO_BASE / KiB, VGA_MMIO_SIZE / KiB); + mmio_range(dev, idx++, VGA_MMIO_BASE, VGA_MMIO_SIZE); /* 0xc0000 -> 0xfffff: Option ROM */ - reserved_ram_resource_kb(dev, idx++, 0xc0000 / KiB, 0x40000 / KiB); + reserved_ram_from_to(dev, idx++, 0xc0000, 1 * MiB); /* * 0x100000 (1MiB) -> low top usable RAM * cbmem_top() accounts for low UMA and TSEG if they are used. */ - ram_resource_kb(dev, idx++, (1 * MiB) / KiB, - (mem_useable - (1 * MiB)) / KiB); + ram_from_to(dev, idx++, 1 * MiB, mem_useable); /* Low top usable RAM -> Low top RAM (bottom pci mmio hole) */ - reserved_ram_resource_kb(dev, idx++, mem_useable / KiB, - (tom - mem_useable) / KiB); + reserved_ram_from_to(dev, idx++, mem_useable, tom); /* If there is memory above 4GiB */ if (high_tom >> 32) { @@ -390,13 +388,11 @@ void domain_read_resources(struct device *dev) else high_mem_useable = high_tom; - ram_resource_kb(dev, idx++, (4ull * GiB) / KiB, - ((high_mem_useable - (4ull * GiB)) / KiB)); + ram_from_to(dev, idx++, 4ull * GiB, high_mem_useable); /* High top usable RAM -> high top RAM */ if (uma_base >= (4ull * GiB)) { - reserved_ram_resource_kb(dev, idx++, uma_base / KiB, - uma_size / KiB); + reserved_ram_range(dev, idx++, uma_base, uma_size); } } }