{nb,soc}/intel/{haswell,broadwell}/memmap.c: Use ALIGN_DOWN(x, a)

Change-Id: I049441dd9074659effc1092dce08224974d60a2c
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44924
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Elyes HAOUAS 2020-08-29 18:11:16 +02:00 committed by Patrick Georgi
parent 1d418281e0
commit 694cbc0ddc
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ static uintptr_t smm_region_start(void)
* 1 MiB alignment.
*/
uintptr_t tom = pci_read_config32(HOST_BRIDGE, TSEG);
return tom & ~((1 << 20) - 1);
return ALIGN_DOWN(tom, 1 * MiB);
}
void *cbmem_top_chipset(void)

View File

@ -18,7 +18,7 @@ static uintptr_t dpr_region_start(void)
* must be calculated from the size in MiB in bits 11:4.
*/
uintptr_t dpr = pci_read_config32(SA_DEV_ROOT, DPR);
uintptr_t tom = dpr & ~((1 << 20) - 1);
uintptr_t tom = ALIGN_DOWN(dpr, 1 * MiB);
/* Subtract DMA Protected Range size if enabled */
if (dpr & DPR_EPM)