Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/21855
Change subject: soc/amd/common: Expand UMA settings in agesawrapper ......................................................................
soc/amd/common: Expand UMA settings in agesawrapper
Use devicetree "register" values to set the UMA configuration that will be passed to AGESA. This reduces the number of overrides required in the mainboard directory. Note that any overrides currently in place are not affected.
This patch also removes the implicit check of CONFIG_GFXUMA being defined. The symbol is a bool and is always defined.
Change-Id: Ibea5bcdbb57744905e77353438c876e059168e05 Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/common/agesawrapper.c 1 file changed, 23 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/21855/1
diff --git a/src/soc/amd/common/agesawrapper.c b/src/soc/amd/common/agesawrapper.c index a269130..659797a 100644 --- a/src/soc/amd/common/agesawrapper.c +++ b/src/soc/amd/common/agesawrapper.c @@ -13,10 +13,13 @@ * GNU General Public License for more details. */
+#include <device/device.h> #include <AGESA.h> #include <cbfs.h> #include <cbmem.h> #include <delay.h> +#include <chip.h> +#include <soc/pci_devs.h> #include <cpu/x86/mtrr.h> #include <FchPlatform.h> #include <heapManager.h> @@ -114,6 +117,14 @@ AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; + const struct soc_amd_stoneyridge_config *cfg; + const struct device *dev = dev_find_slot(0, GNB_DEVFN); + if (!dev || !dev->chip_info) { + printk(BIOS_ERR, "BUG! Could not find SoC devicetree config\n"); + cfg = (struct soc_amd_stoneyridge_config *)NULL; + } else { + cfg = dev->chip_info; + }
LibAmdMemFill (&AmdParamStruct, 0, @@ -130,10 +141,18 @@ AmdCreateStruct (&AmdParamStruct); PostParams = (AMD_POST_PARAMS *)AmdParamStruct.NewStructPtr;
- // Do not use IS_ENABLED here. CONFIG_GFXUMA should always have a value. Allow - // the compiler to flag the error if CONFIG_GFXUMA is not set. - PostParams->MemConfig.UmaMode = CONFIG_GFXUMA ? UMA_AUTO : UMA_NONE; - PostParams->MemConfig.UmaSize = 0; + if (cfg) { + PostParams->MemConfig.UmaMode = cfg->uma_mode; + PostParams->MemConfig.UmaVersion = cfg->uma_type; + if (cfg->uma_mode == UMAMODE_SPECIFIED) + PostParams->MemConfig.UmaSize = cfg->uma_size; + else + PostParams->MemConfig.UmaSize = 0; + } else { + /* In case of a BIOS error, only attempt to set UMA. */ + PostParams->MemConfig.UmaMode = IS_ENABLED(CONFIG_GFXUMA) ? + UMA_AUTO : UMA_NONE; + } PostParams->MemConfig.BottomIo = (UINT16) (CONFIG_BOTTOMIO_POSITION >> 24);