public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, alan@softiron.co.uk,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms 3/6] Silicon/Styx: get rid of NUM_CORES preprocessor define on command line
Date: Tue, 11 Dec 2018 16:02:34 +0100	[thread overview]
Message-ID: <20181211150237.32275-4-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20181211150237.32275-1-ard.biesheuvel@linaro.org>

Instead of relying on the compiler command line to pass the value
of NUM_CORES as a preprocessor define, use the value of the PcdCoreCount
PCD that we already set in the platform .DSC.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/AMD/OverdriveBoard/OverdriveBoard.dsc                 | 4 ++--
 Platform/LeMaker/CelloBoard/CelloBoard.dsc                     | 4 ++--
 Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc    | 4 ++--
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf   | 2 ++
 Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf | 2 ++
 Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c   | 2 ++
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl              | 2 ++
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Pptt.aslc             | 2 ++
 8 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
index 9172c82fdeba..696090cfb2dd 100644
--- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
+++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
@@ -268,8 +268,8 @@ DEFINE DO_CAPSULE   = FALSE
   *_*_*_ASLPP_FLAGS             = $(ARCHCC_FLAGS)
   *_*_*_ASLCC_FLAGS             = $(ARCHCC_FLAGS)
 
-  GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_XGBE=$(DO_XGBE) -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES)
-  GCC:*_*_AARCH64_PP_FLAGS = -DDO_XGBE=$(DO_XGBE) -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES)
+  GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_XGBE=$(DO_XGBE) -DDO_KCS=$(DO_KCS)
+  GCC:*_*_AARCH64_PP_FLAGS = -DDO_XGBE=$(DO_XGBE) -DDO_KCS=$(DO_KCS)
 
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
index f556591b9e25..5056122aa681 100644
--- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
+++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
@@ -260,8 +260,8 @@ DEFINE DO_FLASHER   = FALSE
   *_*_*_ASLPP_FLAGS             = $(ARCHCC_FLAGS)
   *_*_*_ASLCC_FLAGS             = $(ARCHCC_FLAGS)
 
-  GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES)
-  GCC:*_*_AARCH64_PP_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES)
+  GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_KCS=$(DO_KCS)
+  GCC:*_*_AARCH64_PP_FLAGS = -DDO_KCS=$(DO_KCS)
 
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
index 5abf1d52f916..8187e799a6fc 100644
--- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
+++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
@@ -258,8 +258,8 @@ DEFINE DO_FLASHER   = FALSE
   *_*_*_ASLPP_FLAGS             = $(ARCHCC_FLAGS)
   *_*_*_ASLCC_FLAGS             = $(ARCHCC_FLAGS)
 
-  GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES)
-  GCC:*_*_AARCH64_PP_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES)
+  GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_KCS=$(DO_KCS)
+  GCC:*_*_AARCH64_PP_FLAGS = -DDO_KCS=$(DO_KCS)
 
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
index 2a42d76d4883..be885d6aea90 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -42,6 +42,7 @@
   SsdtXgbe.asl
 
 [Packages]
+  ArmPlatformPkg/ArmPlatformPkg.dec
   ArmPkg/ArmPkg.dec
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
@@ -84,6 +85,7 @@
   gAmdStyxTokenSpaceGuid.PcdSbsaWakeUpGSIV
   gAmdStyxTokenSpaceGuid.PcdSbsaWatchDogGSIV
   gAmdStyxTokenSpaceGuid.PcdSerialDbgRegisterBase
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
   gArmTokenSpaceGuid.PcdGicDistributorBase
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf
index 3f36799f5df1..87cdcb3e6b25 100644
--- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf
+++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.inf
@@ -24,6 +24,7 @@
   StyxDtbLoaderLib.c
 
 [Packages]
+  ArmPlatformPkg/ArmPlatformPkg.dec
   ArmPkg/ArmPkg.dec
   MdePkg/MdePkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
@@ -49,6 +50,7 @@
   gArmTokenSpaceGuid.PcdSystemMemoryBase
 
 [FixedPcd]
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
   gArmTokenSpaceGuid.PcdArmLinuxFdtMaxOffset
   gArmTokenSpaceGuid.PcdArmLinuxFdtAlignment
   gAmdStyxTokenSpaceGuid.PcdSata1PortCount
diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
index 4ca5d9bebed6..b1e4984d3fd0 100644
--- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
+++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
@@ -33,6 +33,8 @@
 #define PMU_INT_FLAG_SPI        0
 #define PMU_INT_TYPE_HIGH_LEVEL 4
 
+#define NUM_CORES               FixedPcdGet32 (PcdCoreCount)
+
 //
 // PMU interrupts per core
 //
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
index c1417e7e1cd7..60288114aeab 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
@@ -21,6 +21,8 @@
 
 **/
 
+#define NUM_CORES                           FixedPcdGet32 (PcdCoreCount)
+
 DefinitionBlock ("DSDT.aml", "DSDT", 2, "AMDINC", "SEATTLE ", 3)
 {
     Scope (_SB)
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Pptt.aslc b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Pptt.aslc
index 64a6cda7fd87..031307fa3c36 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Pptt.aslc
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Pptt.aslc
@@ -18,6 +18,8 @@
 
 #define FIELD_OFFSET(type, name)            __builtin_offsetof(type, name)
 
+#define NUM_CORES                           FixedPcdGet32 (PcdCoreCount)
+
 #pragma pack(1)
 typedef struct {
   EFI_ACPI_6_2_PPTT_STRUCTURE_PROCESSOR                     Core;
-- 
2.19.2



  parent reply	other threads:[~2018-12-11 15:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 15:02 [PATCH edk2-platforms 0/6] Silicon/Styx: another round of cleanups Ard Biesheuvel
2018-12-11 15:02 ` [PATCH edk2-platforms 1/6] Platform/AMD/OverdriveBoard: fix byte order of default MAC addresses Ard Biesheuvel
2018-12-11 15:02 ` [PATCH edk2-platforms 2/6] Silicon/Styx: drop ARM_CPU_AARCH64 define Ard Biesheuvel
2018-12-11 15:02 ` Ard Biesheuvel [this message]
2018-12-11 15:02 ` [PATCH edk2-platforms 4/6] Silicon/Styx: switch to device path protocol driver Ard Biesheuvel
2018-12-11 15:02 ` [PATCH edk2-platforms 5/6] Platform/AMD/OverdriveBoard: enable support for IPv6 networking and HTTP boot Ard Biesheuvel
2018-12-11 15:02 ` [PATCH edk2-platforms 6/6] Platform/AMD/OverdriveBoard: build device tree from source Ard Biesheuvel
2018-12-11 15:53 ` [PATCH edk2-platforms 0/6] Silicon/Styx: another round of cleanups Leif Lindholm
2018-12-11 16:46   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181211150237.32275-4-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox