From 27d6299d51744bda549b7764b8fde909ad812e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 24 May 2022 20:25:58 +0300 Subject: device/resource: Add _kb postfix for resource allocators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a lot of going back-and-forth with the KiB arguments, start the work to migrate away from this. Change-Id: I329864d36137e9a99b5640f4f504c45a02060a40 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/64658 Reviewed-by: Werner Zeh Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/northbridge/amd/agesa/family14/northbridge.c | 6 +++--- src/northbridge/amd/agesa/family15tn/northbridge.c | 6 +++--- src/northbridge/amd/agesa/family16kb/northbridge.c | 6 +++--- src/northbridge/amd/pi/00730F01/northbridge.c | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c index cf67d93551..bacab24e27 100644 --- a/src/northbridge/amd/agesa/family14/northbridge.c +++ b/src/northbridge/amd/agesa/family14/northbridge.c @@ -554,7 +554,7 @@ static void domain_set_resources(struct device *dev) /* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */ if (basek < 640 && sizek > 768) { printk(BIOS_DEBUG,"adsr - 0xa0000 to 0xbffff resource.\n"); - ram_resource(dev, (idx | 0), basek, 640 - basek); + ram_resource_kb(dev, (idx | 0), basek, 640 - basek); idx += 0x10; basek = 768; sizek = limitk - basek; @@ -570,7 +570,7 @@ static void domain_set_resources(struct device *dev) unsigned int pre_sizek; pre_sizek = mmio_basek - basek; if (pre_sizek > 0) { - ram_resource(dev, idx, basek, + ram_resource_kb(dev, idx, basek, pre_sizek); idx += 0x10; sizek -= pre_sizek; @@ -585,7 +585,7 @@ static void domain_set_resources(struct device *dev) } } - ram_resource(dev, (idx | 0), basek, sizek); + ram_resource_kb(dev, (idx | 0), basek, sizek); idx += 0x10; printk(BIOS_DEBUG, "%d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", 0, diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c index 046f87576a..8a578e6775 100644 --- a/src/northbridge/amd/agesa/family15tn/northbridge.c +++ b/src/northbridge/amd/agesa/family15tn/northbridge.c @@ -711,7 +711,7 @@ static void domain_set_resources(struct device *dev) /* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */ if (basek < 640 && sizek > 768) { - ram_resource(dev, (idx | i), basek, 640 - basek); + ram_resource_kb(dev, (idx | i), basek, 640 - basek); idx += 0x10; basek = 768; sizek = limitk - basek; @@ -724,7 +724,7 @@ static void domain_set_resources(struct device *dev) unsigned int pre_sizek; pre_sizek = mmio_basek - basek; if (pre_sizek > 0) { - ram_resource(dev, (idx | i), basek, pre_sizek); + ram_resource_kb(dev, (idx | i), basek, pre_sizek); idx += 0x10; sizek -= pre_sizek; } @@ -740,7 +740,7 @@ static void domain_set_resources(struct device *dev) } } - ram_resource(dev, (idx | i), basek, sizek); + ram_resource_kb(dev, (idx | i), basek, sizek); idx += 0x10; printk(BIOS_DEBUG, "node %d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", i, mmio_basek, basek, limitk); diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c index 0dc3d0bcae..7a94aa5830 100644 --- a/src/northbridge/amd/agesa/family16kb/northbridge.c +++ b/src/northbridge/amd/agesa/family16kb/northbridge.c @@ -723,7 +723,7 @@ static void domain_set_resources(struct device *dev) /* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */ if (basek < 640 && sizek > 768) { - ram_resource(dev, (idx | i), basek, 640 - basek); + ram_resource_kb(dev, (idx | i), basek, 640 - basek); idx += 0x10; basek = 768; sizek = limitk - basek; @@ -737,7 +737,7 @@ static void domain_set_resources(struct device *dev) unsigned int pre_sizek; pre_sizek = mmio_basek - basek; if (pre_sizek > 0) { - ram_resource(dev, (idx | i), basek, pre_sizek); + ram_resource_kb(dev, (idx | i), basek, pre_sizek); idx += 0x10; sizek -= pre_sizek; } @@ -753,7 +753,7 @@ static void domain_set_resources(struct device *dev) } } - ram_resource(dev, (idx | i), basek, sizek); + ram_resource_kb(dev, (idx | i), basek, sizek); idx += 0x10; printk(BIOS_DEBUG, "node %d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", i, mmio_basek, basek, limitk); diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c index 52364a2e53..5fbd0e7338 100644 --- a/src/northbridge/amd/pi/00730F01/northbridge.c +++ b/src/northbridge/amd/pi/00730F01/northbridge.c @@ -139,8 +139,8 @@ static void add_fixed_resources(struct device *dev, int index) * 0xa0000 - 0xbffff: legacy VGA * 0xc0000 - 0xfffff: option ROMs and SeaBIOS (if used) */ - mmio_resource(dev, index++, 0xa0000 >> 10, (0xc0000 - 0xa0000) >> 10); - reserved_ram_resource(dev, index++, 0xc0000 >> 10, (0x100000 - 0xc0000) >> 10); + mmio_resource_kb(dev, index++, 0xa0000 >> 10, (0xc0000 - 0xa0000) >> 10); + reserved_ram_resource_kb(dev, index++, 0xc0000 >> 10, (0x100000 - 0xc0000) >> 10); if (fx_devs == 0) get_fx_devs(); @@ -151,7 +151,7 @@ static void add_fixed_resources(struct device *dev, int index) resource_t basek, limitk; if (!get_dram_base_limit(0, &basek, &limitk)) return; - mmio_resource(dev, index++, limitk, 16*1024); + mmio_resource_kb(dev, index++, limitk, 16*1024); } } @@ -812,7 +812,7 @@ static void domain_read_resources(struct device *dev) /* See if we need a hole from 0xa0000 (640K) to 0xfffff (1024K) */ if (basek < 640 && sizek > 1024) { - ram_resource(dev, (idx | i), basek, 640 - basek); + ram_resource_kb(dev, (idx | i), basek, 640 - basek); idx += 0x10; basek = 1024; sizek = limitk - basek; @@ -827,7 +827,7 @@ static void domain_read_resources(struct device *dev) unsigned int pre_sizek; pre_sizek = mmio_basek - basek; if (pre_sizek > 0) { - ram_resource(dev, (idx | i), basek, pre_sizek); + ram_resource_kb(dev, (idx | i), basek, pre_sizek); idx += 0x10; sizek -= pre_sizek; } @@ -843,7 +843,7 @@ static void domain_read_resources(struct device *dev) } } - ram_resource(dev, (idx | i), basek, sizek); + ram_resource_kb(dev, (idx | i), basek, sizek); idx += 0x10; printk(BIOS_DEBUG, "node %d: mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", i, mmio_basek, basek, limitk); -- cgit v1.2.3