public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
@ 2017-11-15 14:03 Ard Biesheuvel
  2017-11-15 23:03 ` Laszlo Ersek
  2017-11-16  9:40 ` Ard Biesheuvel
  0 siblings, 2 replies; 7+ messages in thread
From: Ard Biesheuvel @ 2017-11-15 14:03 UTC (permalink / raw)
  To: edk2-devel, lersek; +Cc: leif.lindholm, Ard Biesheuvel

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 <ard.biesheuvel@linaro.org>
---
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(-)

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 <Library/PcdLib.h>
 #include <Library/IoLib.h>
 #include <Library/MemoryAllocationLib.h>
-#include <ArmPlatform.h>
 
 // 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 <Library/IoLib.h>
 #include <Library/ArmPlatformLib.h>
 #include <Library/DebugLib.h>
-#include <ArmPlatform.h>
 #include <Pi/PiBootMode.h>
 
 /**
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 <Library/ArmPlatformLib.h>
 #include <Library/DebugLib.h>
 #include <Library/PcdLib.h>
-#include <ArmPlatform.h>
 #include <libfdt.h>
 #include <Pi/PiBootMode.h>
 #include <Uefi/UefiBaseType.h>
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 <Library/PcdLib.h>
 #include <Library/IoLib.h>
 #include <Library/MemoryAllocationLib.h>
-#include <ArmPlatform.h>
 
 // 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 <Library/IoLib.h>
 #include <Library/ArmPlatformLib.h>
 #include <Library/DebugLib.h>
-#include <ArmPlatform.h>
 #include <Pi/PiBootMode.h>
 
 /**
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 <Library/PcdLib.h>
 #include <Library/IoLib.h>
 #include <Library/MemoryAllocationLib.h>
-#include <ArmPlatform.h>
 
 // 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 <ArmPlatform.h>
 #include <Library/NorFlashPlatformLib.h>
 
+#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
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
  2017-11-15 14:03 [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency Ard Biesheuvel
@ 2017-11-15 23:03 ` Laszlo Ersek
  2017-11-16  9:40 ` Ard Biesheuvel
  1 sibling, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2017-11-15 23:03 UTC (permalink / raw)
  To: Ard Biesheuvel, edk2-devel; +Cc: leif.lindholm

On 11/15/17 15:03, Ard Biesheuvel wrote:
> 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 <ard.biesheuvel@linaro.org>
> ---
> 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(-)
> 
> 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 <Library/PcdLib.h>
>  #include <Library/IoLib.h>
>  #include <Library/MemoryAllocationLib.h>
> -#include <ArmPlatform.h>
>  
>  // 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 <Library/IoLib.h>
>  #include <Library/ArmPlatformLib.h>
>  #include <Library/DebugLib.h>
> -#include <ArmPlatform.h>
>  #include <Pi/PiBootMode.h>
>  
>  /**
> 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 <Library/ArmPlatformLib.h>
>  #include <Library/DebugLib.h>
>  #include <Library/PcdLib.h>
> -#include <ArmPlatform.h>
>  #include <libfdt.h>
>  #include <Pi/PiBootMode.h>
>  #include <Uefi/UefiBaseType.h>
> 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 <Library/PcdLib.h>
>  #include <Library/IoLib.h>
>  #include <Library/MemoryAllocationLib.h>
> -#include <ArmPlatform.h>
>  
>  // 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 <Library/IoLib.h>
>  #include <Library/ArmPlatformLib.h>
>  #include <Library/DebugLib.h>
> -#include <ArmPlatform.h>
>  #include <Pi/PiBootMode.h>
>  
>  /**
> 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 <Library/PcdLib.h>
>  #include <Library/IoLib.h>
>  #include <Library/MemoryAllocationLib.h>
> -#include <ArmPlatform.h>
>  
>  // 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 <ArmPlatform.h>
>  #include <Library/NorFlashPlatformLib.h>
>  
> +#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
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
  2017-11-15 14:03 [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency Ard Biesheuvel
  2017-11-15 23:03 ` Laszlo Ersek
@ 2017-11-16  9:40 ` Ard Biesheuvel
  2017-11-16 11:59   ` Leif Lindholm
  1 sibling, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2017-11-16  9:40 UTC (permalink / raw)
  To: edk2-devel@lists.01.org, Laszlo Ersek; +Cc: Leif Lindholm, Ard Biesheuvel

On 15 November 2017 at 14:03, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> 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 <ard.biesheuvel@linaro.org>
> ---
> 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(-)
>
> 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

Oops. I will need to retain the -mcpu setting here, or the 'hvc'
instruction will be rejected by the assembler.

> -  *_*_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 <Library/PcdLib.h>
>  #include <Library/IoLib.h>
>  #include <Library/MemoryAllocationLib.h>
> -#include <ArmPlatform.h>
>
>  // 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 <Library/IoLib.h>
>  #include <Library/ArmPlatformLib.h>
>  #include <Library/DebugLib.h>
> -#include <ArmPlatform.h>
>  #include <Pi/PiBootMode.h>
>
>  /**
> 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 <Library/ArmPlatformLib.h>
>  #include <Library/DebugLib.h>
>  #include <Library/PcdLib.h>
> -#include <ArmPlatform.h>
>  #include <libfdt.h>
>  #include <Pi/PiBootMode.h>
>  #include <Uefi/UefiBaseType.h>
> 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 <Library/PcdLib.h>
>  #include <Library/IoLib.h>
>  #include <Library/MemoryAllocationLib.h>
> -#include <ArmPlatform.h>
>
>  // 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 <Library/IoLib.h>
>  #include <Library/ArmPlatformLib.h>
>  #include <Library/DebugLib.h>
> -#include <ArmPlatform.h>
>  #include <Pi/PiBootMode.h>
>
>  /**
> 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 <Library/PcdLib.h>
>  #include <Library/IoLib.h>
>  #include <Library/MemoryAllocationLib.h>
> -#include <ArmPlatform.h>
>
>  // 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 <ArmPlatform.h>
>  #include <Library/NorFlashPlatformLib.h>
>
> +#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
> --
> 2.11.0
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
  2017-11-16  9:40 ` Ard Biesheuvel
@ 2017-11-16 11:59   ` Leif Lindholm
  2017-11-16 12:34     ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Leif Lindholm @ 2017-11-16 11:59 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel@lists.01.org, Laszlo Ersek

On Thu, Nov 16, 2017 at 09:40:58AM +0000, Ard Biesheuvel wrote:
> On 15 November 2017 at 14:03, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > 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 <ard.biesheuvel@linaro.org>
> > ---
> > 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(-)
> >
> > 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
> 
> Oops. I will need to retain the -mcpu setting here, or the 'hvc'
> instruction will be rejected by the assembler.

Don't we have source-level overrides for that?
At least ".arch_extension virt" for GNU.

/
    Leif


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
  2017-11-16 11:59   ` Leif Lindholm
@ 2017-11-16 12:34     ` Ard Biesheuvel
  2017-11-16 14:15       ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 12:34 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel@lists.01.org, Laszlo Ersek



> On 16 Nov 2017, at 11:59, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> 
>> On Thu, Nov 16, 2017 at 09:40:58AM +0000, Ard Biesheuvel wrote:
>>> On 15 November 2017 at 14:03, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>> 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 <ard.biesheuvel@linaro.org>
>>> ---
>>> 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(-)
>>> 
>>> 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
>> 
>> Oops. I will need to retain the -mcpu setting here, or the 'hvc'
>> instruction will be rejected by the assembler.
> 
> Don't we have source-level overrides for that?
> At least ".arch_extension virt" for GNU.
> 

Yeah, or at least move the cflags override to the .inf of the library that uses the hvc instruction

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
  2017-11-16 12:34     ` Ard Biesheuvel
@ 2017-11-16 14:15       ` Ard Biesheuvel
  2017-11-16 16:28         ` Ard Biesheuvel
  0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 14:15 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel@lists.01.org, Laszlo Ersek

On 16 November 2017 at 12:34, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
>
>> On 16 Nov 2017, at 11:59, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>>
>>> On Thu, Nov 16, 2017 at 09:40:58AM +0000, Ard Biesheuvel wrote:
>>>> On 15 November 2017 at 14:03, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>>> 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 <ard.biesheuvel@linaro.org>
>>>> ---
>>>> 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(-)
>>>>
>>>> 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
>>>
>>> Oops. I will need to retain the -mcpu setting here, or the 'hvc'
>>> instruction will be rejected by the assembler.
>>
>> Don't we have source-level overrides for that?
>> At least ".arch_extension virt" for GNU.
>>
>
> Yeah, or at least move the cflags override to the .inf of the library that uses the hvc instruction

As it turns out, ArmVirtQemu.dsc builds find without the -mcpu CFLAGS,
due to the fact that we already have .arch_extension virt' in
ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S, which is the only file that is
affected by this AFAICT. I will double check how RVCT deals with this,
but I will move the --cpu=Cortex-A15 flag into
ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf at the very least


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency
  2017-11-16 14:15       ` Ard Biesheuvel
@ 2017-11-16 16:28         ` Ard Biesheuvel
  0 siblings, 0 replies; 7+ messages in thread
From: Ard Biesheuvel @ 2017-11-16 16:28 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel@lists.01.org, Laszlo Ersek

On 16 November 2017 at 14:15, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 16 November 2017 at 12:34, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>
>>
>>> On 16 Nov 2017, at 11:59, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>>>
>>>> On Thu, Nov 16, 2017 at 09:40:58AM +0000, Ard Biesheuvel wrote:
>>>>> On 15 November 2017 at 14:03, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>>>> 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 <ard.biesheuvel@linaro.org>
>>>>> ---
>>>>> 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(-)
>>>>>
>>>>> 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
>>>>
>>>> Oops. I will need to retain the -mcpu setting here, or the 'hvc'
>>>> instruction will be rejected by the assembler.
>>>
>>> Don't we have source-level overrides for that?
>>> At least ".arch_extension virt" for GNU.
>>>
>>
>> Yeah, or at least move the cflags override to the .inf of the library that uses the hvc instruction
>
> As it turns out, ArmVirtQemu.dsc builds find without the -mcpu CFLAGS,
> due to the fact that we already have .arch_extension virt' in
> ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S, which is the only file that is
> affected by this AFAICT. I will double check how RVCT deals with this,
> but I will move the --cpu=Cortex-A15 flag into
> ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf at the very least


Pushed as f311e5d8b5e1928eec602334194187d7811d905a (with the --cpu
issue fixed due to 302e8eda3b2f848e54bd21d0a8b2e5d8b891bffd 'ArmPkg:
move RVCT PLATFORM_FLAGS override into ArmHvcLib/ArmSmcLib')


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-16 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15 14:03 [PATCH] ArmVirtPkg: remove ArmPlatformSysConfigLib dependency Ard Biesheuvel
2017-11-15 23:03 ` Laszlo Ersek
2017-11-16  9:40 ` Ard Biesheuvel
2017-11-16 11:59   ` Leif Lindholm
2017-11-16 12:34     ` Ard Biesheuvel
2017-11-16 14:15       ` Ard Biesheuvel
2017-11-16 16:28         ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox