soc/{amd,intel}: Use CACHE_ROM_(BASE|SIZE)
Boards could choose a high ROM_SIZE that would result in an MTRR config that conflicts with other resources. Thus, always use the filtered CACHE_ROM_SIZE. Change-Id: I66d36b84ce49c1cb98cb36a4731977baaedf3225 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/26575 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -128,7 +128,7 @@ asmlinkage void car_stage_entry(void)
|
|||||||
MTRR_TYPE_WRBACK);
|
MTRR_TYPE_WRBACK);
|
||||||
|
|
||||||
/* Cache the memory-mapped boot media. */
|
/* Cache the memory-mapped boot media. */
|
||||||
postcar_frame_add_mtrr(&pcf, -CONFIG_ROM_SIZE, CONFIG_ROM_SIZE,
|
postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE,
|
||||||
MTRR_TYPE_WRPROT);
|
MTRR_TYPE_WRPROT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -234,7 +234,7 @@ asmlinkage void car_stage_entry(void)
|
|||||||
|
|
||||||
/* Cache the memory-mapped boot media. */
|
/* Cache the memory-mapped boot media. */
|
||||||
if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED))
|
if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED))
|
||||||
postcar_frame_add_mtrr(&pcf, -CONFIG_ROM_SIZE, CONFIG_ROM_SIZE,
|
postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE,
|
||||||
MTRR_TYPE_WRPROT);
|
MTRR_TYPE_WRPROT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -142,8 +142,8 @@ asmlinkage void car_stage_entry(void)
|
|||||||
postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
|
postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
|
||||||
|
|
||||||
/* Cache the ROM as WP just below 4GiB. */
|
/* Cache the ROM as WP just below 4GiB. */
|
||||||
postcar_frame_add_mtrr(&pcf, 0xFFFFFFFF - CONFIG_ROM_SIZE + 1,
|
postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE,
|
||||||
CONFIG_ROM_SIZE, MTRR_TYPE_WRPROT);
|
MTRR_TYPE_WRPROT);
|
||||||
|
|
||||||
run_postcar_phase(&pcf);
|
run_postcar_phase(&pcf);
|
||||||
}
|
}
|
||||||
|
@@ -173,7 +173,7 @@ asmlinkage void car_stage_entry(void)
|
|||||||
|
|
||||||
/* Cache the memory-mapped boot media. */
|
/* Cache the memory-mapped boot media. */
|
||||||
if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED))
|
if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED))
|
||||||
postcar_frame_add_mtrr(&pcf, -CONFIG_ROM_SIZE, CONFIG_ROM_SIZE,
|
postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE,
|
||||||
MTRR_TYPE_WRPROT);
|
MTRR_TYPE_WRPROT);
|
||||||
#if IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)
|
#if IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)
|
||||||
/*
|
/*
|
||||||
|
@@ -80,8 +80,8 @@ asmlinkage void *car_stage_c_entry(void)
|
|||||||
postcar_frame_add_mtrr(&pcf, 0x80000000, 0x80000, MTRR_TYPE_WRBACK);
|
postcar_frame_add_mtrr(&pcf, 0x80000000, 0x80000, MTRR_TYPE_WRBACK);
|
||||||
|
|
||||||
/* Cache SPI flash - Write protect not supported */
|
/* Cache SPI flash - Write protect not supported */
|
||||||
postcar_frame_add_mtrr(&pcf, (uint32_t)(-CONFIG_ROM_SIZE),
|
postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE,
|
||||||
CONFIG_ROM_SIZE, MTRR_TYPE_WRTHROUGH);
|
MTRR_TYPE_WRTHROUGH);
|
||||||
|
|
||||||
run_postcar_phase(&pcf);
|
run_postcar_phase(&pcf);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -186,8 +186,8 @@ asmlinkage void car_stage_entry(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Cache the ROM as WP just below 4GiB. */
|
/* Cache the ROM as WP just below 4GiB. */
|
||||||
postcar_frame_add_mtrr(&pcf, 0xFFFFFFFF - CONFIG_ROM_SIZE + 1,
|
postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE,
|
||||||
CONFIG_ROM_SIZE, MTRR_TYPE_WRPROT);
|
MTRR_TYPE_WRPROT);
|
||||||
|
|
||||||
run_postcar_phase(&pcf);
|
run_postcar_phase(&pcf);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user