From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by mx.groups.io with SMTP id smtpd.web11.51047.1595837942210308751 for ; Mon, 27 Jul 2020 01:19:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@9elements.com header.s=google header.b=Y1H3CNtU; spf=pass (domain: 9elements.com, ip: 209.85.222.194, mailfrom: marcello.bauer@9elements.com) Received: by mail-qk1-f194.google.com with SMTP id u64so14462586qka.12 for ; Mon, 27 Jul 2020 01:19:02 -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=nK3AoScPHvZ8I37ICsKhuIka8rU1DJQhIiGx2iAZd3w=; b=Y1H3CNtUbcFjfYF7vUl5adfiRa2BwL5DrvQB6J5glGfEtufEBcI4B8pMsR3oGUdt/+ wXn9lfMsBdjNKHcONmh+YYwLhELLYOAGvtVZEA8OivIUVVnYDjOLicyQf2vUGzRcVFX1 ONIB3el/IBvTT5hK2t1IHpWa/XvTrUGu2IuHIHjcVFKh4l79+ZhHjTIVGoT9t57OlCnw vHAOJ2JzENs6Gg5gms/DCGx9fcGYHzbZSMkIh0FZ2X2Cqjpf7WHwoBv5ncmL7E0s8OyM xxu6l/KGQ7+MyXqJWmeGqLtUkG3iiW7yxBK4kf7Sgj8T9oKdnmgUzK2TfTNm18xyg/2N r45A== 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=nK3AoScPHvZ8I37ICsKhuIka8rU1DJQhIiGx2iAZd3w=; b=L6UDuTMUNzDKpvHQB7B5W+AVrAP3KQlRRv5HkLdhC25WBKK/P/73mtYx0RV95Nw/z4 H/qwM7rUVTCaxPRmT8rc4KIPT4LrbcUZA1YRQAjzZfuCls/Tp4wMF0pIjVuzkQVBnQ7p 630CVZCOcJ06eqAITOfnB14CWcTdUoLQyvN3s8Gh115QBuv6hyujhThzeDprEzQ+L0iH 40K7WZ2z5zCLftLTk+fDyIeHuuTGAxF7O2/JsCRyC055CoOCerMxgtvIZQyTTQatAjeZ 22I0QCkT5oRLzO+hgi5YmX9UYCttA0GVgDbdsSY7rC61kCOQzkPuAVvqIj5SdbaFvuZV 77VA== X-Gm-Message-State: AOAM5317UAGa0bI3CQKhi7++dgZLJb+mYKi5wdluZBli6dhBt7e6j5Jd AvURrlQSrfv/40YEhNZ+9QblXNycOnY= X-Google-Smtp-Source: ABdhPJzUDINN4M877iVL0FTP8LPCQIYOjEwG2Xjq9opWa6AHGnkoern63LOyH2I5v6If9wYDHz8PIQ== X-Received: by 2002:a37:62cc:: with SMTP id w195mr22469810qkb.33.1595837941024; Mon, 27 Jul 2020 01:19:01 -0700 (PDT) Return-Path: Received: from T14.n1ce.space ([2a02:908:e851:d750:39c4:c509:9b27:775a]) by smtp.gmail.com with ESMTPSA id m4sm14413550qtf.43.2020.07.27.01.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 01:18:59 -0700 (PDT) From: "Marcello Sylvester Bauer" To: devel@edk2.groups.io Cc: Patrick Rudolph , Christian Walter , Maurice Ma , Nate DeSimone , Benjamin You Subject: [PATCH v4 3/3] UefiPayloadPkg: Support variable size MMCONF space Date: Mon, 27 Jul 2020 10:18:42 +0200 Message-Id: <20200727081842.28843-4-marcello.bauer@9elements.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727081842.28843-1-marcello.bauer@9elements.com> References: <20200727081842.28843-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 a768a8702c66..162cbf47a83f 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc @@ -363,6 +363,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.27.0