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 08/11] Silicon/AMD/Styx/AcpiPlatformDxe: move IPMI/KCS device into separate SSDT
Date: Tue, 11 Dec 2018 19:35:11 +0100	[thread overview]
Message-ID: <20181211183514.20948-9-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20181211183514.20948-1-ard.biesheuvel@linaro.org>

Move the IPMI/KCS device node from the DSDT into its own SSDT, and only
install it if we have support for KCS enabled in the platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf |  2 +
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c      |  5 +++
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl            | 25 -----------
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/SsdtKcs.asl         | 47 ++++++++++++++++++++
 4 files changed, 54 insertions(+), 25 deletions(-)

diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
index d27431343f4b..f231e0b2ee75 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -39,6 +39,7 @@
   Pptt.aslc
   Spcr.aslc
   SsdtB1.asl
+  SsdtKcs.asl
   SsdtXgbe.asl
 
 [Packages]
@@ -74,6 +75,7 @@
   gAmdStyxTokenSpaceGuid.PcdCntCTLBase
   gAmdStyxTokenSpaceGuid.PcdCntBase0
   gAmdStyxTokenSpaceGuid.PcdCntEL0Base0
+  gAmdStyxTokenSpaceGuid.PcdEnableKcs
   gAmdStyxTokenSpaceGuid.PcdGicVersion
   gAmdStyxTokenSpaceGuid.PcdGicHypervisorInterruptInterfaceBase
   gAmdStyxTokenSpaceGuid.PcdGicVirtualInterruptInterfaceBase
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c
index 9c8c8b09d4a4..9b1428fc00eb 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c
@@ -171,6 +171,11 @@ InstallSystemDescriptionTables (
 
       break;
 
+    case SIGNATURE_64 ('S', 't', 'y', 'x', 'K', 'c', 's', ' '):
+      if (!FixedPcdGetBool (PcdEnableKcs)) {
+        continue;
+      }
+
     default:
       switch (Table->Signature) {
       case EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE:
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
index 60288114aeab..118382371d73 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
@@ -295,31 +295,6 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "AMDINC", "SEATTLE ", 3)
             })
         }
 
-#if DO_KCS
-        //
-        // IPMI/KCS
-        //
-        Device (KCS0)
-        {
-            Name (_HID, "AMDI0300")
-            Name (_CID, "IPI0001")
-            Name (_STR, Unicode("IPMI_KCS"))
-            Name (_UID, 0)
-            Name (_CRS, ResourceTemplate() {
-                Memory32Fixed(ReadWrite, 0xE0010000, 0x1) // KCS Data In/Out
-                Memory32Fixed(ReadWrite, 0xE0010004, 0x1) // KCS Control/Status
-                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,,,) { 421 } // GSIV
-            })
-            Method (_IFT) {     // Interface Type
-                Return ( 0x01)   // IPMI KCS
-            }
-
-            Method (_SRV) {     // Spec Revision
-                Return (0x200)  // IPMI Spec v2.0
-            }
-        }
-#endif // DO_KCS
-
         //
         // PCIe Root Bus
         //
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/SsdtKcs.asl b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/SsdtKcs.asl
new file mode 100644
index 000000000000..3cac427df2d6
--- /dev/null
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/SsdtKcs.asl
@@ -0,0 +1,47 @@
+/** @file
+
+  SSDT for IPMI controller
+
+  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2014 - 2016, AMD Inc. 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.
+
+**/
+
+
+DefinitionBlock ("SsdtKcs.aml", "SSDT", 2, "AMDINC", "StyxKcs ", 3)
+{
+    Scope (_SB)
+    {
+        //
+        // IPMI/KCS
+        //
+        Device (KCS0)
+        {
+            Name (_HID, "AMDI0300")
+            Name (_CID, "IPI0001")
+            Name (_STR, Unicode("IPMI_KCS"))
+            Name (_UID, 0)
+            Name (_CRS, ResourceTemplate() {
+                Memory32Fixed(ReadWrite, 0xE0010000, 0x1) // KCS Data In/Out
+                Memory32Fixed(ReadWrite, 0xE0010004, 0x1) // KCS Control/Status
+                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,,,) { 421 } // GSIV
+            })
+            Method (_IFT) {     // Interface Type
+                Return ( 0x01)   // IPMI KCS
+            }
+
+            Method (_SRV) {     // Spec Revision
+                Return (0x200)  // IPMI Spec v2.0
+            }
+        }
+    }
+}
+
-- 
2.19.2



  parent reply	other threads:[~2018-12-11 18:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 18:35 [PATCH edk2-platforms 00/11] final set of Styx cleanups Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 01/11] Silicon/AMD/Styx/Iort: drop conditionally included XGBE nodes Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 02/11] Platform/SoftIron/Overdrive1000Board: remove dead XGBE references Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 03/11] Silicon/AMD/Styx/AcpiPlatformDxe: replace XGBE CPP conditional with PCD Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 04/11] Silicon/AMD/Styx/PlatInitPei: " Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 05/11] Silicon/AMD/Styx/StyxDtbLoaderLib: " Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 06/11] Platform/AMD/OverdriveBoard: drop DO_XGBE C preprocessor defines Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 07/11] Silicon/AMD/Styx: introduce boolean PCD for KCS/IPMI support Ard Biesheuvel
2018-12-11 18:35 ` Ard Biesheuvel [this message]
2018-12-11 18:35 ` [PATCH edk2-platforms 09/11] Silicon/AMD/Styx/StyxDtbLoaderLib: replace DO_KCS macro reference with PCD Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 10/11] Platform/Styx: get rid of DO_KCS preprocessor macro Ard Biesheuvel
2018-12-11 18:35 ` [PATCH edk2-platforms 11/11] Silicon/AMD/Styx/AcpiPlatformDxe: disable KCS on pre-B1 silicon Ard Biesheuvel
2018-12-12 22:23 ` [PATCH edk2-platforms 00/11] final set of Styx cleanups Leif Lindholm
2018-12-13 11:09   ` 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=20181211183514.20948-9-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