public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms 0/3] Seattle Overdrive fixes
@ 2019-12-09 16:15 Ard Biesheuvel
  2019-12-09 16:15 ` [PATCH edk2-platforms 1/3] Platform/Overdrive: revert streamID DT changes for first SATA port Ard Biesheuvel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2019-12-09 16:15 UTC (permalink / raw)
  To: devel; +Cc: leif.lindholm, Ard Biesheuvel

Another set of tweaks to the Overdrive platform to increase compatibility
with versions of the hardware that are still circulating but weren't quite
production ready at the time.

Ard Biesheuvel (3):
  Platform/Overdrive: revert streamID DT changes for first SATA port
  Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT
  Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by
    the SCP

 .../OverdriveBoard/DeviceTree/OverdriveBoard.dts  |  9 ++-------
 .../AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc    |  5 ++++-
 .../AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c    | 15 +++++++++++----
 3 files changed, 17 insertions(+), 12 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH edk2-platforms 1/3] Platform/Overdrive: revert streamID DT changes for first SATA port
  2019-12-09 16:15 [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Ard Biesheuvel
@ 2019-12-09 16:15 ` Ard Biesheuvel
  2019-12-09 16:15 ` [PATCH edk2-platforms 2/3] Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT Ard Biesheuvel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2019-12-09 16:15 UTC (permalink / raw)
  To: devel; +Cc: leif.lindholm, Ard Biesheuvel

Commit 7a1cd6efbb483564dcf0ff3dda701bd09acf4b08 updated the stream ID
assignment for various masters on the Seattle SoC, primarily to address
a conflict between the second SATA port and the crypto accelerator on
platforms that implement them (B1 silicon). Unfortunately, B0 variants
turn out to exist where the stream ID assignment deviates from the
observed assignment on the B0 Overdrive that I tested these changes on,
leading to DMA access faults when using the first SATA port.

Since that port does not share its SMMU with any other masters, let's
revert the change to its stream ID assignment in the device tree, and
switch back to matching the entire range [0x0, 0x1f].

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts
index a92ab695fb2e..a1575d0a623b 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 = <1>;
+			#iommu-cells = <2>;
 			dma-coherent;
 		};
 
@@ -109,12 +109,7 @@
 			interrupts = <0x0 0x163 0x4>;
 			clocks = <&sata_clk>;
 			dma-coherent;
-			iommus = <&sata0_smmu 0x0a>,
-				 <&sata0_smmu 0x0b>,
-				 <&sata0_smmu 0x0e>,
-				 <&sata0_smmu 0x0f>,
-				 <&sata0_smmu 0x1a>,
-				 <&sata0_smmu 0x1e>;
+			iommus = <&sata0_smmu 0x0 0x1f>;
 		};
 
 		sata@e0d00000 {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH edk2-platforms 2/3] Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT
  2019-12-09 16:15 [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Ard Biesheuvel
  2019-12-09 16:15 ` [PATCH edk2-platforms 1/3] Platform/Overdrive: revert streamID DT changes for first SATA port Ard Biesheuvel
