From patchwork Tue Dec 11 18:35:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153493 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp949072ljp; Tue, 11 Dec 2018 10:35:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/VvLf23hBT7Dbx9awVabI4zQ61hqejTwm7UXc3+8sxJOtU8P9hAHfmKK8jP5p1NRdY7ugmo X-Received: by 2002:a63:d904:: with SMTP id r4mr15591184pgg.207.1544553332641; Tue, 11 Dec 2018 10:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544553332; cv=none; d=google.com; s=arc-20160816; b=YFNbqkQ0sjUXUvSrhlIoREtjaP0VCuCRHjRi1hHWvfkH/E4286E9Oy37vw/xDryPaH l1eawbzimadKnJO1wTyGXKU5Ti3L2UscfjA3vLShE86eETrEZYYE5V323MIA6BWeRHjU vKWq3G0r+elMKLF/m2UlOb4LnaBK1DViQ9D15KqcUIfp6joxhLNvt1sfqmB48SAr+GoO uJYliFA2Xm2rDqVsipd0aey7MXPLqHIJK0COfaomB2LETzRasF7CDkwwk3ZFciXi+TZm ZB3ZhJbncT2ogQ6TL8exam7TxwlYIAEoFraHJadNArovk0QrFO6DoCn6LiIcYugeAQzf 0RSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=cdhh0ecZ89O5gCqOHi1CNoqSFzfBivPmHg0+Aweumwk=; b=ieqZzMrVcNzsrpQOtpQLdEgAUb13mCTF8QYa7CR/akm69cS4sHckLGXwMgt4FGukXe aH/CKXlP+9d8rRhKELL3MHLpK+OdqyBNMvOTrKUjm19l8VXIRoFQJuhRg3y65+yv0Uy1 QHyAHDEaggEwMpL3c6RAmBhW23ysgTYSlLGb67oNolOA7GKTjF4M7QofLsWJ77EwmKhV aJAa896xGyvuzIXPJapj7Lt/RiKOgPPJo0ymTvL5vo7b/T6H2lPVUIe6fcHdJlB/yQEl XOiIoLnW6+hH4q617o9SZomxwBYbebiI3/LsGoah8W9T2QDcql0J0l2bhxDYyEjee1f/ oeGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gdIdYSOt; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id z186si12587397pgd.90.2018.12.11.10.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:35:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gdIdYSOt; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6D2212119A86D; Tue, 11 Dec 2018 10:35:29 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EB6D421199256 for ; Tue, 11 Dec 2018 10:35:27 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id z5so15134133wrt.11 for ; Tue, 11 Dec 2018 10:35:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cEt0KjzVfw5EGPG4WML7zMdltpjto+Jk+NomA+x1UMo=; b=gdIdYSOtMzL5+zc5UlMIFfjSUImza2eoZNZNQ/B8nCIdjWUXYt+A/0P1t9FEkheI30 lk9qyEt+ZkbDfsas8qtIhflxWh+7MWZtFHBvTdxXm1mCoRQvJUytxTSBzal1r+iisiPI buD4O+DG54/zNW17HdvNYQVjOHJmOAKNJBfKI= 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=cEt0KjzVfw5EGPG4WML7zMdltpjto+Jk+NomA+x1UMo=; b=PQwGzPg0zm6sHBFPqMGnlWrYdJ9XKCFa1TqzovCnljjFIwyU8YEzvaAe1KyNmtKk41 M0j51uVz4bCl6KHyFjpJt6ZToacprBiVUmSB1l7HtaqSAeSZNeMGf9OQAA5OGcPAJU0V iZJCbi0pJ+Thc9wuTM0eC75SsKaANsNEpVu8kXQgg6XstyFe/NwQMWMMAp6CvSr2b7Ma zuueTxIH/mcre7GdmAElrPU6ZilQI1g6wsEEj05AgXfsrvyqKHIljtqPSQEAH9fr4/u4 6hq5i4nxTINEF/JTlt9DcD32MGENFcn8gRC9Vc5icW8FVzKpXcjMe+01+bjpbwD/sTlF cdRw== X-Gm-Message-State: AA+aEWakAXxEmCAsCGzIGySHxe2oSUPI7cq1jIJ4+yjsACYQFpHOPK2Q Mh1J0WAtmrnXVpX3oBWTqQzkaWHBZ4twnA== X-Received: by 2002:adf:f091:: with SMTP id n17mr14457591wro.292.1544553326159; Tue, 11 Dec 2018 10:35:26 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:8c3:6b9d:cbc9:58c6]) by smtp.gmail.com with ESMTPSA id h131sm1026688wmd.17.2018.12.11.10.35.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:35:25 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 11 Dec 2018 19:35:06 +0100 Message-Id: <20181211183514.20948-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181211183514.20948-1-ard.biesheuvel@linaro.org> References: <20181211183514.20948-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH edk2-platforms 03/11] Silicon/AMD/Styx/AcpiPlatformDxe: replace XGBE CPP conditional with PCD X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alan@softiron.co.uk Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" We already have a boolean PCD that tells us whether XGBE support should be enabled, so use it instead of C preprocessor conditionals. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf index be885d6aea90..d27431343f4b 100644 --- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -68,6 +68,7 @@ gAmdStyxTokenSpaceGuid.PcdSocCpuId [FixedPcd] + gAmdModulePkgTokenSpaceGuid.PcdXgbeEnable gAmdStyxTokenSpaceGuid.PcdCntControlBase gAmdStyxTokenSpaceGuid.PcdCntReadBase gAmdStyxTokenSpaceGuid.PcdCntCTLBase diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c index 9c17c38a04bf..9c8c8b09d4a4 100644 --- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c +++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c @@ -43,7 +43,6 @@ STATIC EFI_ACPI_TABLE_PROTOCOL *mAcpiTableProtocol; STATIC AMD_MP_CORE_INFO_PROTOCOL *mAmdMpCoreInfoProtocol; -#if DO_XGBE STATIC CONST UINT8 mDefaultMacPackageA[] = { 0x12, 0xe, 0x6, 0xa, 0x2, 0xa, 0xa1, 0xa, 0xa2, 0xa, 0xa3, 0xa, 0xa4, 0xa, 0xa5 @@ -91,8 +90,6 @@ PatchAmlPackage ( } } -#endif - STATIC VOID EnableAvailableCores ( @@ -135,10 +132,7 @@ InstallSystemDescriptionTables ( EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort; EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; EFI_ACPI_5_1_GIC_STRUCTURE *GicC; - -#if DO_XGBE UINT8 MacPackage[sizeof(mDefaultMacPackageA)]; -#endif CpuId = PcdGet32 (PcdSocCpuId); @@ -158,7 +152,10 @@ InstallSystemDescriptionTables ( break; case SIGNATURE_64 ('S', 't', 'y', 'x', 'X', 'g', 'b', 'e'): -#if DO_XGBE + if (!FixedPcdGetBool (PcdXgbeEnable)) { + continue; + } + // // Patch the SSDT binary with the correct MAC addresses // @@ -173,8 +170,6 @@ InstallSystemDescriptionTables ( (UINT8 *)Table, TableSize); break; -#endif - continue; default: switch (Table->Signature) {