From patchwork Tue Dec 11 18:35:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153494 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp949137ljp; Tue, 11 Dec 2018 10:35:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/U0tWZlcLinCdodnL+DUGZfKuexmbmQlxMuWwvJ2V7snRdQLIb18j04it+5hF5i2sPGSTAH X-Received: by 2002:a63:9041:: with SMTP id a62mr15168469pge.163.1544553336921; Tue, 11 Dec 2018 10:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544553336; cv=none; d=google.com; s=arc-20160816; b=xba02R5jbCacWz3/1t5OQcOsl3y4vqPtX+bs5wYdA6D3/KDUAgvDnDA3ykhyHbGqmZ BK1dRJ4Qv2kFW+iQF83/Bs+qt1KibitooIyTO491rTL3+6AIUra3fYsvnyHE7uyGpcDs bpxR+mgTaCFcQmncod9w4AMJ1j4cyA8vnqR6sREc/amveM01ZtrxsvwxQ8+gRpi25YWm pN95pwOm4gg5/Xyndc2SriL7T1OPnMntP8l02lCHMwJbnq3FvBdGmdWmBXn3VunBvcH3 iJMDhVecZeLe99byF1vXf2lIiG9vzq9v/ZWsg5iNRqr0fD5HyQN7Jd5NwJeIVtwcOU3Q a8Uw== 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=mKOT2/wIG6W5N3GcaWWiAiedXB1atldOL8cEC4tQuZg=; b=wicYSTd70kN3S85CejLhPkvZA3N1VczOepXIPqBPOhHmWRmTDTEImfD9rwiMEmPwVC jBLkrl+I+SmtFYkWtQobu1J0ugxWHSrkbQBA7t8MD7KlK2q6Nj0VWPW6lzvnvqmfr7jW BRopCqSmgBbOall5kt8rDXLAG24zkYGDrUybg66Q2KsFiXACx/fJVyQ0w8TF2mXWWVxO DJX+XCHGjSMkN8/jfgIdevGjqwLB7jnbfYdn4b56tSilkrWY84nsXkMscsh7jNaUP4c9 AsIwLVGGPdJCkftNGCRrRsmZthtpwLkrhwSQQlLCSJqS6B7Q5KhA/cFFh3780OjUVokJ raWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="jYxYF/RT"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id h91si12883080pld.411.2018.12.11.10.35.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:35:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="jYxYF/RT"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 9B3662119A472; Tue, 11 Dec 2018 10:35:30 -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::342; helo=mail-wm1-x342.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (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 205042119A47D for ; Tue, 11 Dec 2018 10:35:29 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id y1so3259956wmi.3 for ; Tue, 11 Dec 2018 10:35:29 -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=Kwf56v88IsPOuYUQDkHP1ZI9tHjHxvzBCYF0Z0hhQUk=; b=jYxYF/RTD1J18ak/ER1TrcyU9yR/VcI8eR3aq3j2MRbs80vGPCtLBxkIdvK7KoeWDP ed/dXM1LNAkNplQA/Tg8zFJxNsFnmHHgyz84ZT2MaU/t5mlE27SqMnEk1X1h34FlajJj 7U8nQ516+FH/c0MdOp+dSnOK7FFOrb6lWyxek= 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=Kwf56v88IsPOuYUQDkHP1ZI9tHjHxvzBCYF0Z0hhQUk=; b=RTGjPLNTlO0Frq3phb6kKwnphQ9HYe7L18kqbWV3wA+Bhte6DLq0x9Srzmg4fTX0Uv NVJPIFDmF3Pj9SDNMwpZt7sLx54OYU7qe32oa2QaYK7fYzm7vd9qHRH4AnwEqGh9qOpf Kuj/UsqaJmPkfAoOvwdfHKSHiyvlHY8sRTLSNn8Ie+K4v8wBS3rJoXDnVe8CoPoDX1kg smkidXCp7Tr0A75JpZht0HQa7uX6CQsoB3rQLtU5fc23SEtAizauRKIMjeoBfPa6kT4H GnfRmD7KrGkrIdLhVecF3p3fp+mOu9sTRJWalbYqSRgA05y9xKQblz0p1P9OCFyAcDNi DA0Q== X-Gm-Message-State: AA+aEWYbAlYgF/A+jyT9TdRD0zPNTt3Y7mKOg00IOCU0HxiOPBkupbdH LOOfwca3UxWRlbCJMRQyV8J/y7EUArJsXw== X-Received: by 2002:a1c:66c5:: with SMTP id a188mr3265816wmc.129.1544553327320; Tue, 11 Dec 2018 10:35:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:35:26 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 11 Dec 2018 19:35:07 +0100 Message-Id: <20181211183514.20948-5-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 04/11] Silicon/AMD/Styx/PlatInitPei: 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/PlatInitPei/PlatInitPei.inf | 1 + Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c | 41 ++++++++++---------- 2 files changed, 21 insertions(+), 21 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/PlatInitPei/PlatInitPei.inf b/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.inf index b8829a4a9c3e..99cf01347ab7 100644 --- a/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.inf +++ b/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.inf @@ -58,6 +58,7 @@ gAmdStyxMpCoreInfoGuid ## PRODUCER [Pcd] + gAmdModulePkgTokenSpaceGuid.PcdXgbeEnable gArmTokenSpaceGuid.PcdSystemMemorySize gArmPlatformTokenSpaceGuid.PcdCoreCount gAmdStyxTokenSpaceGuid.PcdSocCoreCount diff --git a/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c b/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c index 3cd650eee36b..932be55b600a 100644 --- a/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c +++ b/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c @@ -121,10 +121,8 @@ PlatInitPeiEntryPoint ( AMD_MEMORY_RANGE_DESCRIPTOR IscpMemDescriptor = {0}; ISCP_FUSE_INFO IscpFuseInfo = {0}; ISCP_CPU_RESET_INFO CpuResetInfo = {0}; -#if DO_XGBE == 1 ISCP_MAC_INFO MacAddrInfo = {0}; UINTN MacSize; -#endif UINTN CpuCoreCount, CpuMap, CpuMapSize; UINTN Index, CoreNum; UINT32 *CpuIdReg = (UINT32 *)FixedPcdGet32 (PcdCpuIdRegister); @@ -217,27 +215,28 @@ PlatInitPeiEntryPoint ( DEBUG ((EFI_D_ERROR, "SystemMemorySize = %ld\n", PcdGet64 (PcdSystemMemorySize))); -#if DO_XGBE == 1 - // Get MAC Address from ISCP - Status = PeiIscpPpi->ExecuteGetMacAddressTransaction ( - PeiServices, &MacAddrInfo ); - ASSERT_EFI_ERROR (Status); - MacSize = sizeof(MacAddrInfo.MacAddress0); - Status = PcdSetPtrS (PcdEthMacA, &MacSize, MacAddrInfo.MacAddress0); - ASSERT_EFI_ERROR (Status); - Status = PcdSetPtrS (PcdEthMacB, &MacSize, MacAddrInfo.MacAddress1); - ASSERT_EFI_ERROR (Status); + if (FixedPcdGetBool (PcdXgbeEnable)) { + // Get MAC Address from ISCP + Status = PeiIscpPpi->ExecuteGetMacAddressTransaction ( + PeiServices, &MacAddrInfo ); + ASSERT_EFI_ERROR (Status); - DEBUG ((EFI_D_ERROR, "EthMacA = %02x:%02x:%02x:%02x:%02x:%02x\n", - ((UINT8 *)PcdGetPtr (PcdEthMacA))[0], ((UINT8 *)PcdGetPtr (PcdEthMacA))[1], - ((UINT8 *)PcdGetPtr (PcdEthMacA))[2], ((UINT8 *)PcdGetPtr (PcdEthMacA))[3], - ((UINT8 *)PcdGetPtr (PcdEthMacA))[4], ((UINT8 *)PcdGetPtr (PcdEthMacA))[5])); - DEBUG ((EFI_D_ERROR, "EthMacB = %02x:%02x:%02x:%02x:%02x:%02x\n", - ((UINT8 *)PcdGetPtr (PcdEthMacB))[0], ((UINT8 *)PcdGetPtr (PcdEthMacB))[1], - ((UINT8 *)PcdGetPtr (PcdEthMacB))[2], ((UINT8 *)PcdGetPtr (PcdEthMacB))[3], - ((UINT8 *)PcdGetPtr (PcdEthMacB))[4], ((UINT8 *)PcdGetPtr (PcdEthMacB))[5])); -#endif + MacSize = sizeof(MacAddrInfo.MacAddress0); + Status = PcdSetPtrS (PcdEthMacA, &MacSize, MacAddrInfo.MacAddress0); + ASSERT_EFI_ERROR (Status); + Status = PcdSetPtrS (PcdEthMacB, &MacSize, MacAddrInfo.MacAddress1); + ASSERT_EFI_ERROR (Status); + + DEBUG ((EFI_D_ERROR, "EthMacA = %02x:%02x:%02x:%02x:%02x:%02x\n", + ((UINT8 *)PcdGetPtr (PcdEthMacA))[0], ((UINT8 *)PcdGetPtr (PcdEthMacA))[1], + ((UINT8 *)PcdGetPtr (PcdEthMacA))[2], ((UINT8 *)PcdGetPtr (PcdEthMacA))[3], + ((UINT8 *)PcdGetPtr (PcdEthMacA))[4], ((UINT8 *)PcdGetPtr (PcdEthMacA))[5])); + DEBUG ((EFI_D_ERROR, "EthMacB = %02x:%02x:%02x:%02x:%02x:%02x\n", + ((UINT8 *)PcdGetPtr (PcdEthMacB))[0], ((UINT8 *)PcdGetPtr (PcdEthMacB))[1], + ((UINT8 *)PcdGetPtr (PcdEthMacB))[2], ((UINT8 *)PcdGetPtr (PcdEthMacB))[3], + ((UINT8 *)PcdGetPtr (PcdEthMacB))[4], ((UINT8 *)PcdGetPtr (PcdEthMacB))[5])); + } // Let other PEI modules know we're done! Status = (*PeiServices)->InstallPpi (PeiServices, &mPlatInitPpiDescriptor);