soc/intel/skylake: Add/use enums for IGD config
Add enums for the IGD aperture size and DVMT/stolen memory size, as is done for newer SoCs. Use these enums rather than their int values when configuring the IGD. Change-Id: I16dbfcd1862ea0c43c62eef59e35ca144a1b2715 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87624 Reviewed-by: Maxim Polyakov <max.senia.poliak@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
947dd07823
commit
c8199f26e0
3 changed files with 33 additions and 11 deletions
|
|
@ -30,6 +30,21 @@ enum skylake_i2c_voltage {
|
|||
I2C_VOLTAGE_1V8
|
||||
};
|
||||
|
||||
/* Gfx related */
|
||||
enum igd_dvmt50_pre_alloc {
|
||||
IGD_SM_0MB = 0x00,
|
||||
IGD_SM_32MB = 0x01,
|
||||
IGD_SM_64MB = 0x02,
|
||||
IGD_SM_96MB = 0x03,
|
||||
IGD_SM_128MB = 0x04,
|
||||
};
|
||||
|
||||
enum igd_aperture_size {
|
||||
IGD_AP_SZ_128MB = 0x00,
|
||||
IGD_AP_SZ_256MB = 0x01,
|
||||
IGD_AP_SZ_512MB = 0x02,
|
||||
};
|
||||
|
||||
struct soc_intel_skylake_config {
|
||||
/* Common struct containing soc config data required by common code */
|
||||
struct soc_intel_common_config common_soc_config;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#define SKYLAKE_CFR_H
|
||||
|
||||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <soc/soc_chip.h>
|
||||
|
||||
/* FSP hyperthreading */
|
||||
static const struct sm_object hyper_threading = SM_DECLARE_ENUM({
|
||||
|
|
@ -26,11 +27,11 @@ static const struct sm_object igd_aperture = SM_DECLARE_ENUM({
|
|||
.opt_name = "igd_aperture_size",
|
||||
.ui_name = "IGD Aperture Size",
|
||||
.ui_helptext = "Select the Aperture Size",
|
||||
.default_value = 1,
|
||||
.default_value = IGD_AP_SZ_256MB,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "128 MB", 0 },
|
||||
{ "256 MB", 1 },
|
||||
{ "512 MB", 2 },
|
||||
{ "128 MB", IGD_AP_SZ_128MB },
|
||||
{ "256 MB", IGD_AP_SZ_256MB },
|
||||
{ "512 MB", IGD_AP_SZ_512MB },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
|
|
@ -39,12 +40,12 @@ static const struct sm_object igd_dvmt = SM_DECLARE_ENUM({
|
|||
.opt_name = "igd_dvmt_prealloc",
|
||||
.ui_name = "IGD DVMT Size",
|
||||
.ui_helptext = "Size of memory preallocated for internal graphics",
|
||||
.default_value = 2,
|
||||
.default_value = IGD_SM_64MB,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "32 MB", 1 },
|
||||
{ "64 MB", 2 },
|
||||
{ "96 MB", 3 },
|
||||
{ "128 MB", 4 },
|
||||
{ "32 MB", IGD_SM_32MB },
|
||||
{ "64 MB", IGD_SM_64MB },
|
||||
{ "96 MB", IGD_SM_96MB },
|
||||
{ "128 MB", IGD_SM_128MB },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -116,8 +116,14 @@ static void soc_primary_gfx_config_params(FSP_M_CONFIG *m_cfg,
|
|||
*
|
||||
* If disabled, don't reserve memory for it.
|
||||
*/
|
||||
m_cfg->IgdDvmt50PreAlloc = m_cfg->InternalGfx ? get_uint_option("igd_dvmt_prealloc", 2) : 0;
|
||||
m_cfg->ApertureSize = get_uint_option("igd_aperture_size", 1);
|
||||
if (m_cfg->InternalGfx) {
|
||||
/* IGD is enabled, set IGD stolen size to 64MB. */
|
||||
m_cfg->IgdDvmt50PreAlloc = get_uint_option("igd_dvmt_prealloc", IGD_SM_64MB);
|
||||
m_cfg->ApertureSize = get_uint_option("igd_aperture_size", IGD_AP_SZ_256MB);
|
||||
} else {
|
||||
/* IGD is disabled, skip IGD init in FSP. */
|
||||
m_cfg->IgdDvmt50PreAlloc = 0;
|
||||
}
|
||||
|
||||
m_cfg->PrimaryDisplay = config->PrimaryDisplay;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue