From patchwork Wed Apr 5 13:53:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96865 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp274037qgd; Wed, 5 Apr 2017 06:53:38 -0700 (PDT) X-Received: by 10.99.181.86 with SMTP id u22mr30498140pgo.102.1491400418236; Wed, 05 Apr 2017 06:53:38 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id i12si20680588pfj.412.2017.04.05.06.53.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 06:53:38 -0700 (PDT) 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; 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 0DAF7203BF021; Wed, 5 Apr 2017 06:53:36 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x231.google.com (mail-wr0-x231.google.com [IPv6:2a00:1450:400c:c0c::231]) (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 52C5C21A0480F for ; Wed, 5 Apr 2017 06:53:34 -0700 (PDT) Received: by mail-wr0-x231.google.com with SMTP id t20so15990985wra.1 for ; Wed, 05 Apr 2017 06:53:34 -0700 (PDT) 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; bh=A0d/qrbY1+kKN42A/7tgfFNMum/V+ddUw0BMXSpscjE=; b=U+psxGy1EJYqz/BinTwzBezU7CCWYCteCyRG25CMgk+Df7PeQSIQqGTEYDSw/M2NOp qViI5wXawAPCwazzYohnCq12YHztEMS1K7eWM7o5nZg2FyyiTv8LYsFluUt89tjIHElW Qbv01XjCeKnGsg6oNn99911flp7RX4v4UwHaQ= 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; bh=A0d/qrbY1+kKN42A/7tgfFNMum/V+ddUw0BMXSpscjE=; b=nXIwHYvZnlKlzHxiYgsvNUyk5l7Z9nG4zo/eYv2lxo14nt0JDemZvXMD4BVgUDAng5 ly7qIYsPSvPJJpUNDGmZ//slb7asY5KaUfTxgbxVgMGBB213r2SCx4B3rsXsqhuBWSZI mbLT4n4YCsKH6QXYkZdv7vnavw/jbarF1e+ATmfZDqbAszZBPMuP8SqlVl2RUnakS5V5 DbXNiZ1s3bU3TyAO2/qtvsjld1DTph9LgYC8UQ3fd+W+mPikegEomOcbYWIAOBPI3tjE LplEetpX+tx+5WmOE5T9qIyXWsquWwruuEAxm8CVHLqvaccZlalX/DBZIfa0nQt8RJIM gWEg== X-Gm-Message-State: AN3rC/7l6EsGDFqtvegnt0hnFAwsXoFeKNd+jg/E/JuQnl3hL/hAeP3r eJDoDB2kX/4p7DvMx+zNDA== X-Received: by 10.28.16.148 with SMTP id 142mr668620wmq.75.1491400412721; Wed, 05 Apr 2017 06:53:32 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id y29sm18881023wmh.3.2017.04.05.06.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 06:53:32 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 5 Apr 2017 14:53:09 +0100 Message-Id: <20170405135311.26798-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170405135311.26798-1-ard.biesheuvel@linaro.org> References: <20170405135311.26798-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v4 4/6] ArmPlatformPkg/ArmJunoDxe: don't register OnEndOfDxe event on rev R0 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryan.harkin@linaro.org, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The ArmJunoDxe driver code registers a callback for the EndOfDxe event, at which time it does some manipulation of the PCI peripherals on the board. Given that R0 has no working PCIe, instead of conditionally performing these operations, omit the registration of the callback altogether on that platform. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 43 +++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c index 14ff189a3078..f7e33961b4e7 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c @@ -379,7 +379,6 @@ OnEndOfDxe ( EFI_DEVICE_PATH_PROTOCOL* PciRootComplexDevicePath; EFI_HANDLE Handle; EFI_STATUS Status; - UINT32 JunoRevision; // // PCI Root Complex initialization @@ -395,13 +394,9 @@ OnEndOfDxe ( Status = gBS->ConnectController (Handle, NULL, PciRootComplexDevicePath, FALSE); ASSERT_EFI_ERROR (Status); - GetJunoRevision (JunoRevision); - - if (JunoRevision != JUNO_REVISION_R0) { - Status = ArmJunoSetNicMacAddress (); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "ArmJunoDxe: Failed to set Marvell Yukon NIC MAC address\n")); - } + Status = ArmJunoSetNicMacAddress (); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ArmJunoDxe: Failed to set Marvell Yukon NIC MAC address\n")); } } @@ -511,22 +506,6 @@ ArmJunoEntryPoint ( } } - // - // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group. - // The "OnEndOfDxe()" function is declared as the call back function. - // It will be called at the end of the DXE phase when an event of the - // same group is signalled to inform about the end of the DXE phase. - // Install the INSTALL_FDT_PROTOCOL protocol. - // - Status = gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - OnEndOfDxe, - NULL, - &gEfiEndOfDxeEventGroupGuid, - &EndOfDxeEvent - ); - // Install dynamic Shell command to run baremetal binaries. Status = ShellDynCmdRunAxfInstall (ImageHandle); if (EFI_ERROR (Status)) { @@ -555,6 +534,22 @@ ArmJunoEntryPoint ( // Enable PCI enumeration PcdSetBool (PcdPciDisableBusEnumeration, FALSE); + // + // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group. + // The "OnEndOfDxe()" function is declared as the call back function. + // It will be called at the end of the DXE phase when an event of the + // same group is signalled to inform about the end of the DXE phase. + // Install the INSTALL_FDT_PROTOCOL protocol. + // + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + OnEndOfDxe, + NULL, + &gEfiEndOfDxeEventGroupGuid, + &EndOfDxeEvent + ); + // Declare the related ACPI Tables EfiCreateProtocolNotifyEvent ( &gEfiAcpiTableProtocolGuid,