@ 2019-12-09 16:15 ` Ard Biesheuvel
  2019-12-09 16:15 ` [PATCH edk2-platforms 3/3] Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by the SCP Ard Biesheuvel
  2019-12-09 16:47 ` [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Leif Lindholm
  3 siblings, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2019-12-09 16:15 UTC (permalink / raw)
  To: devel; +Cc: leif.lindholm, Ard Biesheuvel

Add another set of stream IDs to the IORT section for the first
SATA port which have been observed to be in use on some versions
of B0 silicon.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc
index 4b48b4443227..b81f87b7794e 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc
@@ -228,12 +228,15 @@ STATIC STYX_IO_REMAPPING_STRUCTURE AcpiIort = {
                      STYX_SATA0_SMMU_INTERRUPT)
   }, {
     // Sata0NamedNode
-    __STYX_NAMED_COMPONENT_NODE("\\_SB_.AHC0", 6),
+    __STYX_NAMED_COMPONENT_NODE("\\_SB_.AHC0", 9),
     {
+      __STYX_ID_MAPPING_SINGLE(0x00, Sata0SmmuNode),
+      __STYX_ID_MAPPING_SINGLE(0x01, Sata0SmmuNode),
       __STYX_ID_MAPPING_SINGLE(0x0A, Sata0SmmuNode),
       __STYX_ID_MAPPING_SINGLE(0x0B, Sata0SmmuNode),
       __STYX_ID_MAPPING_SINGLE(0x0E, Sata0SmmuNode),
       __STYX_ID_MAPPING_SINGLE(0x0F, Sata0SmmuNode),
+      __STYX_ID_MAPPING_SINGLE(0x10, Sata0SmmuNode),
       __STYX_ID_MAPPING_SINGLE(0x1A, Sata0SmmuNode),
       __STYX_ID_MAPPING_SINGLE(0x1E, Sata0SmmuNode),
     }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH edk2-platforms 3/3] Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by the SCP
  2019-12-09 16:15 [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Ard Biesheuvel
  2019-12-09 16:15 ` [PATCH edk2-platforms 1/3] Platform/Overdrive: revert streamID DT changes for first SATA port Ard Biesheuvel
  2019-12-09 16:15 ` [PATCH edk2-platforms 2/3] Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT Ard Biesheuvel
@ 2019-12-09 16:15 ` Ard Biesheuvel
  2019-12-09 16:47 ` [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Leif Lindholm
  3 siblings, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2019-12-09 16:15 UTC (permalink / raw)
  To: devel; +Cc: leif.lindholm, Ard Biesheuvel

In some cases, the SCP on B0 Overdrive returns all ones for the
Ethernet MAC addresses, which breaks networking not only in UEFI
but also in the OS. So ignore the SCP in this case, and keep the
MAC addresses that have already been set at build time.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c b/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c
index 0f1d2c6ff6e3..4de26404a8a7 100644
--- a/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c
+++ b/Silicon/AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c
@@ -216,11 +216,18 @@ PlatInitPeiEntryPoint (
                PeiServices, &MacAddrInfo );
     ASSERT_EFI_ERROR (Status);
 
+    // Check for bogus MAC addresses that have the multicast bit set. This
+    // includes FF:FF:FF:FF:FF:FF, which is what you get from the SCP on
+    // some versions of the B0 Overdrive
     MacSize = sizeof(MacAddrInfo.MacAddress0);
-    Status = PcdSetPtrS (PcdEthMacA, &MacSize, MacAddrInfo.MacAddress0);
-    ASSERT_EFI_ERROR (Status);
-    Status = PcdSetPtrS (PcdEthMacB, &MacSize, MacAddrInfo.MacAddress1);
-    ASSERT_EFI_ERROR (Status);
+    if ((MacAddrInfo.MacAddress0[0] & 0x1) == 0x0) {
+      Status = PcdSetPtrS (PcdEthMacA, &MacSize, MacAddrInfo.MacAddress0);
+      ASSERT_EFI_ERROR (Status);
+    }
+    if ((MacAddrInfo.MacAddress1[0] & 0x1) == 0x0) {
+      Status = PcdSetPtrS (PcdEthMacB, &MacSize, MacAddrInfo.MacAddress1);
+      ASSERT_EFI_ERROR (Status);
+    }
 
     DEBUG ((EFI_D_ERROR, "EthMacA = %02x:%02x:%02x:%02x:%02x:%02x\n",
       ((UINT8 *)PcdGetPtr (PcdEthMacA))[0], ((UINT8 *)PcdGetPtr (PcdEthMacA))[1],
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH edk2-platforms 0/3] Seattle Overdrive fixes
  2019-12-09 16:15 [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Ard Biesheuvel
                   ` (2 preceding siblings ...)
  2019-12-09 16:15 ` [PATCH edk2-platforms 3/3] Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by the SCP Ard Biesheuvel
@ 2019-12-09 16:47 ` Leif Lindholm
  2019-12-09 17:38   ` Ard Biesheuvel
  3 siblings, 1 reply; 6+ messages in thread
From: Leif Lindholm @ 2019-12-09 16:47 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: devel

On Mon, Dec 09, 2019 at 17:15:18 +0100, Ard Biesheuvel wrote:
> Another set of tweaks to the Overdrive platform to increase compatibility
> with versions of the hardware that are still circulating but weren't quite
> production ready at the time.

Ugh.

Well,
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>

> Ard Biesheuvel (3):
>   Platform/Overdrive: revert streamID DT changes for first SATA port
>   Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT
>   Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by
>     the SCP
> 
>  .../OverdriveBoard/DeviceTree/OverdriveBoard.dts  |  9 ++-------
>  .../AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc    |  5 ++++-
>  .../AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c    | 15 +++++++++++----
>  3 files changed, 17 insertions(+), 12 deletions(-)
> 
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH edk2-platforms 0/3] Seattle Overdrive fixes
  2019-12-09 16:47 ` [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Leif Lindholm
@ 2019-12-09 17:38   ` Ard Biesheuvel
  0 siblings, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2019-12-09 17:38 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel-groups-io

On Mon, 9 Dec 2019 at 17:47, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>
> On Mon, Dec 09, 2019 at 17:15:18 +0100, Ard Biesheuvel wrote:
> > Another set of tweaks to the Overdrive platform to increase compatibility
> > with versions of the hardware that are still circulating but weren't quite
> > production ready at the time.
>
> Ugh.
>
> Well,
> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
>

Thanks

Pushed as 86d6e7dffbb5..3688ab6500e2

> > Ard Biesheuvel (3):
> >   Platform/Overdrive: revert streamID DT changes for first SATA port
> >   Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT
> >   Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by
> >     the SCP
> >
> >  .../OverdriveBoard/DeviceTree/OverdriveBoard.dts  |  9 ++-------
> >  .../AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc    |  5 ++++-
> >  .../AMD/Styx/Drivers/PlatInitPei/PlatInitPei.c    | 15 +++++++++++----
> >  3 files changed, 17 insertions(+), 12 deletions(-)
> >
> > --
> > 2.17.1
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-09 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-09 16:15 [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Ard Biesheuvel
2019-12-09 16:15 ` [PATCH edk2-platforms 1/3] Platform/Overdrive: revert streamID DT changes for first SATA port Ard Biesheuvel
2019-12-09 16:15 ` [PATCH edk2-platforms 2/3] Silicon/AMD/Styx: add some more stream IDs for SATA0 to the IORT Ard Biesheuvel
2019-12-09 16:15 ` [PATCH edk2-platforms 3/3] Silicon/AMD/Styx/PlatInitPei: ignore bogus MAC addresses provided by the SCP Ard Biesheuvel
2019-12-09 16:47 ` [PATCH edk2-platforms 0/3] Seattle Overdrive fixes Leif Lindholm
2019-12-09 17:38   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox