summaryrefslogtreecommitdiff
path: root/src/northbridge/intel
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-01-18 00:36:54 +0100
committerAngel Pons <th3fanbus@gmail.com>2021-01-19 23:03:52 +0000
commita6e4afc1cb44124562cdac1bea1c9fd81b9ecf27 (patch)
treeab823acdd9ad60de8ea9cd9257ee382c98436a69 /src/northbridge/intel
parente8ac16e7e92b8f0fc07fd80697b78fd5b2f5ef43 (diff)
nb/intel/i945/northbridge.c: Improve readability
This cosmetic change does 2 things: - change bitwise shifting to division - Make the division by / KiB explicit for fixed legacy ranges like 0xa0000-0xbffff. Change-Id: I626989fa6625e0b3613a11e709c614d40a788b0e Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49623 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/northbridge/intel')
-rw-r--r--src/northbridge/intel/i945/northbridge.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c
index cfa527f4cc..00d5be95b5 100644
--- a/src/northbridge/intel/i945/northbridge.c
+++ b/src/northbridge/intel/i945/northbridge.c
@@ -74,7 +74,7 @@ static void mch_domain_read_resources(struct device *dev)
printk(BIOS_DEBUG, "IGD decoded, subtracting ");
int uma_size = decode_igd_memory_size((reg16 >> 4) & 7);
- printk(BIOS_DEBUG, "%dM UMA\n", uma_size >> 10);
+ printk(BIOS_DEBUG, "%dM UMA\n", uma_size / KiB);
tomk_stolen -= uma_size;
/* For reserving UMA memory in the memory map */
@@ -85,15 +85,15 @@ static void mch_domain_read_resources(struct device *dev)
(unsigned int)uma_memory_base);
}
- tseg_sizek = decode_tseg_size(pci_read_config8(d0f0, ESMRAMC)) >> 10;
- printk(BIOS_DEBUG, "TSEG decoded, subtracting %dM\n", tseg_sizek >> 10);
+ tseg_sizek = decode_tseg_size(pci_read_config8(d0f0, ESMRAMC)) / KiB;
+ printk(BIOS_DEBUG, "TSEG decoded, subtracting %dM\n", tseg_sizek / KiB);
tomk_stolen -= tseg_sizek;
tseg_memory_base = tomk_stolen * 1024ULL;
tseg_memory_size = tseg_sizek * 1024ULL;
/* cbmem_top can be shifted downwards due to alignment.
Mark the region between cbmem_top and tomk as unusable */
- cbmem_topk = ((uint32_t)cbmem_top() >> 10);
+ cbmem_topk = ((uint32_t)cbmem_top() / KiB);
delta_cbmem = tomk_stolen - cbmem_topk;
tomk_stolen -= delta_cbmem;
@@ -103,16 +103,16 @@ static void mch_domain_read_resources(struct device *dev)
* number is always 0
*/
printk(BIOS_INFO, "Available memory: %dK", (uint32_t)tomk_stolen);
- printk(BIOS_INFO, " (%dM)\n", (uint32_t)(tomk_stolen >> 10));
+ printk(BIOS_INFO, " (%dM)\n", (uint32_t)(tomk_stolen / KiB));
/* Report the memory regions */
- ram_resource(dev, 3, 0, 640);
- ram_resource(dev, 4, 768, (tomk - 768));
- uma_resource(dev, 5, uma_memory_base >> 10, uma_memory_size >> 10);
- mmio_resource(dev, 6, tseg_memory_base >> 10, tseg_memory_size >> 10);
+ ram_resource(dev, 3, 0, 0xa0000 / KiB);
+ ram_resource(dev, 4, 0xc0000 / KiB, (tomk - 0xc0000 / KiB));
+ uma_resource(dev, 5, uma_memory_base / KiB, uma_memory_size / KiB);
+ mmio_resource(dev, 6, tseg_memory_base / KiB, tseg_memory_size / KiB);
uma_resource(dev, 7, cbmem_topk, delta_cbmem);
/* legacy VGA memory */
- mmio_resource(dev, 8, 640, 768 - 640);
+ mmio_resource(dev, 8, 0xa0000 / KiB, (0xc0000 - 0xa0000) / KiB);
}
static void mch_domain_set_resources(struct device *dev)