From patchwork Wed Nov 15 14:03:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 118949 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4351081qgn; Wed, 15 Nov 2017 06:03:29 -0800 (PST) X-Google-Smtp-Source: AGs4zMYCiE8LlLtMc4PGleVfUjrZuovfZCxrylLA4v6LBXmNN2aASUcjVNCdGnb6/PwS2bWvNiM/ X-Received: by 10.101.82.1 with SMTP id o1mr15420128pgp.261.1510754609603; Wed, 15 Nov 2017 06:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510754609; cv=none; d=google.com; s=arc-20160816; b=sOPtErguoGeaNHT0viYTRWiaPCxuxu/M38gHaw6yMMcp4mSwxUC5c0v+yLlW0yYe7N DMaNOTsq2WN2xvqu+jeRYxWVKXsHuZ0OZu3RUfSa7SHTsPhSfA3Ak6pBhNfWHXXhoKzP 6sRm6zl1IyMxSLK21tUa/X80Q9RGYIG5I0M9xPSyVomj2UpIbfZB+cY66GRSG+625lkU GJnZ9ID1Sdhf/DlOpceDgrEhqShfboMmFA7P7eWC5WRJk+5a3TQIhD6jnBySzPiq+ovL GTnLvCOH5kTzGgPLQT4NLkrfMBjpoJIH/FhuPxOGtGoZBpJhli7f/nt1d2CQa087jedn BnoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=F93cvzeTxj+hQpLdj1lpHmHFWj9Jidz4MO8R+uoYwKs=; b=FdoH6MPy5hc4colowq1fCPbW1YeqqB2wqBi1qY5Fca74cUig+0xa0pjwXZkt4JqE2I beyF6Sg9n8swiD4sCuHXASTlbx7P26NPQ/DnwXznkDrjPvFC3k51R3pib+K5Agt+n3lR Gt2gDTzlPv0eRSlt4K2tLOdVVAkAXPi+aLzz8OdQkO+RsBVNEDF21RsYW0v8EIsrtw7N S1UVR8QtX38qdKSZbCAMrsGiGD0OF9USbJfOJXCFD7aGrH1LbN8+mfo2tJVHtd8k+bEN wPfQW9JaUGTFNMv9incAODjzv0a25VNA4oMrSO28AhPKAC2txK0Qb9xrG5HNTp2URQ0H rNnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cHfXFJo/; 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 Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id c68si13835879pfj.209.2017.11.15.06.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 06:03:29 -0800 (PST) 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 header.s=google header.b=cHfXFJo/; 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 8857A20355611; Wed, 15 Nov 2017 05:59:20 -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:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 06FFF20355209 for ; Wed, 15 Nov 2017 05:59:18 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id 4so20582504wrt.0 for ; Wed, 15 Nov 2017 06:03:27 -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; bh=/REp2PFpvR/O2rh5Q+NB8qu6TQktHR/9rLD48tkZhvE=; b=cHfXFJo/LNi1jHXgrl+gDg7ZOVQQDKocW32eUNR7ji616+T7EDHn6rguV+9UQEq1Oo IxHlQ/iDmm4+bEPMGxBQj/uRaFHBmNIBvp6hB1dBatYOoOAdtMKEd+1F2LQMvkMiJjhP 6X3dxUeJ4+H0FudcFcwvrYWPicZnWXZX4OTXo= 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; bh=/REp2PFpvR/O2rh5Q+NB8qu6TQktHR/9rLD48tkZhvE=; b=KS+5uUn8nY+qF4pW+888urlmlS71vWLn5T/u9vki0RP8yqcKfv2qRM1/k7o/JvCr7q Wsmt/NO4wFwwmEP/0KCXkDEttUlJKx8xDizoI3jS6P/wySxcDfI5yXm0Odr0qOxK/4Bm EC3Stj+EUGNj7C6I5O6hjybSKHQ4sPIA9cVnukg5AStsvXgsu7QJOMeHmAZ5yb3uCebw MCwWtHUuCElP0tgYfVhV6op9cSODQh6el8+FxTV18Sw1aXllYyXJf+74UldP/7dsI3dP En8BH2Ku8qXgHSrQ3RDvX0UfuvOXg6hL04jJOcjdSiZ5WnMzkj/F0lSkLYGVmHG8PyN1 oqPA== X-Gm-Message-State: AJaThX4kx7kbmUlP/YXCP8mn4919aVmxBaNc9KUObcnexmH8SSq8CDvE rTVIp3SAiTawEW00r8rUNsBi6/JRrbI= X-Received: by 10.223.147.135 with SMTP id 7mr13741045wrp.237.1510754605681; Wed, 15 Nov 2017 06:03:25 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id t189sm5606432wmf.43.2017.11.15.06.03.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 06:03:24 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Wed, 15 Nov 2017 14:03:19 +0000 Message-Id: <20171115140319.32570-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency 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: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Now that the PL031 RTC driver library no longer depends on the ARM platform specific ArmPlatformSysConfigLib, we no longer need to implement ArmPlatform.h or have a resolution for that library. This allows us to get rid of a rather dodgy practice of including platform headers using compiler flags, which is a bad idea at various levels. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- PL031 patch is on-list and pending. ArmVirtPkg/ArmVirtQemu.dsc | 7 ----- ArmVirtPkg/ArmVirtQemuKernel.dsc | 6 ---- ArmVirtPkg/ArmVirtXen.dsc | 6 ---- ArmVirtPkg/Include/ArmPlatform.h | 33 -------------------- ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c | 1 - ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c | 1 - ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c | 1 - ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 1 - ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c | 1 - ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c | 1 - ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c | 7 ++++- 11 files changed, 6 insertions(+), 59 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 8a60b61f2aa6..d1b3849d856a 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -49,7 +49,6 @@ [LibraryClasses.common] QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf ArmPlatformLib|ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf - ArmPlatformSysConfigLib|ArmPlatformPkg/Library/ArmPlatformSysConfigLibNull/ArmPlatformSysConfigLibNull.inf TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf @@ -71,12 +70,6 @@ [LibraryClasses.common] [LibraryClasses.common.UEFI_DRIVER] UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf -[BuildOptions] - RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmVirtPkg/Include - GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmVirtPkg/Include - *_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmVirtPkg/Include - - ################################################################################ # # Pcd Section - list of all EDK II PCD Entries defined by this Platform diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index 9a31ec93ca06..c7058718b0a6 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -49,7 +49,6 @@ [LibraryClasses.common] QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf ArmPlatformLib|ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ArmQemuRelocatablePlatformLib.inf - ArmPlatformSysConfigLib|ArmPlatformPkg/Library/ArmPlatformSysConfigLibNull/ArmPlatformSysConfigLibNull.inf TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf @@ -71,11 +70,6 @@ [LibraryClasses.common] [LibraryClasses.common.UEFI_DRIVER] UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf -[BuildOptions] - RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmVirtPkg/Include - GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmVirtPkg/Include - *_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmVirtPkg/Include - [BuildOptions.ARM.EDKII.SEC, BuildOptions.ARM.EDKII.BASE] # Avoid MOVT/MOVW instruction pairs in code that may end up in the PIE # executable we build for the relocatable PrePi. They are not runtime diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index e9437066ca56..7a443483d1ac 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -44,7 +44,6 @@ [LibraryClasses] VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf ArmPlatformLib|ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ArmXenRelocatablePlatformLib.inf - ArmPlatformSysConfigLib|ArmPlatformPkg/Library/ArmPlatformSysConfigLibNull/ArmPlatformSysConfigLibNull.inf TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf @@ -56,11 +55,6 @@ [LibraryClasses] [LibraryClasses.common.UEFI_DRIVER] UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf -[BuildOptions] - RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmVirtPkg/Include - GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmVirtPkg/Include - GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmVirtPkg/Include - [BuildOptions.ARM.EDKII.SEC, BuildOptions.ARM.EDKII.BASE] # Avoid MOVT/MOVW instruction pairs in code that may end up in the PIE # executable we build for the relocatable PrePi. They are not runtime diff --git a/ArmVirtPkg/Include/ArmPlatform.h b/ArmVirtPkg/Include/ArmPlatform.h deleted file mode 100644 index 77178aabb310..000000000000 --- a/ArmVirtPkg/Include/ArmPlatform.h +++ /dev/null @@ -1,33 +0,0 @@ -/** @file -* Header defining platform constants (Base addresses, sizes, flags) -* -* Copyright (c) 2011, ARM Limited. All rights reserved. -* Copyright (c) 2014, Linaro Limited -* -* 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 __PLATFORM_H__ -#define __PLATFORM_H__ - -// -// We don't care about this value, but the PL031 driver depends on the macro -// to exist: it will pass it on to our ArmPlatformSysConfigLib:ConfigGet() -// function, which just returns EFI_UNSUPPORTED. -// -#define SYS_CFG_RTC 0x0 - -#define QEMU_NOR_BLOCK_SIZE SIZE_256KB -#define QEMU_NOR0_BASE 0x0 -#define QEMU_NOR0_SIZE SIZE_64MB -#define QEMU_NOR1_BASE 0x04000000 -#define QEMU_NOR1_SIZE SIZE_64MB - -#endif diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c index be512aa3d5b1..2ce5c48d52cf 100644 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/QemuVirtMem.c @@ -18,7 +18,6 @@ #include #include #include -#include // Number of Virtual Memory Map Descriptors #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c index c10c09fed2bd..6df207733ab2 100644 --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/RelocatableVirt.c @@ -18,7 +18,6 @@ #include #include #include -#include #include /** diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c index fcaf3c681a97..140bdde8b2ac 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c index 666edb47ce97..d10548f86dfc 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c @@ -18,7 +18,6 @@ #include #include #include -#include // Number of Virtual Memory Map Descriptors #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c index c10c09fed2bd..6df207733ab2 100644 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/RelocatableVirt.c @@ -18,7 +18,6 @@ #include #include #include -#include #include /** diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c index 657b840059c2..63090586cf8b 100644 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/XenVirtMem.c @@ -18,7 +18,6 @@ #include #include #include -#include // Number of Virtual Memory Map Descriptors #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 2 diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c index d63a2d989f69..e3bbae5b06c5 100644 --- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c +++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c @@ -12,9 +12,14 @@ **/ -#include #include +#define QEMU_NOR_BLOCK_SIZE SIZE_256KB +#define QEMU_NOR0_BASE 0x0 +#define QEMU_NOR0_SIZE SIZE_64MB +#define QEMU_NOR1_BASE 0x04000000 +#define QEMU_NOR1_SIZE SIZE_64MB + EFI_STATUS NorFlashPlatformInitialization ( VOID