Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions configs/config.msi_ms7e56
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_OPTION_BACKEND_NONE=y
CONFIG_VENDOR_MSI=y
CONFIG_ONBOARD_VGA_IS_PRIMARY=y
CONFIG_VGA_BIOS=y
Expand All @@ -10,21 +11,24 @@ CONFIG_VGA_BIOS_FILE="Phoenix_generic_vbios.bin"
CONFIG_EDK2_BOOT_MANAGER_ESCAPE=y
CONFIG_EDK2_FOLLOW_BGRT_SPEC=y
CONFIG_BOARD_MSI_PRO_B850_P=y
CONFIG_TPM_MEASURED_BOOT=y
CONFIG_EDK2_BOOTSPLASH_FILE="3rdparty/dasharo-blobs/dasharo/bootsplash.bmp"
CONFIG_PCIEXP_COMMON_CLOCK=y
CONFIG_ALWAYS_ALLOW_ABOVE_4G_ALLOCATION=y
CONFIG_SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE=y
# CONFIG_ON_DEVICE_ROM_LOAD is not set
CONFIG_YABEL_PCI_ACCESS_OTHER_DEVICES=y
CONFIG_YABEL_DIRECTHW=y
CONFIG_NO_GFX_INIT=y
CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_DRIVERS_EFI_VARIABLE_STORE=y
CONFIG_DRIVERS_EFI_FW_INFO=y
CONFIG_TPM2=y
# CONFIG_TPM_HASH_SHA1 is not set
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0=y
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_TAG_OR_REV="origin/cbmem_pci_rb_info"
CONFIG_EDK2_DEBUG=y
CONFIG_EDK2_CBMEM_LOGGING=y
CONFIG_EDK2_LOAD_OPTION_ROMS=y
# CONFIG_EDK2_PS2_SUPPORT is not set
CONFIG_EDK2_CUSTOM_BUILD_PARAMS="--pcd gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask=0x07"
CONFIG_EDK2_SERIAL_SUPPORT=y
CONFIG_EDK2_ENABLE_IPXE=y
CONFIG_IPXE_STABLE=y
CONFIG_IPXE_ADD_SCRIPT=y
Expand All @@ -43,17 +47,16 @@ CONFIG_EDK2_DASHARO_NETWORK_CONFIG=y
CONFIG_EDK2_DASHARO_CHIPSET_CONFIG=y
CONFIG_EDK2_DASHARO_POWER_CONFIG=y
CONFIG_EDK2_DASHARO_PCI_CONFIG=y
CONFIG_EDK2_DASHARO_NETWORK_BOOT_DEFAULT_ENABLE=y
CONFIG_EDK2_DASHARO_SERIAL_REDIRECTION_DEFAULT_ENABLE=y
CONFIG_EDK2_BOOT_MENU_KEY=0x0015
CONFIG_EDK2_SETUP_MENU_KEY=0x0008
CONFIG_EDK2_CREATE_PREINSTALLED_BOOT_OPTIONS=y
CONFIG_EDK2_USE_UEFIVAR_BACKED_TPM_PPI=y
CONFIG_EDK2_ENABLE_FAST_BOOT_FEATURE=y
CONFIG_EDK2_ENABLE_QUIET_BOOT_FEATURE=y
# CONFIG_EDK2_GRAPHICAL_CAPSULE_PROGRESS is not set
# CONFIG_EDK2_FUM_AUTO_IPXE_BOOT is not set
CONFIG_DISPLAY_MTRRS=y
CONFIG_OPENSIL_DEBUG_PREFIX=y
CONFIG_OPENSIL_DEBUG_APOB=y
# CONFIG_OPENSIL_DEBUG_FCH is not set
# CONFIG_OPENSIL_DEBUG_XUSL_CMN is not set
7 changes: 5 additions & 2 deletions payloads/external/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,11 @@ $(obj)/UEFIPAYLOAD.fd: $(DOTCONFIG) $(IPXE_EFI)
CONFIG_EDK2_DASHARO_IBECC_OPTION=$(CONFIG_EDK2_DASHARO_IBECC_OPTION) \
CONFIG_EDK2_DASHARO_SPD_PROFILE_OPTION=$(CONFIG_EDK2_DASHARO_SPD_PROFILE_OPTION) \
CONFIG_EDK2_CAPSULE_ON_DISK_SUPPORT=$(CONFIG_EDK2_CAPSULE_ON_DISK_SUPPORT) \
CONFIG_EDK2_SHOW_CAPSULE_REPORT=$(CONFIG_EDK2_SHOW_CAPSULE_REPORT)

