From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AFSGD/XDPX9w5gCnZwfQ5v1VZzrShNyG+dBpA+APDDh7lF4TguhYCVqTtcYCFGTAFPoIcqQUgaafSA== 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 Cc: leif.lindholm@linaro.org, alan@softiron.co.uk, Ard Biesheuvel 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: [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: , X-List-Received-Date: Tue, 11 Dec 2018 18:35:29 -0000 Content-Transfer-Encoding: 8bit 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(-) 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); -- 2.19.2