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,
	graeme.gregory@linaro.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms 1/6] Silicon/AMD/Styx: move SOC version macros to common header
Date: Wed,  5 Dec 2018 19:50:15 +0100	[thread overview]
Message-ID: <20181205185020.21441-2-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20181205185020.21441-1-ard.biesheuvel@linaro.org>

Instead of adding yet another redefinition in the next patch, move
the silicon revision testing macros into a shared header file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/AMD/Styx/Common/SocVersion.h                          | 19 +++++++++++++++++++
 Silicon/AMD/Styx/AcpiTables/Iort.c                            |  6 +-----
 Silicon/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c |  7 ++-----
 Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c  |  7 ++-----
 4 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/Silicon/AMD/Styx/Common/SocVersion.h b/Silicon/AMD/Styx/Common/SocVersion.h
new file mode 100644
index 000000000000..fc270b7c3431
--- /dev/null
+++ b/Silicon/AMD/Styx/Common/SocVersion.h
@@ -0,0 +1,19 @@
+#/** @file
+#  SoC specific defines
+#
+#  Copyright (c) 2018 Linaro, Ltd. All rights reserved.<BR>
+#
+#  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.
+#
+#**/
+
+#define STYX_SOC_VERSION_MASK    0xFFF
+#define STYX_SOC_VERSION_A0      0x000
+#define STYX_SOC_VERSION_B0      0x010
+#define STYX_SOC_VERSION_B1      0x011
diff --git a/Silicon/AMD/Styx/AcpiTables/Iort.c b/Silicon/AMD/Styx/AcpiTables/Iort.c
index 370e71e13610..9c232379eff5 100644
--- a/Silicon/AMD/Styx/AcpiTables/Iort.c
+++ b/Silicon/AMD/Styx/AcpiTables/Iort.c
@@ -14,6 +14,7 @@
 
 #include <AmdStyxAcpiLib.h>
 #include <IndustryStandard/IoRemappingTable.h>
+#include <SocVersion.h>
 
 #define FIELD_OFFSET(type, name)            __builtin_offsetof(type, name)
 
@@ -354,11 +355,6 @@ STATIC STYX_IO_REMAPPING_STRUCTURE AcpiIort = {
 
 #pragma pack()
 
-#define STYX_SOC_VERSION_MASK    0xFFF
-#define STYX_SOC_VERSION_A0      0x000
-#define STYX_SOC_VERSION_B0      0x010
-#define STYX_SOC_VERSION_B1      0x011
-
 EFI_ACPI_DESCRIPTION_HEADER *
 IortHeader (
   VOID
diff --git a/Silicon/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c b/Silicon/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c
index ea49cae9890f..1d2bca3d57ba 100644
--- a/Silicon/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c
+++ b/Silicon/AMD/Styx/Drivers/StyxSataPlatformDxe/InitController.c
@@ -22,6 +22,8 @@
 
 #include <Protocol/NonDiscoverableDevice.h>
 
+#include <SocVersion.h>
+
 STATIC
 VOID
 ResetSataController (
@@ -144,11 +146,6 @@ InitializeSataController (
            AhciBaseAddr, SIZE_4KB);
 }
 
-#define STYX_SOC_VERSION_MASK    0xFFF
-#define STYX_SOC_VERSION_A0      0x000
-#define STYX_SOC_VERSION_B0      0x010
-#define STYX_SOC_VERSION_B1      0x011
-
 EFI_STATUS
 EFIAPI
 StyxSataPlatformDxeEntryPoint (
diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
index 7e8f918b11b4..b9dfa2367ab2 100644
--- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
+++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
@@ -28,6 +28,8 @@
 
 #include <Protocol/AmdMpCoreInfo.h>
 
+#include <SocVersion.h>
+
 #define PMU_INT_FLAG_SPI        0
 #define PMU_INT_TYPE_HIGH_LEVEL 4
 
@@ -230,11 +232,6 @@ DisableSmmu (
   }
 }
 
-#define STYX_SOC_VERSION_MASK    0xFFF
-#define STYX_SOC_VERSION_A0      0x000
-#define STYX_SOC_VERSION_B0      0x010
-#define STYX_SOC_VERSION_B1      0x011
-
 STATIC
 VOID
 SetSocIdStatus (
-- 
2.19.2



  reply	other threads:[~2018-12-05 18:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 18:50 [PATCH edk2-platforms 0/6] Styx: fixes for IASL abuse and more Ard Biesheuvel
2018-12-05 18:50 ` Ard Biesheuvel [this message]
2018-12-05 18:50 ` [PATCH edk2-platforms 2/6] Silicon/AMD/Styx: move B1 revision peripherals to separate SSDT table Ard Biesheuvel
2018-12-05 18:50 ` [PATCH edk2-platforms 3/6] Silicon/AMD/Styx: move XGBE declarations " Ard Biesheuvel
2018-12-05 18:50 ` [PATCH edk2-platforms 4/6] Silicon/AMD/Styx: emit DSDT as aml directly Ard Biesheuvel
2018-12-05 18:50 ` [PATCH edk2-platforms 5/6] Platform: add acpiview to Seattle/Styx platforms Ard Biesheuvel
2018-12-05 21:39   ` Carsey, Jaben
2018-12-05 18:50 ` [PATCH edk2-platforms 6/6] Platform/AMD/OverdriveBoard: use default resolution for GOP Ard Biesheuvel
2018-12-10 21:58 ` [PATCH edk2-platforms 0/6] Styx: fixes for IASL abuse and more Leif Lindholm
2018-12-11  8:01   ` 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=20181205185020.21441-2-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