CONFIG_EDK2_SHOW_CAPSULE_REPORT=$(CONFIG_EDK2_SHOW_CAPSULE_REPORT) \
CONFIG_EDK2_AMD_GOP_DRIVER=$(CONFIG_EDK2_AMD_GOP_DRIVER) \
CONFIG_EDK2_VGA_BIOS_VENDOR_ID=0x$(word 1,$(subst $(comma),$(spc),$(call strip_quotes,$(CONFIG_VGA_BIOS_ID)))) \
CONFIG_EDK2_VGA_BIOS_DEVICE_ID=0x$(word 2,$(subst $(comma),$(spc),$(call strip_quotes,$(CONFIG_VGA_BIOS_ID)))) \
CONFIG_VGA_BIOS_FILE=$(CONFIG_VGA_BIOS_FILE)

$(obj)/ShimmedUniversalPayload.elf: $(DOTCONFIG)
$(MAKE) -C payloads/external/edk2 UniversalPayload \
Expand Down
10 changes: 9 additions & 1 deletion payloads/external/edk2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,17 @@ config EDK2_GOP_DRIVER
help
Select this option to have edk2 use an external GOP driver for display init.

config EDK2_AMD_GOP_DRIVER
bool "Add an AMD GOP driver to the Tianocore build"
depends on VGA_BIOS && NO_GFX_INIT && !EDK2_REPO_OFFICIAL && !EDK2_DISABLE_OPTION_ROMS
default y if VGA_BIOS && NO_GFX_INIT && EDK2_REPO_MRCHROMEBOX
help
Select this option to have edk2 use an external GOP driver for AMD display init.

config EDK2_GOP_FILE
string "GOP driver file"
depends on EDK2_GOP_DRIVER
depends on EDK2_GOP_DRIVER || EDK2_AMD_GOP_DRIVER
default "AmdGopDriver.efi" if EDK2_AMD_GOP_DRIVER
default "IntelGopDriver.efi"
help
The name of the GOP driver file passed to edk2.
Expand Down
12 changes: 11 additions & 1 deletion payloads/external/edk2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,12 @@ endif
ifneq ($(CONFIG_EDK2_FUM_AUTO_IPXE_BOOT),y)
BUILD_STR += --pcd gDasharoSystemFeaturesTokenSpaceGuid.PcdFumAutoIpxeBoot=FALSE
endif

# USE_AMD_PLATFORM_GOP = FALSE
ifeq ($(CONFIG_EDK2_AMD_GOP_DRIVER),y)
BUILD_STR += -D USE_AMD_PLATFORM_GOP=TRUE
BUILD_STR += --pcd gDasharoPayloadPkgTokenSpaceGuid.AmdVbiosOptionRomVendorId=$(CONFIG_EDK2_VGA_BIOS_VENDOR_ID)
BUILD_STR += --pcd gDasharoPayloadPkgTokenSpaceGuid.AmdVbiosOptionRomDeviceId=$(CONFIG_EDK2_VGA_BIOS_DEVICE_ID)
endif
endif # !CONFIG_EDK2_REPO_OFFICIAL

#
Expand Down Expand Up @@ -549,6 +554,11 @@ gop_driver: $(EDK2_PATH)
cp $(top)/$(CONFIG_EDK2_GOP_FILE) $(EDK2_PATH)/$(PAYLOAD_NAME)/IntelGopDriver.efi; \
cp $(top)/$(CONFIG_INTEL_GMA_VBT_FILE) $(EDK2_PATH)/$(PAYLOAD_NAME)/vbt.bin; \
fi; \
if [ -n "$(CONFIG_EDK2_AMD_GOP_DRIVER)" ]; then \
echo "Using GOP driver $(CONFIG_EDK2_GOP_FILE)"; \
cp $(top)/$(CONFIG_EDK2_GOP_FILE) $(EDK2_PATH)/$(PAYLOAD_NAME)/AmdGopDriver.efi; \
cp $(top)/$(CONFIG_VGA_BIOS_FILE) $(EDK2_PATH)/$(PAYLOAD_NAME)/Vbios.bin; \
fi; \

