From: Simon Glass Date: Sat, 7 Dec 2019 04:42:12 +0000 (-0700) Subject: x86: Set up the MTRR for SDRAM X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=42791100180943c0f776a325843c66540e9595e7;p=u-boot.git x86: Set up the MTRR for SDRAM Set up MTRRs for the FSP SDRAM regions to improve performance. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- diff --git a/arch/x86/lib/fsp/fsp_dram.c b/arch/x86/lib/fsp/fsp_dram.c index 987cb4f8f3..9ce0ddf0d3 100644 --- a/arch/x86/lib/fsp/fsp_dram.c +++ b/arch/x86/lib/fsp/fsp_dram.c @@ -9,6 +9,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -61,6 +62,8 @@ int dram_init_banksize(void) gd->bd->bi_dram[bank].start = res_desc->phys_start; gd->bd->bi_dram[bank].size = res_desc->len; + mtrr_add_request(MTRR_TYPE_WRBACK, res_desc->phys_start, + res_desc->len); log_debug("ram %llx %llx\n", gd->bd->bi_dram[bank].start, gd->bd->bi_dram[bank].size); } @@ -69,6 +72,8 @@ int dram_init_banksize(void) gd->bd->bi_dram[0].start = 0; gd->bd->bi_dram[0].size = low_end; + mtrr_add_request(MTRR_TYPE_WRBACK, 0, low_end); + return 0; }