drivers/amd/agesa: Use prepare_and_run_postcar
This removes some of the postcar setup boilerplate. Change-Id: I4f8f92b88ac16dd70ff4878dfc14e676386d4703 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61962 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include <cpu/x86/msr.h>
|
#include <cpu/x86/msr.h>
|
||||||
#include <cpu/x86/mtrr.h>
|
#include <cpu/x86/mtrr.h>
|
||||||
#include <northbridge/amd/agesa/agesa_helper.h>
|
#include <northbridge/amd/agesa/agesa_helper.h>
|
||||||
|
#include <romstage_handoff.h>
|
||||||
|
|
||||||
static void set_range_uc(u32 base, u32 size)
|
static void set_range_uc(u32 base, u32 size)
|
||||||
{
|
{
|
||||||
@@ -51,10 +52,11 @@ void fixup_cbmem_to_UC(int s3resume)
|
|||||||
set_range_uc(top_of_ram - 8 * MiB, 4 * MiB);
|
set_range_uc(top_of_ram - 8 * MiB, 4 * MiB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void recover_postcar_frame(struct postcar_frame *pcf, int s3resume)
|
static void recover_postcar_frame(struct postcar_frame *pcf)
|
||||||
{
|
{
|
||||||
msr_t base, mask;
|
msr_t base, mask;
|
||||||
int i;
|
int i;
|
||||||
|
int s3resume = romstage_handoff_is_resume();
|
||||||
|
|
||||||
/* Replicate non-UC MTRRs as left behind by AGESA.
|
/* Replicate non-UC MTRRs as left behind by AGESA.
|
||||||
*/
|
*/
|
||||||
@@ -86,3 +88,9 @@ void recover_postcar_frame(struct postcar_frame *pcf, int s3resume)
|
|||||||
MTRR_TYPE_WRBACK);
|
MTRR_TYPE_WRBACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fill_postcar_frame(struct postcar_frame *pcf)
|
||||||
|
{
|
||||||
|
pcf->skip_common_mtrr = 1;
|
||||||
|
recover_postcar_frame(pcf);
|
||||||
|
}
|
||||||
|
@@ -78,10 +78,7 @@ static void romstage_main(void)
|
|||||||
|
|
||||||
romstage_handoff_init(cb->s3resume);
|
romstage_handoff_init(cb->s3resume);
|
||||||
|
|
||||||
postcar_frame_init(&pcf);
|
prepare_and_run_postcar(&pcf);
|
||||||
recover_postcar_frame(&pcf, cb->s3resume);
|
|
||||||
|
|
||||||
run_postcar_phase(&pcf);
|
|
||||||
/* We do not return. */
|
/* We do not return. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,6 @@ void EmptyHeap(void);
|
|||||||
#define HIGH_MEMORY_SCRATCH 0x30000
|
#define HIGH_MEMORY_SCRATCH 0x30000
|
||||||
|
|
||||||
void fixup_cbmem_to_UC(int s3resume);
|
void fixup_cbmem_to_UC(int s3resume);
|
||||||
void recover_postcar_frame(struct postcar_frame *pcf, int s3resume);
|
|
||||||
|
|
||||||
void restore_mtrr(void);
|
void restore_mtrr(void);
|
||||||
void backup_mtrr(void *mtrr_store, u32 *mtrr_store_size);
|
void backup_mtrr(void *mtrr_store, u32 *mtrr_store_size);
|
||||||
|
Reference in New Issue
Block a user