From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by mx.groups.io with SMTP id smtpd.web12.61758.1597739070955454189 for ; Tue, 18 Aug 2020 01:24:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@9elements.com header.s=google header.b=bal00yug; spf=pass (domain: 9elements.com, ip: 209.85.218.68, mailfrom: marcello.bauer@9elements.com) Received: by mail-ej1-f68.google.com with SMTP id qc22so21040483ejb.4 for ; Tue, 18 Aug 2020 01:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U4Kd6UFSM1pNzh034RwXRF4MECRtOQ646C4axp0Bodk=; b=bal00yugCIjRDMXYegZ5INFBqNiBOJhXThj3VorkP/YbZi2FGZqFzL1JVnWKlzWV9t jzuS+xEaxU0Yx72uVzk5sZZHOXeOT++oqAJ28gBALNPz+XsF0OOrMish3esyiVgnLMgE FD7tCuElhI6uqw7UiiUkY/ZatEdPYVG1tecGejGarhEgrVRjqdiHskfI71H1THkfUszY T1fToV+BUxbJW6NhTxgqxlVah8//b4EiYU9XWbKncGud+keOgjU2HCnkXTSQgjLijNVG HlEWemBNHOK1CvL1klDGmjLjbD3ZiGxDuhxgBxTLF1vv7MqeFyq6W+9qEAvmxQ3mGpwG qWQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U4Kd6UFSM1pNzh034RwXRF4MECRtOQ646C4axp0Bodk=; b=pQRHMysl9KjbFI/KZ7vcqNvxEahsGBwCDaI/n6JONTp5FfWaKIdpchBgOhmOw4xf9T BAdD2d4rnc7PfgJNW4fqGwKLGiUsX1c+zPusHseklyPvJdnz30GjUkup/EOkLaL25OYt RR+vrksD4Kv71SO6ytNnzYKUcTDdzoklsQOrUmsjXClqcGY35H4Gto2DJUeiMRYoqVEJ gaiAoeYYlGirskTImzVN1b9R4OX2sMMCPEuYx484T/SKf0de1y3eeWE8YMlk1vFIir9A V+lHdvg0iCruWp1GtSa8cidpdE0GpID8qc6XSsbiX65n7NCjoeNtpiBbE27uj57ZXeag oz/Q== X-Gm-Message-State: AOAM530UA/WgcP4AgyM1VyMVkSNHDoWLr9kgeBxEMCCxrl51HqKD13vJ BRyQVZJfLhQ2GygdaR5B4cVxf/e3h0PNaA== X-Google-Smtp-Source: ABdhPJzYrZnVzWLcfmuy9MMNoXIeUsLrrJITTsDYF2nAE/n7uV8L4JQbdHJDyzT/NdSCi5gGWzndBg== X-Received: by 2002:a17:906:c2c8:: with SMTP id ch8mr18219020ejb.161.1597739069233; Tue, 18 Aug 2020 01:24:29 -0700 (PDT) Return-Path: Received: from T14.dut.n1ce.space ([2a02:908:e851:d750:9068:4d6d:42f:ebc8]) by smtp.gmail.com with ESMTPSA id z9sm15980030ejj.51.2020.08.18.01.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 01:24:28 -0700 (PDT) From: "Marcello Sylvester Bauer" To: devel@edk2.groups.io Cc: Patrick Rudolph , Christian Walter , Maurice Ma , Nate DeSimone , Benjamin You Subject: [PATCH v5 3/3] UefiPayloadPkg: Support variable size MMCONF space Date: Tue, 18 Aug 2020 10:24:21 +0200 Message-Id: <20200818082421.6168-4-marcello.bauer@9elements.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818082421.6168-1-marcello.bauer@9elements.com> References: <20200818082421.6168-1-marcello.bauer@9elements.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The default size is still 256MiB, but will be overwritten by UefiPayloadPkg with the real MMCONF size. e.g.: On embedded AMD platforms the MMCONF window size is usually only 64MiB. Fixes crash on platforms not exposing 256 buses. Tested on: * AMD Stoney Ridge Signed-off-by: Patrick Rudolph Signed-off-by: Marcello Sylvester Bauer Cc: Patrick Rudolph Cc: Christian Walter Cc: Maurice Ma Cc: Nate DeSimone Cc: Benjamin You --- UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 1 + UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf | 1 + UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/Uefi= PayloadPkgIa32X64.dsc index 942bc9076634..5898a474f9e9 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc @@ -365,6 +365,7 @@ [PcdsDynamicDefault] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31=0D gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100=0D gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0=0D + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0=0D =0D ##########################################################################= ######=0D #=0D diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf b/UefiPayloadPkg/= BlSupportDxe/BlSupportDxe.inf index 1371d5eb7952..cebc81135565 100644 --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf @@ -54,6 +54,7 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution=0D gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution=0D gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress=0D + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize=0D =0D [Depex]=0D TRUE=0D diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c b/UefiPayloadPkg/Bl= SupportDxe/BlSupportDxe.c index a3974dcc02f8..a746d0581ee3 100644 --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c @@ -155,13 +155,15 @@ BlDxeEntryPoint ( }=0D =0D //=0D - // Set PcdPciExpressBaseAddress by HOB info=0D + // Set PcdPciExpressBaseAddress and PcdPciExpressBaseSize by HOB info=0D //=0D GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid);=0D if (GuidHob !=3D NULL) {=0D AcpiBoardInfo =3D (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);=0D Status =3D PcdSet64S (PcdPciExpressBaseAddress, AcpiBoardInfo->PcieBas= eAddress);=0D ASSERT_EFI_ERROR (Status);=0D + Status =3D PcdSet64S (PcdPciExpressBaseSize, AcpiBoardInfo->PcieBaseSi= ze);=0D + ASSERT_EFI_ERROR (Status);=0D }=0D =0D return EFI_SUCCESS;=0D --=20 2.28.0