Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59936 )
Change subject: soc/amd: use KiB and MiB definitions ......................................................................
soc/amd: use KiB and MiB definitions
Use KiB and MiB instead of multiplying/dividing with/by the numeric value when doing region size calculations.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I56c380190b11aa3214cce31b82974327e3d15000 --- M src/soc/amd/common/block/iommu/iommu.c M src/soc/amd/common/block/lpc/lpc.c M src/soc/amd/picasso/agesa_acpi.c 3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/59936/1
diff --git a/src/soc/amd/common/block/iommu/iommu.c b/src/soc/amd/common/block/iommu/iommu.c index b6e4ac2..8628096 100644 --- a/src/soc/amd/common/block/iommu/iommu.c +++ b/src/soc/amd/common/block/iommu/iommu.c @@ -14,7 +14,7 @@
/* Add an extra subtractive resource for both memory and I/O. */ res = new_resource(dev, 0x44); - res->size = 512 * 1024; + res->size = 512 * KiB; res->align = log2(res->size); res->gran = log2(res->size); res->limit = 0xffffffff; /* 4G */ diff --git a/src/soc/amd/common/block/lpc/lpc.c b/src/soc/amd/common/block/lpc/lpc.c index 7c46645..ebded6b 100644 --- a/src/soc/amd/common/block/lpc/lpc.c +++ b/src/soc/amd/common/block/lpc/lpc.c @@ -106,7 +106,7 @@ IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
/* Add a memory resource for the SPI BAR. */ - fixed_mem_resource(dev, 2, SPI_BASE_ADDRESS / 1024, 1, + fixed_mem_resource(dev, 2, SPI_BASE_ADDRESS / KiB, 1, IORESOURCE_SUBTRACTIVE);
res = new_resource(dev, 3); /* IOAPIC */ diff --git a/src/soc/amd/picasso/agesa_acpi.c b/src/soc/amd/picasso/agesa_acpi.c index 7826007..4ab31e5 100644 --- a/src/soc/amd/picasso/agesa_acpi.c +++ b/src/soc/amd/picasso/agesa_acpi.c @@ -82,7 +82,7 @@ if (memory_base == 0) { current = create_crat_memory_entry(0, 0ull, 0xa0000ull, current); - memory_base = (1 * 1024 * 1024); + memory_base = 1 * MiB; memory_length = memory_base; new_entries++; }