Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84225?usp=email )
Change subject: nb/intel/sandybridge: Add Kconfig to set default IGD allocation ......................................................................
nb/intel/sandybridge: Add Kconfig to set default IGD allocation
Add a Kconfig choice to select the default IGD memory allocation, for users/boards which do not use an option table to set it.
TEST=build/boot google/link, verify IGD size changes with selection.
Change-Id: I83d57cf4657cfccbb21416c5da05eeff9e95a44f Signed-off-by: Matt DeVillier matt.devillier@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/84225 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/northbridge/intel/sandybridge/Kconfig M src/northbridge/intel/sandybridge/early_init.c 2 files changed, 31 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/northbridge/intel/sandybridge/Kconfig b/src/northbridge/intel/sandybridge/Kconfig index fa40b06..973eed8 100644 --- a/src/northbridge/intel/sandybridge/Kconfig +++ b/src/northbridge/intel/sandybridge/Kconfig @@ -180,4 +180,32 @@ config PRERAM_CBFS_CACHE_SIZE default 0x0
+choice + prompt "Default IGD Memory Allocation" + default IGD_DEFAULT_UMA_SIZE_32MB + help + The amount of system memory allocated for the integrated GPU if not + set via an option table. + +config IGD_DEFAULT_UMA_SIZE_32MB + bool "32MB" + +config IGD_DEFAULT_UMA_SIZE_64MB + bool "64MB" + +config IGD_DEFAULT_UMA_SIZE_96MB + bool "96MB" + +config IGD_DEFAULT_UMA_SIZE_128MB + bool "128MB" + +endchoice + +config IGD_DEFAULT_UMA_INDEX + int + default 0 if IGD_DEFAULT_UMA_SIZE_32MB + default 1 if IGD_DEFAULT_UMA_SIZE_64MB + default 2 if IGD_DEFAULT_UMA_SIZE_96MB + default 3 if IGD_DEFAULT_UMA_SIZE_128MB + endif diff --git a/src/northbridge/intel/sandybridge/early_init.c b/src/northbridge/intel/sandybridge/early_init.c index a5ebf9d..1d8a1e8 100644 --- a/src/northbridge/intel/sandybridge/early_init.c +++ b/src/northbridge/intel/sandybridge/early_init.c @@ -86,9 +86,10 @@
printk(BIOS_DEBUG, "Initializing Graphics...\n");
- /* Fall back to 32 MiB for IGD memory by setting GGC[7:3] = 1 */ - gfxsize = get_uint_option("gfx_uma_size", 0); + /* Fall back to CONFIG_IGD_DEFAULT_UMA_INDEX for IGD memory */ + gfxsize = get_uint_option("gfx_uma_size", CONFIG_IGD_DEFAULT_UMA_INDEX);
+ /* Program IGD memory allocation by setting GGC[7:3] */ reg16 = pci_read_config16(HOST_BRIDGE, GGC); reg16 &= ~0x00f8; reg16 |= (gfxsize + 1) << 3;