From patchwork Mon Apr 10 16:21:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 97175 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1426245obc; Mon, 10 Apr 2017 09:22:05 -0700 (PDT) X-Received: by 10.98.73.214 with SMTP id r83mr8445114pfi.253.1491841325081; Mon, 10 Apr 2017 09:22:05 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id z1si13858730plh.211.2017.04.10.09.22.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:05 -0700 (PDT) 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; 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 0B68321939222; Mon, 10 Apr 2017 09:22:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (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 4A7552193930F for ; Mon, 10 Apr 2017 09:22:02 -0700 (PDT) Received: by mail-wr0-x230.google.com with SMTP id c55so78931229wrc.3 for ; Mon, 10 Apr 2017 09:22:02 -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=iM7bIVRveeMdzQtgcpbgCmLLQINSyJnouF1VDxh7kjo=; b=YCloRj8zQgVsBPdAc/0Uf27nNIZBiZItD7sJswZbgF9mqXRZwq8U3H0shjQeZaAIhh UUgtPbcWtw1Vfz07TJfSG0Q9+lQgJ4GS94D1qeln+EwN1FYkSV/1IeC50aYX3piD/ceV BLgqMS/8ZHcueFHvEpYz+h1HSlC6K3VfgP1IA= 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=iM7bIVRveeMdzQtgcpbgCmLLQINSyJnouF1VDxh7kjo=; b=cZoJdLsuEcpGnbJn815nPu3pLinhPxZ21KNhDvIYIb3pZLFylHSHuPHO0H6eVaXo1X /Ej/oIx14J70pns6uosjLU+pNtOs3TkKNA9+zz5UfseIcAojI8E72/eqpnFDamsv2WsI eEqtUW0LVCmW1ZBcXVYajO5cok3OMKLphbOzfdf4qwerwmtIyuXMzMyj/BuWNgxPGn9Q IBrPZbPbnpV+sJJvKrWNL++pr9wIwrrFgSTHtYKgpRh2qG87li2KUTJMXkW8BqD9N4of HOUCJXv86JfIFR4/ibn8wcuTSmYr6s9DyF9SZIKMIGWD5AzjHKw4rIQboTAl5Wc3Oax/ f4Pg== X-Gm-Message-State: AFeK/H3YYi9L0l6bnj3nU7ERQphMYZxSCwmEBA13oNzlcSxPNtW7KmWOnC3908aD2XA3IEG2 X-Received: by 10.223.151.80 with SMTP id r74mr25107511wrb.6.1491841320752; Mon, 10 Apr 2017 09:22:00 -0700 (PDT) Received: from localhost.localdomain ([196.85.182.219]) by smtp.gmail.com with ESMTPSA id l14sm18037852wre.23.2017.04.10.09.21.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:00 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 10 Apr 2017 17:21:50 +0100 Message-Id: <20170410162152.20555-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170410162152.20555-1-ard.biesheuvel@linaro.org> References: <20170410162152.20555-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v3 1/3] ArmPlatformPkg/ArmVExpressDxe: remove ARM support 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 32-bit ARM support in this driver is unused, and thus untested. So let's just remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/Arm/ArmFvpDxeArm.c | 84 -------------------- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf | 9 --- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec | 10 --- 3 files changed, 103 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/ArmVExpressPkg/ArmVExpressDxe/Arm/ArmFvpDxeArm.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/Arm/ArmFvpDxeArm.c deleted file mode 100644 index 2057c6e2156a..000000000000 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/Arm/ArmFvpDxeArm.c +++ /dev/null @@ -1,84 +0,0 @@ -/** @file - - Copyright (c) 2014, ARM Ltd. All rights reserved. - - 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 "ArmVExpressInternal.h" -#include // To get Core Count - -// -// Description of the four ARM model platforms : -// Platform ids are defined in ArmVExpressInternal.h for -// all "ArmVExpress-like" platforms (AARCH64 or ARM architecture, -// model or hardware platforms). -// -CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = { - { ARM_FVP_VEXPRESS_A9x4, FixedPcdGetPtr (PcdFdtVExpressFvpA9x4), L"rtsm_ve-cortex_a9x4.dtb" }, - { ARM_FVP_VEXPRESS_A15x1, FixedPcdGetPtr (PcdFdtVExpressFvpA15x1), L"rtsm_ve-cortex_a15x1.dtb" }, - { ARM_FVP_VEXPRESS_A15x2, FixedPcdGetPtr (PcdFdtVExpressFvpA15x2), L"rtsm_ve-cortex_a15x2.dtb" }, - { ARM_FVP_VEXPRESS_A15x4, FixedPcdGetPtr (PcdFdtVExpressFvpA15x4), L"rtsm_ve-cortex_a15x4.dtb" }, - { ARM_FVP_VEXPRESS_UNKNOWN, } -}; - -/** - Get information about the VExpress platform the firmware is running on. - - @param[out] Platform Address where the pointer to the platform information - (type ARM_VEXPRESS_PLATFORM*) should be stored. - The returned pointer does not point to an allocated - memory area. - - @retval EFI_SUCCESS The platform information was returned. - @retval EFI_NOT_FOUND The platform was not recognised. - -**/ -EFI_STATUS -ArmVExpressGetPlatform ( - OUT CONST ARM_VEXPRESS_PLATFORM** Platform - ) -{ - UINT32 SysId; - UINTN CpuType; - EFI_STATUS Status; - UINTN CoreCount; - - ASSERT (Platform != NULL); - - CpuType = 0; - Status = EFI_NOT_FOUND; - *Platform = NULL; - - SysId = MmioRead32 (ARM_VE_SYS_ID_REG); - if (SysId == ARM_RTSM_SYS_ID) { - // Get the Cortex-A version - CpuType = (ArmReadMidr () >> 4) & ARM_CPU_TYPE_MASK; - if (CpuType == ARM_CPU_TYPE_A9) { - Status = ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_A9x4, Platform); - } else if (CpuType == ARM_CPU_TYPE_A15) { - CoreCount = ArmGetCpuCountPerCluster (); - if (CoreCount == 1) { - Status = ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_A15x1, Platform); - } else if (CoreCount == 2) { - Status = ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_A15x2, Platform); - } else if (CoreCount == 4) { - Status = ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_A15x4, Platform); - } - } - } - - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Unsupported platform (SysId:0x%X, CpuType:0x%X)\n", SysId, CpuType)); - ASSERT_EFI_ERROR (Status); - } - - return Status; -} diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf index 327c5101ddb5..2a8c8388a3b2 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf @@ -24,9 +24,6 @@ [Sources.common] ArmFvpDxe.c ArmVExpressCommon.c -[Sources.ARM] - Arm/ArmFvpDxeArm.c - [Sources.AARCH64] AArch64/ArmFvpDxeAArch64.c @@ -61,12 +58,6 @@ [Protocols] [FixedPcd] gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase -[FixedPcd.ARM] - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA9x4 - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x1 - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x2 - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x4 - [FixedPcd.AARCH64] gArmVExpressTokenSpaceGuid.PcdFdtFvpVExpressAEMv8x4 gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2 diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec index c774d97541e1..39f046541502 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec @@ -60,16 +60,6 @@ [PcdsFixedAtBuild.common] # # ARM Versatile Express FDT Guids # - # FVP platforms - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA9x4|{ 0x12, 0x7b, 0xdf, 0xa1, 0x60, 0x11, 0xcf, 0x16, 0xb8, 0xc6, 0x98, 0xde, 0xdf, 0xe2, 0xce, 0xae }|VOID*|0x00000007 - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x1|{ 0xe5, 0x1b, 0xc0, 0x96, 0xeb, 0xd7, 0x1a, 0x42, 0xc8, 0xe8, 0x6a, 0xfd, 0x5a, 0x86, 0x1d, 0x84 }|VOID*|0x00000008 - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x2|{ 0x84, 0x43, 0x70, 0x4d, 0x19, 0xf1, 0x29, 0xe3, 0xef, 0xcd, 0xa5, 0x9b, 0x3d, 0x0a, 0x5a, 0x5f }|VOID*|0x00000009 - gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x4|{ 0x72, 0x3b, 0x28, 0x27, 0x90, 0x2f, 0xca, 0x4d, 0x9a, 0xb5, 0x98, 0x48, 0xfb, 0xc2, 0xd4, 0xed }|VOID*|0x0000000A - # HW platforms - gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA9x4|{ 0xf6, 0x1c, 0xd2, 0x2f, 0xe8, 0xe6, 0xf2, 0x4f, 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 }|VOID*|0x0000000B - gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3|{ 0xeb, 0x06, 0xe6, 0xd5, 0xdf, 0x83, 0x90, 0x4e, 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a }|VOID*|0x0000000C - gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15|{ 0xc2, 0x47, 0x89, 0x6b, 0x87, 0x42, 0x91, 0x4d, 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f }|VOID*|0x0000000D - gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA5|{ 0x63, 0x76, 0xcc, 0xa2, 0x7c, 0x4d, 0x8a, 0x44, 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 }|VOID*|0x0000000E # AArch64 FVP platforms gArmVExpressTokenSpaceGuid.PcdFdtFvpVExpressAEMv8x4|{ 0xa8, 0x95, 0x5f, 0xf6, 0x32, 0x7b, 0xf3, 0x16, 0x12, 0x32, 0x45, 0x50, 0xbd, 0x54, 0xca, 0xe5 }|VOID*|0x00000010 From patchwork Mon Apr 10 16:21:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 97176 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1426259obc; Mon, 10 Apr 2017 09:22:07 -0700 (PDT) X-Received: by 10.98.4.195 with SMTP id 186mr36275952pfe.233.1491841327307; Mon, 10 Apr 2017 09:22:07 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id b67si14025051pgc.84.2017.04.10.09.22.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:07 -0700 (PDT) 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; 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 44D142193930F; Mon, 10 Apr 2017 09:22:06 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 3A79521939230 for ; Mon, 10 Apr 2017 09:22:04 -0700 (PDT) Received: by mail-wm0-x229.google.com with SMTP id o81so43245477wmb.1 for ; Mon, 10 Apr 2017 09:22:04 -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=0P6i8n0oJv094OfJIqkCcL3f+6IGm6oL7lrnGsSJDcU=; b=IhUA24c/d5stLgAroHj6Z1YOm+cO/PVb7L63GAMLjA3Egqw+VHdsieSL87HOf+bRWU i9HADTtTttcPtB2oQvBqieUWHGJUYXtsujhBKCLFWe+G6aQzHPp+GSHGDc2rR/YocRrO Ylcx+B/XC1X8wC4qSDgWTA2/6/hattsKRKzc4= 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=0P6i8n0oJv094OfJIqkCcL3f+6IGm6oL7lrnGsSJDcU=; b=kodMBkf/nOvh7faiCVaHbZw5oRL/e8/O7NKLpAXyCC77bQ2hg5C1G63XxjL41ruKQy Kzy8LQWoIdNKs25/ldMxG0dRbKDuQPIxsqM7fz1SuS2jEOtJuYeAdIQsjP9tPY3YPYuP JnVL7YlZNnqnrvg4TTZrptreGmqG21MXfhbY32iuS1wXJzIkAzguIzsHKOgUBb29k50F UkRInRTVo9+o4l3aU6spRaGIQmhe4c+bxM9Q4VkdVe5AsJ2Gq8kHVIbiputggWemq+k2 8g3rp4vbHyaG70ZF9K8LvtxSdVlTjDu3kzG2bHJY6drNeRcUDaz30VigvXV/E8o6XTxy FqcQ== X-Gm-Message-State: AN3rC/4HK6G/nRCDiFWjzEmXu1mkS6pJmjtT2URpBTntQZMZqqtzKNvR r5uwKMgwcy+m+Yl+ X-Received: by 10.28.191.75 with SMTP id p72mr10456886wmf.136.1491841322738; Mon, 10 Apr 2017 09:22:02 -0700 (PDT) Received: from localhost.localdomain ([196.85.182.219]) by smtp.gmail.com with ESMTPSA id l14sm18037852wre.23.2017.04.10.09.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:02 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 10 Apr 2017 17:21:51 +0100 Message-Id: <20170410162152.20555-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170410162152.20555-1-ard.biesheuvel@linaro.org> References: <20170410162152.20555-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v3 2/3] ArmPlatformPkg/ArmVExpressDxe: remove unused cruft from ArmHwDxe 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" Remove unused cruft from ArmHwDxe -- the only thing that remains is installation of the 'runaxf' shell command. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c | 43 +------------------- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf | 3 -- 2 files changed, 1 insertion(+), 45 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/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c index 351c73312dc4..19efa3c23dea 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c @@ -12,49 +12,8 @@ **/ -#include "ArmVExpressInternal.h" #include - -CONST EFI_GUID ArmHwA9x4Guid = { 0x2fd21cf6, 0xe6e8, 0x4ff2, { 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 } }; -CONST EFI_GUID ArmHwA15x2A7x3Guid = { 0xd5e606eb, 0x83df, 0x4e90, { 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a } }; -CONST EFI_GUID ArmHwA15Guid = { 0x6b8947c2, 0x4287, 0x4d91, { 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f } }; -CONST EFI_GUID ArmHwA5Guid = { 0xa2cc7663, 0x4d7c, 0x448a, { 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 } }; -CONST EFI_GUID NullGuid = { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }; - -// -// Description of the four hardware platforms : -// just the platform id for the time being. -// Platform ids are defined in ArmVExpressInternal.h for -// all "ArmVExpress-like" platforms (AARCH64 or ARM architecture, -// model or hardware platforms). -// -//Note: File extensions are stripped with the VExpress NOR Flash FileSystem -CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = { - { ARM_HW_A9x4, &ArmHwA9x4Guid, L"ca9" }, - { ARM_HW_A15x2_A7x3, &ArmHwA15x2A7x3Guid, L"ca15a7" }, - { ARM_HW_A15, &ArmHwA15Guid, L"ca15a7" }, - { ARM_HW_A5, &ArmHwA5Guid, L"ca5s" }, - { ARM_FVP_VEXPRESS_UNKNOWN, &NullGuid, NULL } -}; - -/** - Get information about the VExpress platform the firmware is running on. - - @param[out] Platform Address where the pointer to the platform information - (type ARM_VEXPRESS_PLATFORM*) should be stored. - The returned pointer does not point to an allocated - memory area. Not used here. - - @retval EFI_NOT_FOUND The platform was not recognised. - -**/ -EFI_STATUS -ArmVExpressGetPlatform ( - OUT CONST ARM_VEXPRESS_PLATFORM** Platform - ) -{ - return EFI_NOT_FOUND; -} +#include /** * Generic UEFI Entrypoint for 'ArmHwDxe' driver diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf index 1a007627ad3f..1ecdbb0b231e 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf @@ -22,12 +22,9 @@ [Defines] [Sources.common] ArmHwDxe.c - ArmVExpressCommon.c [Packages] - ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec - EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec [LibraryClasses] From patchwork Mon Apr 10 16:21:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 97177 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1426274obc; Mon, 10 Apr 2017 09:22:10 -0700 (PDT) X-Received: by 10.98.157.12 with SMTP id i12mr53873949pfd.166.1491841329779; Mon, 10 Apr 2017 09:22:09 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id h10si14023466plk.259.2017.04.10.09.22.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:09 -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 7D6DA2193923E; Mon, 10 Apr 2017 09:22:08 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (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 BE0322193923E for ; Mon, 10 Apr 2017 09:22:06 -0700 (PDT) Received: by mail-wm0-x230.google.com with SMTP id w64so43400303wma.0 for ; Mon, 10 Apr 2017 09:22:06 -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=MJTWX6umyPM29kFmdQj7SsRBSRwSvzmovLDXwIGVpkI=; b=arHng3Wl4DvjfNtH4KBf6P+pqkD5CzKftHh+D5OLoxo4lX3I7FzcKqjqeJ6otdMRe2 nlMu8sl++SW+Bq70bG7EwlfkWmDsIu8ZT3JlYwT2jYgpSgcGdYMhwFHWZy7jou5wH3wq QD+weAYMYvu7KKTGuPuH8qq4Fs45MaMv0lwqw= 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=MJTWX6umyPM29kFmdQj7SsRBSRwSvzmovLDXwIGVpkI=; b=da6me6WUJVUrlo+LRzEpdtOQNVAFVVdE49NFMglFOCxaiZlOHUIHXWjvVd2/1wr2jB f3Yf+SMdZ+VF0xHniGif3b18tGOImH9o0L5gR7xX0caCmDbxdwbioErJ3z8+WHnXW/5H UO9t18OjmS9lpqw61bzEsRQoOHl9kTem1jQElcU9d66Gt5IpRIhgjWU8YYKHiiyeFfPR UJewmuhLyUWw3kSxMmWTz5QiIJYpJvH9me9LOSm5ixwG2//JZVTsXZQxtnwSHRSVaIJE E6skNcNgytmGmgofVU3QJiJU+t29gJKSdeW+OB0v0M/+e9vWnZMnqFRYIWbwg2i7vb3F dA+A== X-Gm-Message-State: AN3rC/7xSBWLB8RCq43DuNjH6s2R2J0uxWuDUMEoTgJSNJhviFIyidEO xf/VsRBGtCfwYrzt X-Received: by 10.28.6.203 with SMTP id 194mr11466498wmg.125.1491841324959; Mon, 10 Apr 2017 09:22:04 -0700 (PDT) Received: from localhost.localdomain ([196.85.182.219]) by smtp.gmail.com with ESMTPSA id l14sm18037852wre.23.2017.04.10.09.22.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:04 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 10 Apr 2017 17:21:52 +0100 Message-Id: <20170410162152.20555-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170410162152.20555-1-ard.biesheuvel@linaro.org> References: <20170410162152.20555-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v3 3/3] ArmPlatformPkg/ArmVExpressDxe: remove FDT handling from ArmFvpDxe 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" Replace the elaborate but awkward handling of FDT images using device paths and string PCDs initialized to 128 spaces with a simple scheme involving a set of builtin DTBs and a bit of runtime logic to select between them. This is sufficient for ordinary use, which makes it more suitable as reference code. Note that overriding the DTB presented to the OS can easily be done with a UEFI application that simply installs a new DTB image under the existing FDT configuration table GUID. For this module, this simply involves removing all code that is involved in deciding which platform we are running on, and for reasoning about FDT device paths. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c | 113 ---------------- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c | 137 +------------------- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf | 33 ----- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressCommon.c | 48 ------- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h | 99 -------------- ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec | 18 --- 6 files changed, 5 insertions(+), 443 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/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c deleted file mode 100644 index c368957dcd3d..000000000000 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c +++ /dev/null @@ -1,113 +0,0 @@ -/** @file - - Copyright (c) 2014-2015, ARM Ltd. All rights reserved. - - 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 "ArmVExpressInternal.h" -#include - -// -// Description of the AARCH64 model platforms : -// Platform ids are defined in ArmVExpressInternal.h for -// all "ArmVExpress-like" platforms (AARCH64 or ARM architecture, -// model or hardware platforms). -// -CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = { - { ARM_FVP_VEXPRESS_AEMv8x4, FixedPcdGetPtr (PcdFdtFvpVExpressAEMv8x4), L"rtsm_ve-aemv8a.dtb" }, - { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, FixedPcdGetPtr (PcdFdtFvpBaseAEMv8x4GicV2), L"fvp-base-gicv2-psci.dtb" }, - { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, FixedPcdGetPtr (PcdFdtFvpBaseAEMv8x4GicV2Legacy), L"fvp-base-gicv2legacy-psci.dtb" }, - { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, FixedPcdGetPtr (PcdFdtFvpBaseAEMv8x4GicV3), L"fvp-base-gicv3-psci.dtb" }, - { ARM_FVP_FOUNDATION_GICV2, FixedPcdGetPtr (PcdFdtFvpFoundationGicV2), L"fvp-foundation-gicv2-psci.dtb" }, - { ARM_FVP_FOUNDATION_GICV2_LEGACY, FixedPcdGetPtr (PcdFdtFvpFoundationGicV2Legacy), L"fvp-foundation-gicv2legacy-psci.dtb" }, - { ARM_FVP_FOUNDATION_GICV3, FixedPcdGetPtr (PcdFdtFvpFoundationGicV3), L"fvp-foundation-gicv3-psci.dtb" }, - { ARM_FVP_VEXPRESS_UNKNOWN } -}; - -/** - Get information about the VExpress platform the firmware is running on. - - @param[out] Platform Address where the pointer to the platform information - (type ARM_VEXPRESS_PLATFORM*) should be stored. - The returned pointer does not point to an allocated - memory area. - - @retval EFI_SUCCESS The platform information was returned. - @retval EFI_NOT_FOUND The platform was not recognised. - -**/ -EFI_STATUS -ArmVExpressGetPlatform ( - OUT CONST ARM_VEXPRESS_PLATFORM** Platform - ) -{ - EFI_STATUS Status; - UINT32 SysId; - UINT32 FvpSysId; - UINT32 VariantSysId; - ARM_GIC_ARCH_REVISION GicRevision; - - ASSERT (Platform != NULL); - - Status = EFI_NOT_FOUND; - - SysId = MmioRead32 (ARM_VE_SYS_ID_REG); - if (SysId != ARM_RTSM_SYS_ID) { - // Remove the GIC variant to identify if we are running on the FVP Base or - // Foundation models - FvpSysId = SysId & (ARM_FVP_SYS_ID_HBI_MASK | - ARM_FVP_SYS_ID_PLAT_MASK ); - // Extract the variant from the SysId - VariantSysId = SysId & ARM_FVP_SYS_ID_VARIANT_MASK; - - if (FvpSysId == ARM_FVP_BASE_BOARD_SYS_ID) { - if (VariantSysId == ARM_FVP_GIC_VE_MMAP) { - // FVP Base Model with legacy GIC memory map - Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, Platform); - } else { - GicRevision = ArmGicGetSupportedArchRevision (); - - if (GicRevision == ARM_GIC_ARCH_REVISION_2) { - // FVP Base Model with GICv2 support - Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, Platform); - } else { - // FVP Base Model with GICv3 support - Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, Platform); - } - } - } else if (FvpSysId == ARM_FVP_FOUNDATION_BOARD_SYS_ID) { - if (VariantSysId == ARM_FVP_GIC_VE_MMAP) { - // FVP Foundation Model with legacy GIC memory map - Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION_GICV2_LEGACY, Platform); - } else { - GicRevision = ArmGicGetSupportedArchRevision (); - - if (GicRevision == ARM_GIC_ARCH_REVISION_2) { - // FVP Foundation Model with GICv2 - Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION_GICV2, Platform); - } else { - // FVP Foundation Model with GICv3 - Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION_GICV3, Platform); - } - } - } - } else { - // FVP Versatile Express AEMv8 - Status = ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_AEMv8x4, Platform); - } - - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Unsupported AArch64 RTSM (SysId:0x%X).\n", SysId)); - ASSERT_EFI_ERROR (Status); - } - - return Status; -} diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c index 8c42814a04dc..7827c50d8bbf 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c @@ -12,16 +12,15 @@ **/ -#include "ArmVExpressInternal.h" - #include + +#include #include +#include +#include #include -#include -#include -#include -#include +#include #define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000 @@ -55,95 +54,6 @@ VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath = } }; -STATIC -EFI_STATUS -InternalFindFdtByGuid ( - IN OUT EFI_DEVICE_PATH **FdtDevicePath, - IN CONST EFI_GUID *FdtGuid - ) -{ - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileDevicePath; - EFI_HANDLE *HandleBuffer; - UINTN HandleCount; - UINTN Index; - EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol; - EFI_GUID NameGuid; - UINTN Size; - VOID *Key; - EFI_FV_FILETYPE FileType; - EFI_FV_FILE_ATTRIBUTES Attributes; - EFI_DEVICE_PATH *FvDevicePath; - EFI_STATUS Status; - - if (FdtGuid == NULL) { - return EFI_NOT_FOUND; - } - - EfiInitializeFwVolDevicepathNode (&FileDevicePath, FdtGuid); - - HandleBuffer = NULL; - Status = gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiFirmwareVolume2ProtocolGuid, - NULL, - &HandleCount, - &HandleBuffer - ); - if (EFI_ERROR (Status)) { - return Status; - } - - for (Index = 0; Index < HandleCount; Index++) { - Status = gBS->HandleProtocol ( - HandleBuffer[Index], - &gEfiFirmwareVolume2ProtocolGuid, - (VOID **) &FvProtocol - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // Allocate Key - Key = AllocatePool (FvProtocol->KeySize); - ASSERT (Key != NULL); - ZeroMem (Key, FvProtocol->KeySize); - - do { - FileType = EFI_FV_FILETYPE_RAW; - Status = FvProtocol->GetNextFile (FvProtocol, Key, &FileType, &NameGuid, &Attributes, &Size); - if (Status == EFI_NOT_FOUND) { - break; - } - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Check whether this file is the one we are looking for. If so, - // create a device path for it and return it to the caller. - // - if (CompareGuid (&NameGuid, FdtGuid)) { - Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **)&FvDevicePath); - if (!EFI_ERROR (Status)) { - *FdtDevicePath = AppendDevicePathNode (FvDevicePath, - (EFI_DEVICE_PATH_PROTOCOL *)&FileDevicePath); - } - goto Done; - } - } while (TRUE); - FreePool (Key); - } - - if (Index == HandleCount) { - Status = EFI_NOT_FOUND; - } - return Status; - -Done: - FreePool (Key); - return Status; -} - /** * Generic UEFI Entrypoint for 'ArmFvpDxe' driver * See UEFI specification for the details of the parameters @@ -155,12 +65,7 @@ ArmFvpInitialise ( IN EFI_SYSTEM_TABLE *SystemTable ) { - CONST ARM_VEXPRESS_PLATFORM* Platform; EFI_STATUS Status; - CHAR16 *TextDevicePath; - UINTN TextDevicePathSize; - VOID *Buffer; - EFI_DEVICE_PATH *FdtDevicePath; Status = gBS->InstallProtocolInterface (&ImageHandle, &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE, @@ -169,38 +74,6 @@ ArmFvpInitialise ( return Status; } - Status = ArmVExpressGetPlatform (&Platform); - if (!EFI_ERROR (Status)) { - FdtDevicePath = NULL; - Status = InternalFindFdtByGuid (&FdtDevicePath, Platform->FdtGuid); - if (!EFI_ERROR (Status)) { - TextDevicePath = ConvertDevicePathToText (FdtDevicePath, FALSE, FALSE); - if (TextDevicePath != NULL) { - TextDevicePathSize = StrSize (TextDevicePath); - } - FreePool (FdtDevicePath); - } else { - TextDevicePathSize = StrSize ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)) - sizeof (CHAR16); - TextDevicePathSize += StrSize (Platform->FdtName); - - TextDevicePath = AllocatePool (TextDevicePathSize); - if (TextDevicePath != NULL) { - StrCpy (TextDevicePath, ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase))); - StrCat (TextDevicePath, Platform->FdtName); - } - } - if (TextDevicePath != NULL) { - Buffer = PcdSetPtr (PcdFdtDevicePaths, &TextDevicePathSize, TextDevicePath); - if (Buffer == NULL) { - DEBUG (( - EFI_D_ERROR, - "ArmFvpDxe: Setting of FDT device path in PcdFdtDevicePaths failed - %r\n", EFI_BUFFER_TOO_SMALL - )); - } - FreePool (TextDevicePath); - } - } - // Declare the Virtio BlockIo device Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle); if (EFI_ERROR (Status)) { diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf index 2a8c8388a3b2..a0dd9cba19a9 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf @@ -22,50 +22,17 @@ [Defines] [Sources.common] ArmFvpDxe.c - ArmVExpressCommon.c - -[Sources.AARCH64] - AArch64/ArmFvpDxeAArch64.c [Packages] MdePkg/MdePkg.dec ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec - ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec - EmbeddedPkg/EmbeddedPkg.dec OvmfPkg/OvmfPkg.dec [LibraryClasses] - PcdLib ArmShellCmdRunAxfLib - ArmLib - ArmPlatformLib BaseMemoryLib - DxeServicesTableLib - MemoryAllocationLib UefiDriverEntryPoint UefiBootServicesTableLib VirtioMmioDeviceLib - DevicePathLib - -[LibraryClasses.AARCH64] - ArmGicLib - -[Protocols] - gEfiFirmwareVolume2ProtocolGuid - gEfiDevicePathProtocolGuid - -[FixedPcd] - gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase - -[FixedPcd.AARCH64] - gArmVExpressTokenSpaceGuid.PcdFdtFvpVExpressAEMv8x4 - gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2 - gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2Legacy - gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV3 - gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2 - gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2Legacy - gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV3 -[Pcd] - gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressCommon.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressCommon.c deleted file mode 100644 index e1cac7fb3714..000000000000 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressCommon.c +++ /dev/null @@ -1,48 +0,0 @@ -/** @file - - Copyright (c) 2014, ARM Ltd. All rights reserved. - - 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 "ArmVExpressInternal.h" - -/** - Get information about the VExpress platform the firmware is running on given its Id. - - @param[in] PlatformId Id of the VExpress platform. - @param[out] Platform Address where the pointer to the platform information - (type ARM_VEXPRESS_PLATFORM*) should be stored. - The returned pointer does not point to an allocated - memory area. - - @retval EFI_SUCCESS The platform information was returned. - @retval EFI_NOT_FOUND The platform was not recognised. - -**/ -EFI_STATUS -ArmVExpressGetPlatformFromId ( - IN CONST ARM_VEXPRESS_PLATFORM_ID PlatformId, - OUT CONST ARM_VEXPRESS_PLATFORM** Platform - ) -{ - UINTN Index; - - ASSERT (Platform != NULL); - - for (Index = 0; ArmVExpressPlatforms[Index].Id != ARM_FVP_VEXPRESS_UNKNOWN; Index++) { - if (ArmVExpressPlatforms[Index].Id == PlatformId) { - *Platform = &ArmVExpressPlatforms[Index]; - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h deleted file mode 100644 index e123eea2d28b..000000000000 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h +++ /dev/null @@ -1,99 +0,0 @@ -/** @file - - Copyright (c) 2014-2015, ARM Ltd. All rights reserved. - - 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. - -**/ - -#ifndef __ARM_VEXPRESS_INTERNAL_H__ -#define __ARM_VEXPRESS_INTERNAL_H__ - -#include - -#include -#include -#include -#include -#include -#include - -#include - -// This 'enum' is needed as variations based on existing platform exist -typedef enum { - ARM_FVP_VEXPRESS_UNKNOWN = 0, - ARM_FVP_VEXPRESS_A9x4, - ARM_FVP_VEXPRESS_A15x1, - ARM_FVP_VEXPRESS_A15x2, - ARM_FVP_VEXPRESS_A15x4, - ARM_FVP_VEXPRESS_A15x1_A7x1, - ARM_FVP_VEXPRESS_A15x4_A7x4, - ARM_FVP_VEXPRESS_AEMv8x4, - ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, - ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, - ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, - ARM_FVP_FOUNDATION_GICV2, - ARM_FVP_FOUNDATION_GICV2_LEGACY, - ARM_FVP_FOUNDATION_GICV3, - ARM_HW_A9x4, - ARM_HW_A15x2_A7x3, - ARM_HW_A15, - ARM_HW_A5 -} ARM_VEXPRESS_PLATFORM_ID; - -typedef struct { - ARM_VEXPRESS_PLATFORM_ID Id; - - // Flattened Device Tree (FDT) File - CONST EFI_GUID *FdtGuid; /// Name of the FDT when present into the FV - CONST CHAR16 *FdtName; /// Name of the FDT when present into a File System -} ARM_VEXPRESS_PLATFORM; - -// Array that contains the list of the VExpress based platform supported by this DXE driver -extern CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[]; - -/** - Get information about the VExpress platform the firmware is running on given its Id. - - @param[in] PlatformId Id of the VExpress platform. - @param[out] Platform Address where the pointer to the platform information - (type ARM_VEXPRESS_PLATFORM*) should be stored. - The returned pointer does not point to an allocated - memory area. - - @retval EFI_SUCCESS The platform information was returned. - @retval EFI_NOT_FOUND The platform was not recognised. - -**/ -EFI_STATUS -ArmVExpressGetPlatformFromId ( - IN CONST ARM_VEXPRESS_PLATFORM_ID PlatformId, - OUT CONST ARM_VEXPRESS_PLATFORM** Platform - ); - -/** - - Get information about the VExpress platform the firmware is running on. - - @param[out] Platform Address where the pointer to the platform information - (type ARM_VEXPRESS_PLATFORM*) should be stored. - The returned pointer does not point to an allocated - memory area. - - @retval EFI_SUCCESS The platform information was returned. - @retval EFI_NOT_FOUND The platform was not recognised. - -**/ -EFI_STATUS -ArmVExpressGetPlatform ( - OUT CONST ARM_VEXPRESS_PLATFORM** Platform - ); - -#endif // __ARM_VEXPRESS_INTERNAL_H__ diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec index 39f046541502..3814513c2241 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec @@ -51,21 +51,3 @@ [PcdsFixedAtBuild.common] # Device path of block device on which Fastboot will flash partitions # gArmVExpressTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|""|VOID*|0x00000004 - - # FVP platforms : install FDT from SemiHosting - gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/"|VOID*|0x00000005 - # HW platforms : install FDT from NOR Flash - gArmVExpressTokenSpaceGuid.PcdHwFdtDevicePathsBase|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/"|VOID*|0x00000006 - - # - # ARM Versatile Express FDT Guids - # - - # AArch64 FVP platforms - gArmVExpressTokenSpaceGuid.PcdFdtFvpVExpressAEMv8x4|{ 0xa8, 0x95, 0x5f, 0xf6, 0x32, 0x7b, 0xf3, 0x16, 0x12, 0x32, 0x45, 0x50, 0xbd, 0x54, 0xca, 0xe5 }|VOID*|0x00000010 - gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2|{ 0x66, 0xcf, 0x57, 0xa4, 0xac, 0x7e, 0x7f, 0x3d, 0x21, 0x88, 0x3a, 0x58, 0x3c, 0x27, 0xd7, 0xe8 }|VOID*|0x00000011 - gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2Legacy|{ 0x8b, 0xcb, 0xe0, 0x14, 0xd1, 0x46, 0x79, 0xae, 0x7f, 0x20, 0xcf, 0x84, 0x22, 0xc7, 0x94, 0x4a }|VOID*|0x00000012 - gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV3|{ 0x4d, 0x03, 0xb8, 0x77, 0x63, 0x25, 0x0a, 0x7f, 0xe9, 0x72, 0xfa, 0x68, 0x74, 0xc7, 0x5e, 0xb5 }|VOID*|0x00000013 - gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2|{ 0x36, 0x4f, 0x61, 0x92, 0x86, 0xb1, 0xa2, 0x16, 0x32, 0x65, 0x35, 0x3f, 0x01, 0xf3, 0x3b, 0x64 }|VOID*|0x00000014 - gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2Legacy|{ 0xf6, 0xcb, 0x9d, 0x86, 0x38, 0x74, 0x8a, 0xb0, 0xfe, 0x40, 0x08, 0x0f, 0x3f, 0xb3, 0x50, 0x7c }|VOID*|0x00000015 - gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV3|{ 0x51, 0xd0, 0x75, 0x6b, 0x9d, 0x35, 0x1b, 0x1b, 0xa6, 0xc6, 0xab, 0xa0, 0x90, 0xf9, 0xf0, 0x0a }|VOID*|0x00000016