lan_rom: $(EDK2_PATH)
case "$(CONFIG_EDK2_LAN_ROM_DRIVER)" in \
Expand Down
Binary file modified src/mainboard/msi/ms7e56/data.apcb
Binary file not shown.
Binary file modified src/mainboard/msi/ms7e56/data_rec.apcb
Binary file not shown.
Binary file modified src/mainboard/msi/ms7e56/data_rec68.apcb
Binary file not shown.
10 changes: 9 additions & 1 deletion src/mainboard/msi/ms7e56/devicetree.cb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,15 @@ chip soc/amd/phoenix
end

device ref gpp_bridge_a on # Internal GPP Bridge 0 to Bus A
device ref gfx on end # Internal GPU (GFX)
device ref gfx on
chip drivers/amd/opensil/mpio
register "type" = "IFTYPE_DDI"
register "ddi_connector" = "ConnHDMI"
register "aux" = "DdiAux1"
register "hdp" = "DdiHdp1"
device generic 0 on end
end
end # Internal GPU (GFX)
device ref gfx_hda on end # Display HD Audio Controller (GFXAZ)
device ref crypto on end # Crypto Coprocessor
device ref xhci_0 on
Expand Down
8 changes: 8 additions & 0 deletions src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ BOOTBLOCK_ADDR = BOOTBLOCK_END - CONFIG_C_ENV_BOOTBLOCK_SIZE;
* | (VERSTAGE_SIZE) |
* +--------------------------------+ VERSTAGE_ADDR
* | |
* | Promontory FW (if reqd) |
* | (256K) |
* +--------------------------------+ PROMONTORY_FW_ADDR
* | |
* | FSP-M |
* | (FSP_M_SIZE) |
* +--------------------------------+ FSP_M_ADDR
Expand Down Expand Up @@ -102,6 +106,10 @@ SECTIONS
REGION(fspm, CONFIG_FSP_M_ADDR, CONFIG_FSP_M_SIZE, 1)
#endif

#if CONFIG_PROMONTORY_FW_ADDR > 0
REGION(promontory, CONFIG_PROMONTORY_FW_ADDR, 256K, 4K)
#endif

#if CONFIG(VBOOT_SEPARATE_VERSTAGE) && !CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)
VERSTAGE(CONFIG_VERSTAGE_ADDR, CONFIG_VERSTAGE_SIZE)
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/soc/amd/common/block/include/amdblocks/psp_efs.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct embedded_firmware {
uint32_t reserved_2Ch;
uint32_t promontory_fw_ptr;
uint32_t lp_promontory_fw_ptr;
uint32_t reserved_38h;
uint32_t promontory19_fw_ptr;
uint32_t reserved_3Ch;
uint8_t spi_readmode_f15_mod_60_6f;
uint8_t fast_speed_new_f15_mod_60_6f;
Expand All @@ -65,5 +65,6 @@ struct embedded_firmware {
} __packed __aligned(16);

bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed);
size_t efs_read_promontory_fw(void *buf);

#endif /* AMD_COMMON_PSP_EFS_H */
1 change: 1 addition & 0 deletions src/soc/amd/common/block/psp/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ smm-y += psp_smm.c

bootblock-y += psp_efs.c
verstage-y += psp_efs.c
ramstage-y += psp_efs.c

all-y += ftpm.c

Expand Down
63 changes: 63 additions & 0 deletions src/soc/amd/common/block/psp/psp_efs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
#include <amdblocks/psp_efs.h>
#include <boot_device.h>
#include <commonlib/region.h>
#include <console/console.h>
#include <device/mmio.h>
#include <string.h>
#include <types.h>

