public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Vijayenthiran Subramaniam" <vijayenthiran.subramaniam@arm.com>
To: devel@edk2.groups.io, leif@nuviainc.com, michael.d.kinney@intel.com
Cc: thomas.abraham@arm.com
Subject: [PATCH edk2-platforms 3/5] Platform/ARM/SgiPkg: Add MultiChipMode to Platform Descriptor
Date: Tue, 11 Feb 2020 20:55:35 +0530	[thread overview]
Message-ID: <1581434737-11371-4-git-send-email-vijayenthiran.subramaniam@arm.com> (raw)
In-Reply-To: <1581434737-11371-1-git-send-email-vijayenthiran.subramaniam@arm.com>

The 'system-id' node of HW_CONFIG device tree has been updated to have
a new property 'multi-chip-mode' which holds the information about the
multi-chip-mode support. To adapt to this change, add 'MultiChipMode'
member to SGI_PLATFORM_DESCRIPTOR structure to get 'multi-chip-mode'
property from fdt.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h                    | 4 ++++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c        | 9 +++++++--
 Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c | 8 ++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index e4a2e8cc0971..7c9322d1cda9 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -79,10 +79,14 @@
 #define SGI_CONFIG_SHIFT                          0x1C
 #define SGI_PART_NUM_MASK                         0xFFF
 
+#define MULTI_CHIP_MODE_DISABLED                  0x0
+#define MULTI_CHIP_MODE_ENABLED                   0x1
+
 // ARM platform description data.
 typedef struct {
   UINTN  PlatformId;
   UINTN  ConfigId;
+  UINTN  MultiChipMode;
 } SGI_PLATFORM_DESCRIPTOR;
 
 #endif // __SGI_PLATFORM_H__
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
index 4ab0dd768cd1..d988a23b8093 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
@@ -17,10 +17,10 @@ typedef struct {
 } SGI_PLATFORM_ACPI_TABLE_GUID_LOOKUP;
 
 // Macro to construct the SGI_PLATFORM_ACPI_TABLE_GUID_LOOKUP structure
-#define ACPI_GUID_LOOKUP(PART_NUM, CONFIG_NUM, GUID)                           \
+#define ACPI_GUID_LOOKUP(PART_NUM, CONFIG_NUM, MULTI_CHIP_MODE, GUID)          \
 {                                                                              \
   {                                                                            \
-    PART_NUM, CONFIG_NUM                                                       \
+    PART_NUM, CONFIG_NUM, MULTI_CHIP_MODE                                      \
   },                                                                           \
   GUID                                                                         \
 }                                                                              \
@@ -29,14 +29,17 @@ STATIC SGI_PLATFORM_ACPI_TABLE_GUID_LOOKUP AcpiTableGuidLookup[] = {
   ACPI_GUID_LOOKUP (
       SGI575_PART_NUM,
       SGI575_CONF_NUM,
+      MULTI_CHIP_MODE_DISABLED,
       &gSgi575AcpiTablesFileGuid),
   ACPI_GUID_LOOKUP (
       RD_N1E1_EDGE_PART_NUM,
       RD_N1_EDGE_CONF_ID,
+      MULTI_CHIP_MODE_DISABLED,
       &gRdN1EdgeAcpiTablesFileGuid),
   ACPI_GUID_LOOKUP (
       RD_N1E1_EDGE_PART_NUM,
       RD_E1_EDGE_CONF_ID,
+      MULTI_CHIP_MODE_DISABLED,
       &gRdE1EdgeAcpiTablesFileGuid),
 };
 
@@ -58,6 +61,7 @@ ArmSgiPkgEntryPoint (
   UINT8                   i;
   UINT32                  ConfigId;
   UINT32                  PartNum;
+  UINT32                  MultiChipMode;
 
   SystemIdHob = GetFirstGuidHob (&gArmSgiPlatformIdDescriptorGuid);
   if (SystemIdHob == NULL) {
@@ -69,6 +73,7 @@ ArmSgiPkgEntryPoint (
 
   PartNum = HobData->PlatformId;
   ConfigId = HobData->ConfigId;
+  MultiChipMode = HobData->MultiChipMode;
 
   Status = EFI_UNSUPPORTED;
 
diff --git a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
index 4daa1832dfaf..7df52cc4fd7c 100644
--- a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
+++ b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
@@ -75,6 +75,14 @@ GetSgiSystemId (
 
   HobData->ConfigId = fdt32_to_cpu (*Property);
 
+  Property = fdt_getprop (NtFwCfgDtBlob, Offset, "multi-chip-mode", NULL);
+  if (Property == NULL) {
+    DEBUG ((DEBUG_WARN, "multi-chip-mode property not found\n"));
+    HobData->MultiChipMode = 0;
+  } else {
+    HobData->MultiChipMode = fdt32_to_cpu (*Property);
+  }
+
   return EFI_SUCCESS;
 }
 
-- 
2.7.4


  parent reply	other threads:[~2020-02-11 15:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 15:25 [PATCH edk2-platforms 0/5] Add support for RD-N1-Edge-Dual platform vijayenthiran.subramaniam
2020-02-11 15:25 ` [PATCH edk2-platforms 1/5] Platform/ARM/SgiPkg: Disable use of deprecated APIs Vijayenthiran Subramaniam
2020-02-11 15:25 ` [PATCH edk2-platforms 2/5] Platform/ARM/SgiPkg: Use lookup table to install ACPI table Vijayenthiran Subramaniam
2020-02-11 15:25 ` Vijayenthiran Subramaniam [this message]
2020-02-11 15:25 ` [PATCH edk2-platforms 4/5] Platform/ARM/Sgi: Add ACPI tables for dual-chip RD-N1-Edge platform Vijayenthiran Subramaniam
2020-02-11 15:25 ` [PATCH edk2-platforms 5/5] Platform/ARM/Sgi: Add initial support for RD-N1-Edge-Dual platform Vijayenthiran Subramaniam

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=1581434737-11371-4-git-send-email-vijayenthiran.subramaniam@arm.com \
    --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