public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
To: devel@edk2.groups.io
Cc: leif.lindholm@linaro.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms v2 2/8] Platform/Overdrive: clean up stream ID descriptions in DT
Date: Wed, 27 Nov 2019 19:44:33 +0100	[thread overview]
Message-ID: <20191127184439.16793-3-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20191127184439.16793-1-ard.biesheuvel@linaro.org>

Align the DT description of the SMMU topology and stream IDs with the
actual routing of the SoC. As with the preceding IORT change, this is
mostly a cleanup exercise, but it does actually fix an issue with the
CCP crypto accelerator on B1 silicon.

Since the CCP shares its SMMU with the second SATA controller, which
is only enabled on B1 silicon, we can drop the logic that disables
this SMMU on B0 silicon or on platforms that do not expose any SATA
ports on the second controller (such as the Cello).

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts    | 23 +++++++++++++++-----
 Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c |  6 +----
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts
index 1ba0d403eaf0..1d8a6caafd82 100644
--- a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts
+++ b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts
@@ -86,7 +86,7 @@
 				       */
 				      <0 332 4>,
 				      <0 332 4>;
-			#iommu-cells = <2>;
+			#iommu-cells = <1>;
 			dma-coherent;
 		};
 
@@ -99,7 +99,7 @@
 				       */
 				      <0 331 4>,
 				      <0 331 4>;
-			#iommu-cells = <2>;
+			#iommu-cells = <1>;
 			dma-coherent;
 		};
 
@@ -109,7 +109,12 @@
 			interrupts = <0x0 0x163 0x4>;
 			clocks = <&sata_clk>;
 			dma-coherent;
-			iommus = <&sata0_smmu 0x00 0x1f>; /* 0-31 */
+			iommus = <&sata0_smmu 0x0a>,
+				 <&sata0_smmu 0x0b>,
+				 <&sata0_smmu 0x0e>,
+				 <&sata0_smmu 0x0f>,
+				 <&sata0_smmu 0x1a>,
+				 <&sata0_smmu 0x1e>;
 		};
 
 		sata@e0d00000 {
@@ -119,7 +124,9 @@
 			interrupts = <0x0 0x162 0x4>;
 			clocks = <&sata_clk>;
 			dma-coherent;
-			iommus = <&sata1_smmu 0x00 0x1f>; /* 0-31 */
+			iommus = <&sata1_smmu 0x0e>,
+				 <&sata1_smmu 0x0f>,
+				 <&sata1_smmu 0x1e>;
 		};
 
 		i2c@e1000000 {
@@ -233,6 +240,10 @@
 			interrupts = <0x0 0x3 0x4>;
 			dma-coherent;
 			amd,zlib-support = <0x1>;
+			iommus = <&sata1_smmu 0x00>,
+				 <&sata1_smmu 0x02>,
+				 <&sata1_smmu 0x40>,
+				 <&sata1_smmu 0x42>;
 		};
 
 		pcie: pcie@f0000000 {
@@ -409,7 +420,7 @@
 			phy-handle = <&xgmac0_phy>;
 			phy-mode = "xgmii";
 			dma-coherent;
-			iommus = <&xgmac0_smmu 0x00 0x1f>; /* 0-31 */
+			iommus = <&xgmac0_smmu 0x00 0x17>; /* 0-7, 16-23 */
 		};
 
 		xgmac@e0900000 {
@@ -428,7 +439,7 @@
 			phy-handle = <&xgmac1_phy>;
 			phy-mode = "xgmii";
 			dma-coherent;
-			iommus = <&xgmac1_smmu 0x00 0x1f>; /* 0-31 */
+			iommus = <&xgmac1_smmu 0x00 0x17>; /* 0-7, 16-23 */
 		};
 	};
 
diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
index c84c1a81c3ec..261b5f59c8df 100644
--- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
+++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c
@@ -212,8 +212,6 @@ DisableSmmu (
 
   Node = fdt_path_offset (Fdt, SmmuNodeName);
   if (Node <= 0) {
-    DEBUG ((DEBUG_WARN, "%a: Failed to find path %s: %a\n",
-      __FUNCTION__, SmmuNodeName, fdt_strerror (Node)));
     return;
   }
 
@@ -251,9 +249,7 @@ SetSocIdStatus (
   if (!PcdGetBool (PcdEnableSmmus)) {
     DisableSmmu (Fdt, "iommu-map", "/smb/smmu@e0a00000", "/smb/pcie@f0000000");
     DisableSmmu (Fdt, "iommus", "/smb/smmu@e0200000", "/smb/sata@e0300000");
-  }
-
-  if (!PcdGetBool (PcdEnableSmmus) || !IsRevB1 || FixedPcdGet8 (PcdSata1PortCount) == 0) {
+    DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c00000", "/smb/ccp@e0100000");
     DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c00000", "/smb/sata@e0d00000");
   }
 
-- 
2.17.1


  parent reply	other threads:[~2019-11-27 18:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 18:44 [PATCH edk2-platforms v2 0/8] fixes and updates for AMD OverDrive Ard Biesheuvel
2019-11-27 18:44 ` [PATCH edk2-platforms v2 1/8] Platform/Overdrive: add missing resolution for FileHandleLib Ard Biesheuvel
2019-11-27 18:44 ` Ard Biesheuvel [this message]
2019-11-27 18:44 ` [PATCH edk2-platforms v2 3/8] Platform/Overdrive: fix a typo in the DT Ard Biesheuvel
2019-11-28 12:32   ` Leif Lindholm
2019-11-28 13:32     ` Ard Biesheuvel
2019-11-27 18:44 ` [PATCH edk2-platforms v2 4/8] Silicon/AMD/Styx: clean up stream ID mappings for SMMU Ard Biesheuvel
2019-11-27 18:44 ` [PATCH edk2-platforms v2 5/8] Silicon/AMD/StyxDtbLoaderLib: add interrupt-affinity property to PMU node Ard Biesheuvel
2019-11-28 13:22   ` Leif Lindholm
2019-11-28 13:29     ` Ard Biesheuvel
2019-11-27 18:44 ` [PATCH edk2-platforms v2 6/8] Silicon/AMD/StyxDtbLoaderLib: add description of the cache topology Ard Biesheuvel
2019-11-28 13:24   ` Leif Lindholm
2019-11-27 18:44 ` [PATCH edk2-platforms v2 7/8] Silicon/AMD/StyxDtbLoaderLib: use Cortex-A57 IDs instead of generic ARMv8 Ard Biesheuvel
2019-11-28 13:37   ` Leif Lindholm
2019-11-28 13:39     ` Ard Biesheuvel
2019-11-28 13:40       ` Leif Lindholm
2019-11-28 15:07         ` Ard Biesheuvel
2019-11-27 18:44 ` [PATCH edk2-platforms v2 8/8] Silicon/AMD/StyxDtbLoaderLib: omit linux,phandle properties Ard Biesheuvel
2019-11-28 13:38   ` Leif Lindholm
2019-11-28 15:48 ` [PATCH edk2-platforms v2 0/8] fixes and updates for AMD OverDrive 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=20191127184439.16793-3-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