Attention is currently required from: Filip Brozovic.
Angel Pons has posted comments on this change by Filip Brozovic. ( https://review.coreboot.org/c/coreboot/+/85987?usp=email )
Change subject: CFR: add dependencies based on specific option values
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/85987?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Iaf7965551490969052eb27c207fa524470d4dd6a
Gerrit-Change-Number: 85987
Gerrit-PatchSet: 4
Gerrit-Owner: Filip Brozovic <fbrozovic(a)gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Filip Brozovic <fbrozovic(a)gmail.com>
Gerrit-Comment-Date: Thu, 06 Feb 2025 12:05:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Filip Brozovic, Sean Rhodes.
Angel Pons has posted comments on this change by Filip Brozovic. ( https://review.coreboot.org/c/coreboot/+/86080?usp=email )
Change subject: CFR: Add version field to root struct
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/86080?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ifcb950f1bdedc0ab925f3841befb7e7001c0f7f4
Gerrit-Change-Number: 86080
Gerrit-PatchSet: 2
Gerrit-Owner: Filip Brozovic <fbrozovic(a)gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sean Rhodes <sean(a)starlabs.systems>
Gerrit-Attention: Filip Brozovic <fbrozovic(a)gmail.com>
Gerrit-Comment-Date: Thu, 06 Feb 2025 12:04:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Felix Held, Fred Reitberger, Jason Glenesk, Matt DeVillier.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86300?usp=email )
Change subject: soc/amd/common/block/graphics: Support non VGA IGDs
......................................................................
soc/amd/common/block/graphics: Support non VGA IGDs
On glinda the IGD is no longer VGA compatible, thus use the
D-segment over C-segment for the VBIOS location.
Introduce a new Kconfig and select it where necessary to keep
existing behaviour on older SoC while fixing FSP GOP init on
glinda.
Change-Id: I6ab28aab74f3169d45d7d852a37ddfcfc75b7c88
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/soc/amd/cezanne/Kconfig
M src/soc/amd/common/block/graphics/Kconfig
M src/soc/amd/common/block/graphics/graphics.c
M src/soc/amd/mendocino/Kconfig
M src/soc/amd/phoenix/Kconfig
M src/soc/amd/picasso/Kconfig
M src/soc/amd/stoneyridge/Kconfig
7 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/86300/1
diff --git a/src/soc/amd/cezanne/Kconfig b/src/soc/amd/cezanne/Kconfig
index 7b97ce7..e8705a4 100644
--- a/src/soc/amd/cezanne/Kconfig
+++ b/src/soc/amd/cezanne/Kconfig
@@ -46,6 +46,7 @@
select SOC_AMD_COMMON_BLOCK_EMMC
select SOC_AMD_COMMON_BLOCK_GPP_CLK
select SOC_AMD_COMMON_BLOCK_GRAPHICS
+ select SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA
select SOC_AMD_COMMON_BLOCK_HAS_ESPI
select SOC_AMD_COMMON_BLOCK_I2C
select SOC_AMD_COMMON_BLOCK_I2C_PAD_CTRL
diff --git a/src/soc/amd/common/block/graphics/Kconfig b/src/soc/amd/common/block/graphics/Kconfig
index 3b2eaed..7b9f57b 100644
--- a/src/soc/amd/common/block/graphics/Kconfig
+++ b/src/soc/amd/common/block/graphics/Kconfig
@@ -35,3 +35,10 @@
help
Select this option to provide Audio CoProcessor ACPI device for pre-Ryzen APUs for
use by custom Windows drivers.
+
+config SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA
+ bool
+ depends on SOC_AMD_COMMON_BLOCK_GRAPHICS
+ help
+ Select this option when the IGD is VGA compatible. On newer platforms the IGD
+ advertises itself as a Display device, but not VGA Display controller.
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c
index 264cf0f..63fe4b1 100644
--- a/src/soc/amd/common/block/graphics/graphics.c
+++ b/src/soc/amd/common/block/graphics/graphics.c
@@ -151,7 +151,10 @@
if (!CONFIG(RUN_FSP_GOP))
return NULL;
- return (void *)(uintptr_t)PCI_VGA_RAM_IMAGE_START;
+ if (CONFIG(SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA))
+ return (void *)(uintptr_t)PCI_VGA_RAM_IMAGE_START;
+
+ return (void *)(uintptr_t)PCI_RAM_IMAGE_START;
}
static void graphics_set_resources(struct device *const dev)
diff --git a/src/soc/amd/mendocino/Kconfig b/src/soc/amd/mendocino/Kconfig
index ee6c968..3fdb20f 100644
--- a/src/soc/amd/mendocino/Kconfig
+++ b/src/soc/amd/mendocino/Kconfig
@@ -50,6 +50,7 @@
select SOC_AMD_COMMON_BLOCK_ESPI_EXTENDED_DECODE_RANGES
select SOC_AMD_COMMON_BLOCK_GPP_CLK
select SOC_AMD_COMMON_BLOCK_GRAPHICS
+ select SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA
select SOC_AMD_COMMON_BLOCK_HAS_ESPI
select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
select SOC_AMD_COMMON_BLOCK_I2C
diff --git a/src/soc/amd/phoenix/Kconfig b/src/soc/amd/phoenix/Kconfig
index b15c12d..261cf3a 100644
--- a/src/soc/amd/phoenix/Kconfig
+++ b/src/soc/amd/phoenix/Kconfig
@@ -45,6 +45,7 @@
select SOC_AMD_COMMON_BLOCK_ESPI_EXTENDED_DECODE_RANGES
select SOC_AMD_COMMON_BLOCK_GPP_CLK
select SOC_AMD_COMMON_BLOCK_GRAPHICS # TODO: Check if this is still correct
+ select SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA
select SOC_AMD_COMMON_BLOCK_HAS_ESPI
select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
select SOC_AMD_COMMON_BLOCK_I2C
diff --git a/src/soc/amd/picasso/Kconfig b/src/soc/amd/picasso/Kconfig
index f450e29..0b61284 100644
--- a/src/soc/amd/picasso/Kconfig
+++ b/src/soc/amd/picasso/Kconfig
@@ -41,6 +41,7 @@
select SOC_AMD_COMMON_BLOCK_EMMC_SKIP_POWEROFF
select SOC_AMD_COMMON_BLOCK_GPP_CLK
select SOC_AMD_COMMON_BLOCK_GRAPHICS
+ select SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA
select SOC_AMD_COMMON_BLOCK_HAS_ESPI
select SOC_AMD_COMMON_BLOCK_HDA
select SOC_AMD_COMMON_BLOCK_I2C
diff --git a/src/soc/amd/stoneyridge/Kconfig b/src/soc/amd/stoneyridge/Kconfig
index 47de102..cd08f58 100644
--- a/src/soc/amd/stoneyridge/Kconfig
+++ b/src/soc/amd/stoneyridge/Kconfig
@@ -27,6 +27,7 @@
select SOC_AMD_COMMON_BLOCK_CAR
select SOC_AMD_COMMON_BLOCK_CPUFREQ_FAM15H_16H
select SOC_AMD_COMMON_BLOCK_GRAPHICS
+ select SOC_AMD_COMMON_BLOCK_GRAPHICS_VGA
select SOC_AMD_COMMON_BLOCK_HDA
select SOC_AMD_COMMON_BLOCK_I2C
select SOC_AMD_COMMON_BLOCK_IOMMU
--
To view, visit https://review.coreboot.org/c/coreboot/+/86300?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I6ab28aab74f3169d45d7d852a37ddfcfc75b7c88
Gerrit-Change-Number: 86300
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Attention is currently required from: Andrey Petrov, Felix Held, Fred Reitberger, Intel coreboot Reviewers, Jason Glenesk, Matt DeVillier, Ronak Kanabar.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86299?usp=email )
Change subject: soc/amd/common/block/graphics: Use vbt_get()
......................................................................
soc/amd/common/block/graphics: Use vbt_get()
Implement vbt_get() on AMD and return the VBIOS location. This allows
to drop the hardcoded addresses used in various places and return an
address in DRAM that is reserved for FSP use.
Change-Id: I92d76fc4df88fbce792b9d7c912c6799617704a0
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/drivers/intel/fsp2_0/silicon_init.c
M src/soc/amd/cezanne/fsp_s_params.c
M src/soc/amd/common/block/graphics/graphics.c
A src/soc/amd/common/block/include/amdblocks/vbt.h
M src/soc/amd/glinda/fsp_s_params.c
M src/soc/amd/mendocino/fsp_s_params.c
M src/soc/amd/phoenix/fsp_s_params.c
M src/soc/amd/picasso/fsp_s_params.c
8 files changed, 44 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/86299/1
diff --git a/src/drivers/intel/fsp2_0/silicon_init.c b/src/drivers/intel/fsp2_0/silicon_init.c
index 1caf00f..fdac9f5 100644
--- a/src/drivers/intel/fsp2_0/silicon_init.c
+++ b/src/drivers/intel/fsp2_0/silicon_init.c
@@ -14,7 +14,12 @@
#include <mrc_cache.h>
#include <program_loading.h>
#include <soc/intel/common/reset.h>
+#if CONFIG(SOC_AMD_COMMON)
+#include <amdblocks/vbt.h>
+#endif
+#if CONFIG(SOC_INTEL_COMMON)
#include <soc/intel/common/vbt.h>
+#endif
#include <stage_cache.h>
#include <string.h>
#include <timestamp.h>
diff --git a/src/soc/amd/cezanne/fsp_s_params.c b/src/soc/amd/cezanne/fsp_s_params.c
index b9770f3..391461e 100644
--- a/src/soc/amd/cezanne/fsp_s_params.c
+++ b/src/soc/amd/cezanne/fsp_s_params.c
@@ -2,6 +2,7 @@
#include <acpi/acpi.h>
#include <amdblocks/apob_cache.h>
+#include <amdblocks/vbt.h>
#include <device/pci.h>
#include <fsp/api.h>
#include <program_loading.h>
@@ -13,7 +14,7 @@
* part of FSP GOP init. We can delay loading of the VBIOS until
* before FSP notify AFTER_PCI_ENUM.
*/
- scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
+ scfg->vbios_buffer = (uintptr_t)vbt_get();
}
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c
index 77420ae..264cf0f 100644
--- a/src/soc/amd/common/block/graphics/graphics.c
+++ b/src/soc/amd/common/block/graphics/graphics.c
@@ -4,6 +4,7 @@
#include <acpi/acpigen.h>
#include <amdblocks/graphics.h>
#include <amdblocks/vbios_cache.h>
+#include <amdblocks/vbt.h>
#include <boot/coreboot_tables.h>
#include <bootmode.h>
#include <bootstate.h>
@@ -12,7 +13,6 @@
#include <device/pci.h>
#include <fmap.h>
#include <security/vboot/vbios_cache_hash_tpm.h>
-#include <soc/intel/common/vbt.h>
#include <timestamp.h>
static bool vbios_loaded_from_cache = false;
@@ -146,18 +146,12 @@
return "IGFX";
}
-/*
- * On AMD platforms the VBT is called ATOMBIOS and is always part of the
- * VGA Option ROM. As part of the FSP GOP init the ATOMBIOS tables are
- * updated in place. Thus the VBIOS must be loaded into RAM before FSP GOP
- * runs. The address of the VBIOS must be passed to FSP-S using UPDs, but
- * loading of the VBIOS can be delayed until before FSP AFTER_PCI_ENUM
- * notify is called. FSP expects a pointer to the PCI option rom instead
- * a pointer to the ATOMBIOS table directly.
- */
void *vbt_get(void)
{
- return NULL;
+ if (!CONFIG(RUN_FSP_GOP))
+ return NULL;
+
+ return (void *)(uintptr_t)PCI_VGA_RAM_IMAGE_START;
}
static void graphics_set_resources(struct device *const dev)
@@ -259,12 +253,12 @@
}
/* copy from PCI_VGA_RAM_IMAGE_START to rdev */
- if (rdev_writeat(&rw_vbios_cache, (void *)PCI_VGA_RAM_IMAGE_START, 0,
+ if (rdev_writeat(&rw_vbios_cache, vbt_get(), 0,
VBIOS_CACHE_FMAP_SIZE) != VBIOS_CACHE_FMAP_SIZE)
printk(BIOS_ERR, "Failed to save vbios data to flash; rdev_writeat() failed.\n");
/* copy modified vbios data from PCI_VGA_RAM_IMAGE_START to buffer before hashing */
- memcpy(vbios_data, (void *)PCI_VGA_RAM_IMAGE_START, VBIOS_CACHE_FMAP_SIZE);
+ memcpy(vbios_data, vbt_get(), VBIOS_CACHE_FMAP_SIZE);
/* save data hash to TPM NVRAM for validation on subsequent boots */
vbios_cache_update_hash(vbios_data, VBIOS_CACHE_FMAP_SIZE);
@@ -280,7 +274,7 @@
void vbios_load_from_cache(void)
{
/* copy cached vbios data from buffer to PCI_VGA_RAM_IMAGE_START */
- memcpy((void *)PCI_VGA_RAM_IMAGE_START, vbios_data, VBIOS_CACHE_FMAP_SIZE);
+ memcpy(vbt_get(), vbios_data, VBIOS_CACHE_FMAP_SIZE);
/* mark cache as used so we know not to write it later */
vbios_loaded_from_cache = true;
diff --git a/src/soc/amd/common/block/include/amdblocks/vbt.h b/src/soc/amd/common/block/include/amdblocks/vbt.h
new file mode 100644
index 0000000..38ed8f3
--- /dev/null
+++ b/src/soc/amd/common/block/include/amdblocks/vbt.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _AMD_BLOCK_VBT_H_
+#define _AMD_BLOCK_VBT_H_
+
+/*
+ * On AMD platforms the VBT is called ATOMBIOS and is always part of the
+ * VGA Option ROM. As part of the FSP GOP init the ATOMBIOS tables are
+ * updated in place. Thus the VBIOS must be loaded into RAM before FSP GOP
+ * runs. The address of the VBIOS must be passed to FSP-S using UPDs, but
+ * loading of the VBIOS can be delayed until before FSP AFTER_PCI_ENUM
+ * notify is called. FSP expects a pointer to the PCI option rom instead
+ * a pointer to the ATOMBIOS table directly.
+ *
+ * Returns a pointer to the VGA Option ROM in DRAM after checking
+ * prerequisites for Pre OS Graphics initialization. When returning
+ * non NULL the Option ROM might not be loaded at this address yet,
+ * but is guaranted to be present at end of BS_DEV_RESOURCES phase.
+ */
+void *vbt_get(void);
+#endif
diff --git a/src/soc/amd/glinda/fsp_s_params.c b/src/soc/amd/glinda/fsp_s_params.c
index e037957..980eea8 100644
--- a/src/soc/amd/glinda/fsp_s_params.c
+++ b/src/soc/amd/glinda/fsp_s_params.c
@@ -4,6 +4,7 @@
#include <acpi/acpi.h>
#include <amdblocks/apob_cache.h>
+#include <amdblocks/vbt.h>
#include <device/pci.h>
#include <fsp/api.h>
#include <program_loading.h>
@@ -15,7 +16,7 @@
* part of FSP GOP init. We can delay loading of the VBIOS until
* before FSP notify AFTER_PCI_ENUM.
*/
- scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
+ scfg->vbios_buffer = (uintptr_t)vbt_get();
}
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
diff --git a/src/soc/amd/mendocino/fsp_s_params.c b/src/soc/amd/mendocino/fsp_s_params.c
index 5c37334..5393eba 100644
--- a/src/soc/amd/mendocino/fsp_s_params.c
+++ b/src/soc/amd/mendocino/fsp_s_params.c
@@ -5,6 +5,7 @@
#include <acpi/acpi.h>
#include <amdblocks/apob_cache.h>
#include <amdblocks/vbios_cache.h>
+#include <amdblocks/vbt.h>
#include <bootmode.h>
#include <bootsplash.h>
#include <console/console.h>
@@ -26,7 +27,7 @@
* before FSP notify AFTER_PCI_ENUM.
*/
printk(BIOS_SPEW, "%s: not using VBIOS cache; running GOP driver.\n", __func__);
- scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
+ scfg->vbios_buffer = (uintptr_t)vbt_get();
}
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
diff --git a/src/soc/amd/phoenix/fsp_s_params.c b/src/soc/amd/phoenix/fsp_s_params.c
index 883cde0..9ce09f8 100644
--- a/src/soc/amd/phoenix/fsp_s_params.c
+++ b/src/soc/amd/phoenix/fsp_s_params.c
@@ -4,6 +4,7 @@
#include <acpi/acpi.h>
#include <amdblocks/apob_cache.h>
+#include <amdblocks/vbt.h>
#include <device/pci.h>
#include <fsp/api.h>
#include <program_loading.h>
@@ -15,7 +16,7 @@
* part of FSP GOP init. We can delay loading of the VBIOS until
* before FSP notify AFTER_PCI_ENUM.
*/
- scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
+ scfg->vbios_buffer = (uintptr_t)vbt_get();
}
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
diff --git a/src/soc/amd/picasso/fsp_s_params.c b/src/soc/amd/picasso/fsp_s_params.c
index d4cfa27..fd6f817 100644
--- a/src/soc/amd/picasso/fsp_s_params.c
+++ b/src/soc/amd/picasso/fsp_s_params.c
@@ -2,6 +2,7 @@
#include <assert.h>
#include <amdblocks/ioapic.h>
+#include <amdblocks/vbt.h>
#include <device/pci.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
@@ -190,7 +191,7 @@
* part of FSP GOP init. We can delay loading of the VBIOS until
* before FSP notify AFTER_PCI_ENUM.
*/
- scfg->vbios_buffer_addr = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
+ scfg->vbios_buffer_addr = (uintptr_t)vbt_get();
}
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
--
To view, visit https://review.coreboot.org/c/coreboot/+/86299?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I92d76fc4df88fbce792b9d7c912c6799617704a0
Gerrit-Change-Number: 86299
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Intel coreboot Reviewers <intel_coreboot_reviewers(a)intel.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Intel coreboot Reviewers <intel_coreboot_reviewers(a)intel.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Attention: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Attention: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86298?usp=email )
Change subject: soc/amd: Document VBIOS handling
......................................................................
soc/amd: Document VBIOS handling
The code flow isn't that obvious in the beginning. You pass an address
of the VBIOS to FSP, but don't load any VBIOS until BS_DEV_RESOURCES
phase.
Add comments to document what is done and when. This will help to improve
the code in the next step.
Change-Id: I643bc9088306d99cc0fbb79648809e16b068fb33
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/soc/amd/cezanne/fsp_s_params.c
M src/soc/amd/common/block/graphics/graphics.c
M src/soc/amd/glinda/fsp_s_params.c
M src/soc/amd/mendocino/fsp_s_params.c
M src/soc/amd/phoenix/fsp_s_params.c
M src/soc/amd/picasso/fsp_s_params.c
6 files changed, 38 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/86298/1
diff --git a/src/soc/amd/cezanne/fsp_s_params.c b/src/soc/amd/cezanne/fsp_s_params.c
index 60f3942..b9770f3 100644
--- a/src/soc/amd/cezanne/fsp_s_params.c
+++ b/src/soc/amd/cezanne/fsp_s_params.c
@@ -8,6 +8,11 @@
static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg)
{
+ /*
+ * The VBIOS contains the ATOMBIOS tables that will be modified as
+ * part of FSP GOP init. We can delay loading of the VBIOS until
+ * before FSP notify AFTER_PCI_ENUM.
+ */
scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
}
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c
index ea7308a..77420ae 100644
--- a/src/soc/amd/common/block/graphics/graphics.c
+++ b/src/soc/amd/common/block/graphics/graphics.c
@@ -147,9 +147,13 @@
}
/*
- * Even though AMD does not need VBT we still need to implement the
- * vbt_get() function to not break the build with GOP driver enabled
- * (see fsps_return_value_handler() in fsp2_0/silicon_init.c
+ * On AMD platforms the VBT is called ATOMBIOS and is always part of the
+ * VGA Option ROM. As part of the FSP GOP init the ATOMBIOS tables are
+ * updated in place. Thus the VBIOS must be loaded into RAM before FSP GOP
+ * runs. The address of the VBIOS must be passed to FSP-S using UPDs, but
+ * loading of the VBIOS can be delayed until before FSP AFTER_PCI_ENUM
+ * notify is called. FSP expects a pointer to the PCI option rom instead
+ * a pointer to the ATOMBIOS table directly.
*/
void *vbt_get(void)
{
@@ -165,6 +169,7 @@
if (!CONFIG(RUN_FSP_GOP))
return;
+ /* Load the VBIOS before FSP AFTER_PCI_ENUM notify is called. */
timestamp_add_now(TS_OPROM_INITIALIZE);
if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid() &&
!display_init_required()) {
@@ -172,6 +177,11 @@
timestamp_add_now(TS_OPROM_COPY_END);
return;
}
+
+ /*
+ * VBIOS cache was not used, so load it from CBFS and let FSP GOP
+ * initialize the ATOMBIOS tables.
+ */
rom = pci_rom_probe(dev);
if (rom == NULL) {
printk(BIOS_ERR, "%s: Unable to find ROM for %s\n",
diff --git a/src/soc/amd/glinda/fsp_s_params.c b/src/soc/amd/glinda/fsp_s_params.c
index 597f7a9..e037957 100644
--- a/src/soc/amd/glinda/fsp_s_params.c
+++ b/src/soc/amd/glinda/fsp_s_params.c
@@ -10,6 +10,11 @@
static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg)
{
+ /*
+ * The VBIOS contains the ATOMBIOS tables that will be modified as
+ * part of FSP GOP init. We can delay loading of the VBIOS until
+ * before FSP notify AFTER_PCI_ENUM.
+ */
scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
}
diff --git a/src/soc/amd/mendocino/fsp_s_params.c b/src/soc/amd/mendocino/fsp_s_params.c
index 50923e9..5c37334 100644
--- a/src/soc/amd/mendocino/fsp_s_params.c
+++ b/src/soc/amd/mendocino/fsp_s_params.c
@@ -20,6 +20,11 @@
printk(BIOS_SPEW, "%s: using VBIOS cache; skipping GOP driver.\n", __func__);
return;
}
+ /*
+ * The VBIOS contains the ATOMBIOS tables that will be modified as
+ * part of FSP GOP init. We can delay loading of the VBIOS until
+ * before FSP notify AFTER_PCI_ENUM.
+ */
printk(BIOS_SPEW, "%s: not using VBIOS cache; running GOP driver.\n", __func__);
scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
}
diff --git a/src/soc/amd/phoenix/fsp_s_params.c b/src/soc/amd/phoenix/fsp_s_params.c
index 46c8e76..883cde0 100644
--- a/src/soc/amd/phoenix/fsp_s_params.c
+++ b/src/soc/amd/phoenix/fsp_s_params.c
@@ -10,6 +10,11 @@
static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg)
{
+ /*
+ * The VBIOS contains the ATOMBIOS tables that will be modified as
+ * part of FSP GOP init. We can delay loading of the VBIOS until
+ * before FSP notify AFTER_PCI_ENUM.
+ */
scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
}
diff --git a/src/soc/amd/picasso/fsp_s_params.c b/src/soc/amd/picasso/fsp_s_params.c
index 9f491d6..d4cfa27 100644
--- a/src/soc/amd/picasso/fsp_s_params.c
+++ b/src/soc/amd/picasso/fsp_s_params.c
@@ -185,6 +185,11 @@
static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg)
{
+ /*
+ * The VBIOS contains the ATOMBIOS tables that will be modified as
+ * part of FSP GOP init. We can delay loading of the VBIOS until
+ * before FSP notify AFTER_PCI_ENUM.
+ */
scfg->vbios_buffer_addr = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/86298?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I643bc9088306d99cc0fbb79648809e16b068fb33
Gerrit-Change-Number: 86298
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Attention is currently required from: Jarried Lin, Kenji Yu.
Yu-Ping Wu has posted comments on this change by Kenji Yu. ( https://review.coreboot.org/c/blobs/+/86293?usp=email )
Change subject: soc/mediatek/mt8196: Update SSPM firmware to v4.0
......................................................................
Patch Set 3: Code-Review+2 Verified+1
--
To view, visit https://review.coreboot.org/c/blobs/+/86293?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: blobs
Gerrit-Branch: main
Gerrit-Change-Id: Ic717aba8ec18c55659cb3197c19984718646bfec
Gerrit-Change-Number: 86293
Gerrit-PatchSet: 3
Gerrit-Owner: Kenji Yu <kenji.yu(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Jarried Lin <jarried.lin(a)mediatek.com>
Gerrit-Reviewer: Yidi Lin <yidilin(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Kenji Yu <kenji.yu(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Jarried Lin <jarried.lin(a)mediatek.com>
Gerrit-Comment-Date: Thu, 06 Feb 2025 09:53:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes