From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::22f; helo=mail-lf0-x22f.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::22f]) (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 65A5821EA15B9 for ; Mon, 9 Oct 2017 09:50:39 -0700 (PDT) Received: by mail-lf0-x22f.google.com with SMTP id c82so24208897lfc.6 for ; Mon, 09 Oct 2017 09:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KfmfySvtY88h3B/oIZwQiy50PTS1MYnW3iqTnqzuYtY=; b=uxpbePfHn1MbnSABq1MA7tMifZZFEQOVzKxvhX8isvyu5HmYsk2e07g6EVr68k1sNl Do38lCkyN0gPqQdWePzlumEhIQqg6Pilg1zc8kQG6Y2N3vQ1E7nrw46SYJlfP5cMbH3g +z+M/mlW5YPuUVKwbNoSE67FhKZ3ze+f5y8ztxiZWvF08vC/IAE4rQDIOTauYB5iVirX cMsq+FZdOEV1lseMxDZ9Kd7knujwFKLe+c8yCoozXqARBmr7/pZiPSKm8wzv62RQOxLY UdHG8eL59q000Ae4XBYfPZdH51QNwmZuPUvHb3EG0CLqe/tna+hZFKbPn1MEDwvd/X4C JzPQ== 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=KfmfySvtY88h3B/oIZwQiy50PTS1MYnW3iqTnqzuYtY=; b=Zr2SQrSQO/txDJHxnq4KpcJDheYs2af5sa3vScG2QSzYB9+RKBCcxY9qWyIeobxu+d YG5ppj5h35TtDNC8ON6PG9pL1CkgCNv76J8b86f+f40Q18n/iTGE060EBJBZpQmtuENR 8fQ0UeZuQ6sYGavPjHXCcRWMkJztK6gpUe9hwZ4cZlNnN9IUz1KV7Zx1oEPfOxg2jD/t yMNzG9+WJknkL4dNcc1AGSfugwsBoD6sjeYvQfIiUd9WBBtNQ+t6BB+pVBanx30h6EMm 6Ao1glk3hN1kBTAp26YFi/JcCeqGIjQj5LVeJ2fCB+jGethtx9fh027dTYtoB6039jp5 9Zjg== X-Gm-Message-State: AMCzsaUT2s4G3VVZRFnZKAcj6kxUHYCoA+eNNlETdeQ2zPUaEzmzcV8N 0phnoqZRQRtmRE9HJD29ee/SZPq2gBU= X-Google-Smtp-Source: AOwi7QCi9ytZKxiXWCTtcl0Z92FoXP6dQGcpW175qUJZUMtdG8XRKBudXpa54nL0m9NyBkrGCvVMSQ== X-Received: by 10.46.85.145 with SMTP id g17mr4667817lje.84.1507568044711; Mon, 09 Oct 2017 09:54:04 -0700 (PDT) Received: from enkidu.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id z204sm1421490lff.33.2017.10.09.09.54.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 09:54:04 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com, jinghua@marvell.com, mw@semihalf.com, jsd@semihalf.com Date: Mon, 9 Oct 2017 19:00:50 +0200 Message-Id: <1507568462-28775-2-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1507568462-28775-1-git-send-email-mw@semihalf.com> References: <1507568462-28775-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH 01/13] Marvell/Armada: Introduce platform initialization driver 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: , X-List-Received-Date: Mon, 09 Oct 2017 16:50:39 -0000 In order to enable modification of dynamic PCD's for the libraries and DXE drivers, this patch introduces new driver. It is executed prior to other drivers. Mpp, ComPhy and Utmi libraries initialization were moved from PrePi stage to DXE. To force the correct driver dispatch sequence, introduce a protocol GUID and install the protocol as a NULL protocol when PlatInitDxe executes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas Signed-off-by: Ard Biesheuvel --- Platform/Marvell/Armada/Armada.dsc.inc | 3 ++ Platform/Marvell/Armada/Armada70x0.fdf | 5 +++ Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c | 44 ++++++++++++++++++++ Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf | 44 ++++++++++++++++++++ Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c | 11 ----- Platform/Marvell/Marvell.dec | 5 +++ 6 files changed, 101 insertions(+), 11 deletions(-) diff --git a/Platform/Marvell/Armada/Armada.dsc.inc b/Platform/Marvell/Armada/Armada.dsc.inc index 89fb7e7..417bb0c 100644 --- a/Platform/Marvell/Armada/Armada.dsc.inc +++ b/Platform/Marvell/Armada/Armada.dsc.inc @@ -378,6 +378,9 @@ ArmPkg/Drivers/TimerDxe/TimerDxe.inf ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf + # Platform Initialization + Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf + # Platform drivers Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.inf MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf diff --git a/Platform/Marvell/Armada/Armada70x0.fdf b/Platform/Marvell/Armada/Armada70x0.fdf index c861e78..763d76a 100644 --- a/Platform/Marvell/Armada/Armada70x0.fdf +++ b/Platform/Marvell/Armada/Armada70x0.fdf @@ -89,6 +89,11 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c INF MdeModulePkg/Core/Dxe/DxeMain.inf + # + # Platform Initialization + # + INF Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf + # PI DXE Drivers producing Architectural Protocols (EFI Services) INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf diff --git a/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c new file mode 100644 index 0000000..919454b --- /dev/null +++ b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c @@ -0,0 +1,44 @@ +/** @file + Copyright (C) Marvell International Ltd. and its affiliates + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +ArmadaPlatInitDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + DEBUG ((DEBUG_ERROR, "\nArmada Platform Init\n\n")); + + Status = gBS->InstallProtocolInterface (&ImageHandle, + &gMarvellPlatformInitCompleteProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL); + ASSERT_EFI_ERROR (Status); + + MvComPhyInit (); + UtmiPhyInit (); + MppInitialize (); + + return EFI_SUCCESS; +} diff --git a/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf new file mode 100644 index 0000000..29abcaf --- /dev/null +++ b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf @@ -0,0 +1,44 @@ +#/* @file +# Copyright (C) Marvell International Ltd. and its affiliates +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +#*/ + +[Defines] + INF_VERSION = 0x00010019 + BASE_NAME = PlatInitDxe + FILE_GUID = 8c66f65b-08a6-4c91-b993-ff81e0adf818 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + + ENTRY_POINT = ArmadaPlatInitDxeEntryPoint + +[Sources] + PlatInitDxe.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Platform/Marvell/Marvell.dec + +[LibraryClasses] + ComPhyLib + DebugLib + MppLib + PcdLib + TimerLib + UefiDriverEntryPoint + UtmiPhyLib + +[Protocols] + gMarvellPlatformInitCompleteProtocolGuid ## PRODUCES + +[Depex] + TRUE diff --git a/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c b/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c index 0ed310f..968d28f 100644 --- a/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c +++ b/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c @@ -15,12 +15,8 @@ #include #include -#include -#include -#include #include - ARM_CORE_INFO mArmada7040MpCoreInfoTable[] = { { // Cluster 0, Core 0 @@ -90,13 +86,6 @@ ArmPlatformInitialize ( IN UINTN MpId ) { - if (!ArmPlatformIsPrimaryCore (MpId)) { - return RETURN_SUCCESS; - } - - MvComPhyInit (); - UtmiPhyInit (); - MppInitialize (); return RETURN_SUCCESS; } diff --git a/Platform/Marvell/Marvell.dec b/Platform/Marvell/Marvell.dec index 0902086..e7d7c2c 100644 --- a/Platform/Marvell/Marvell.dec +++ b/Platform/Marvell/Marvell.dec @@ -56,6 +56,11 @@ gShellFUpdateHiiGuid = { 0x9b5d2176, 0x590a, 0x49db, { 0x89, 0x5d, 0x4a, 0x70, 0xfe, 0xad, 0xbe, 0x24 } } gShellSfHiiGuid = { 0x03a67756, 0x8cde, 0x4638, { 0x82, 0x34, 0x4a, 0x0f, 0x6d, 0x58, 0x81, 0x39 } } +[Protocols] + # installed as a protocol by PlatInitDxe to force ordering between DXE drivers + # that depend on the lowlevel platform initialization having been completed + gMarvellPlatformInitCompleteProtocolGuid = { 0x465b8cf7, 0x016f, 0x4ba6, { 0xbe, 0x6b, 0x28, 0x0e, 0x3a, 0x7d, 0x38, 0x6f } } + [PcdsFixedAtBuild.common] #MPP gMarvellTokenSpaceGuid.PcdMppChipCount|0|UINT32|0x30000001 -- 1.8.3.1