#define PSP_FW_FILE_HEADER_SIZE 256

bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed)
{
bool ret = false;
Expand All @@ -28,3 +32,62 @@ bool read_efs_spi_settings(uint8_t *mode, uint8_t *speed)
rdev_munmap(boot_device_ro(), efs);
return ret;
}

size_t efs_read_promontory_fw(void *buf)
{
struct embedded_firmware *efs;
const struct region_device *boot_dev = boot_device_ro();
uint8_t file_header[PSP_FW_FILE_HEADER_SIZE + 8];
size_t read_bytes, fw_size;
uint32_t offset;

if (!boot_dev || !buf)
return 0;

efs = rdev_mmap(boot_dev, EFS_OFFSET, sizeof(*efs));
if (!efs)
return 0;

if (efs->signature != EMBEDDED_FW_SIGNATURE) {
rdev_munmap(boot_dev, efs);
return 0;
}

offset = efs->promontory_fw_ptr;
rdev_munmap(boot_dev, efs);

read_bytes = rdev_readat(boot_dev, file_header, offset, sizeof(file_header));
if (read_bytes != sizeof(file_header))
return 0;

/* Get Promontory FW size */
if (strncmp((char *)&file_header[0x10], "$PS1", 4)) {
/* Check Promontory FW signature */
if (!strncmp((char *)file_header, "_PT_", 4))
fw_size = *(uint32_t *)&file_header[4];
else
return 0;
} else {
/* Check Promontory FW signature */
if (!strncmp((char *)&file_header[PSP_FW_FILE_HEADER_SIZE], "_PT_", 4))
fw_size = *(uint32_t *)&file_header[PSP_FW_FILE_HEADER_SIZE + 4];
else
return 0;

offset += PSP_FW_FILE_HEADER_SIZE;
}

if (fw_size > 256 * KiB) {
printk(BIOS_DEBUG, "Found Promontory FW too big (size: %lx)\n", fw_size);
return 0;
}

printk(BIOS_DEBUG, "Found Promontory FW @ 0x%08x (size: %lx)\n",
offset, fw_size);

read_bytes = rdev_readat(boot_dev, buf, offset, fw_size);
if (read_bytes != fw_size)
return 0;

return fw_size;
}
9 changes: 9 additions & 0 deletions src/soc/amd/phoenix/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ config VERSTAGE_ADDR
Sets the address in DRAM where verstage should be loaded if running
as a separate stage on x86.

config PROMONTORY_FW_ADDR
hex
default 0x21A0000 if SOC_AMD_PHOENIX_AM5
default 0x0
help
Sets the address in DRAM where Promontory FW should be loaded on AM5.
Promontory needs ~160KB of space. We allocate 256KB between romstage
and verstage, so that it will be placed in early reserved DRAM.

config VERSTAGE_SIZE
hex
depends on VBOOT_SEPARATE_VERSTAGE
Expand Down
6 changes: 6 additions & 0 deletions src/vendorcode/amd/opensil/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ config OPENSIL_DEBUG_GFX
help
Enable printing graphics related messages.

config OPENSIL_DEBUG_PROM
bool "Enable Promontory messages"
default y
help
Enable printing Promontory related messages.

config OPENSIL_DEBUG_XUSL_CMN
bool "Enable xUSL CommonLib messages"
default y
Expand Down
4 changes: 3 additions & 1 deletion src/vendorcode/amd/opensil/phoenix_poc/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define DEBUG_FILTER_CXL 0x00000200UL
#define DEBUG_FILTER_RCMGR 0x00000800UL
#define DEBUG_FILTER_GFX 0x00001000UL
#define DEBUG_FILTER_PROM 0x00002000UL

#define SIL_DEBUG(topic) (CONFIG(OPENSIL_DEBUG_##topic) ? DEBUG_FILTER_##topic : 0)

Expand All @@ -28,4 +29,5 @@
SIL_DEBUG(RAS) | \
SIL_DEBUG(CXL) | \
SIL_DEBUG(RCMGR) | \
SIL_DEBUG(GFX))
SIL_DEBUG(GFX) | \
SIL_DEBUG(PROM))
Loading
Loading