[edk2,edk2-platforms] Platform/Hisilicon: switch to NonCoherentDmaLib

Message ID 20170831135128.14065-1-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • [edk2,edk2-platforms] Platform/Hisilicon: switch to NonCoherentDmaLib
Related show

Commit Message

Ard Biesheuvel Aug. 31, 2017, 1:51 p.m.
Remove the shared ArmDmaLib resolution from the shared .dsc include
file: it will be removed soon from upstream EDK2. Instead, replace
it with an explicit NonCoherentDmaLib resolution for each driver that
depends on DmaLib. This makes it more insightful which peripherals are
non cache coherent, and forces derived platforms to choose a DmaLib
resolution explicitly for newly added drivers.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Platform/Hisilicon/D02/Pv660D02.dsc | 6 +++++-
 Platform/Hisilicon/D03/D03.dsc      | 1 +
 Platform/Hisilicon/D05/D05.dsc      | 1 +
 Silicon/Hisilicon/Hisilicon.dsc.inc | 1 -
 4 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Leif Lindholm Sept. 1, 2017, 10:58 a.m. | #1
On Thu, Aug 31, 2017 at 02:51:28PM +0100, Ard Biesheuvel wrote:
> Remove the shared ArmDmaLib resolution from the shared .dsc include

> file: it will be removed soon from upstream EDK2. Instead, replace

> it with an explicit NonCoherentDmaLib resolution for each driver that

> depends on DmaLib. This makes it more insightful which peripherals are


I would suggest "insightful" -> "clear" or "obvious".
Fold that in if you agree.

> non cache coherent, and forces derived platforms to choose a DmaLib

> resolution explicitly for newly added drivers.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> ---

>  Platform/Hisilicon/D02/Pv660D02.dsc | 6 +++++-

>  Platform/Hisilicon/D03/D03.dsc      | 1 +

>  Platform/Hisilicon/D05/D05.dsc      | 1 +

>  Silicon/Hisilicon/Hisilicon.dsc.inc | 1 -

>  4 files changed, 7 insertions(+), 2 deletions(-)

> 

> diff --git a/Platform/Hisilicon/D02/Pv660D02.dsc b/Platform/Hisilicon/D02/Pv660D02.dsc

> index 423f7d77ff8d..1fd2b98f1552 100644

> --- a/Platform/Hisilicon/D02/Pv660D02.dsc

> +++ b/Platform/Hisilicon/D02/Pv660D02.dsc

> @@ -354,6 +354,7 @@

>    Silicon/Hisilicon/Pv660/Drivers/PcieInitDxe/PcieInitDxe.inf

>    Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {

>       <LibraryClasses>

> +       DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf

>         NULL|Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf

>    }

>    MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf

> @@ -379,7 +380,10 @@

>    MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf

>    MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

>  

> -  Silicon/Hisilicon/Drivers/SasV1Dxe/SasV1Dxe.inf

> +  Silicon/Hisilicon/Drivers/SasV1Dxe/SasV1Dxe.inf {

> +    <LibraryClasses>

> +      DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf

> +  }

>    MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf

>    MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf

>    Silicon/Hisilicon/Pv660/Drivers/SasInitDxe/SasV1Init.inf

> diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc

> index 6363b7eeec50..afea162cc48f 100644

> --- a/Platform/Hisilicon/D03/D03.dsc

> +++ b/Platform/Hisilicon/D03/D03.dsc

> @@ -473,6 +473,7 @@

>    Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf

>    Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {

>      <LibraryClasses>

> +      DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf

>        NULL|Platform/Hisilicon/D03/Library/PlatformPciLib/PlatformPciLib.inf

>    }

>  

> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc

> index 35c319757ef8..3cdb1b161bd5 100644

> --- a/Platform/Hisilicon/D05/D05.dsc

> +++ b/Platform/Hisilicon/D05/D05.dsc

> @@ -609,6 +609,7 @@

>    Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf

>    Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {

>      <LibraryClasses>

> +      DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf

>        NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf

>    }

>  

> diff --git a/Silicon/Hisilicon/Hisilicon.dsc.inc b/Silicon/Hisilicon/Hisilicon.dsc.inc

> index fadd352192ee..d77f0e35431e 100644

> --- a/Silicon/Hisilicon/Hisilicon.dsc.inc

> +++ b/Silicon/Hisilicon/Hisilicon.dsc.inc

> @@ -56,7 +56,6 @@

>    DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf

>    CpuExceptionHandlerLib|ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.inf

>    ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf

> -  DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf

>    ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf

>    ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf

>    ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf

> -- 

> 2.11.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Sept. 1, 2017, 11:59 a.m. | #2
On 1 September 2017 at 11:58, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Thu, Aug 31, 2017 at 02:51:28PM +0100, Ard Biesheuvel wrote:

>> Remove the shared ArmDmaLib resolution from the shared .dsc include

>> file: it will be removed soon from upstream EDK2. Instead, replace

>> it with an explicit NonCoherentDmaLib resolution for each driver that

>> depends on DmaLib. This makes it more insightful which peripherals are

>

> I would suggest "insightful" -> "clear" or "obvious".

> Fold that in if you agree.

>

>> non cache coherent, and forces derived platforms to choose a DmaLib

>> resolution explicitly for newly added drivers.

>>

>> Contributed-under: TianoCore Contribution Agreement 1.1

>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>

> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

>


Pushed as 0b4ef4583f33 with s/insightful/obvious/

Thanks
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/Platform/Hisilicon/D02/Pv660D02.dsc b/Platform/Hisilicon/D02/Pv660D02.dsc
index 423f7d77ff8d..1fd2b98f1552 100644
--- a/Platform/Hisilicon/D02/Pv660D02.dsc
+++ b/Platform/Hisilicon/D02/Pv660D02.dsc
@@ -354,6 +354,7 @@ 
   Silicon/Hisilicon/Pv660/Drivers/PcieInitDxe/PcieInitDxe.inf
   Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
      <LibraryClasses>
+       DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
        NULL|Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
   }
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
@@ -379,7 +380,10 @@ 
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 
-  Silicon/Hisilicon/Drivers/SasV1Dxe/SasV1Dxe.inf
+  Silicon/Hisilicon/Drivers/SasV1Dxe/SasV1Dxe.inf {
+    <LibraryClasses>
+      DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
+  }
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
   Silicon/Hisilicon/Pv660/Drivers/SasInitDxe/SasV1Init.inf
diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
index 6363b7eeec50..afea162cc48f 100644
--- a/Platform/Hisilicon/D03/D03.dsc
+++ b/Platform/Hisilicon/D03/D03.dsc
@@ -473,6 +473,7 @@ 
   Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf
   Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
     <LibraryClasses>
+      DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
       NULL|Platform/Hisilicon/D03/Library/PlatformPciLib/PlatformPciLib.inf
   }
 
diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 35c319757ef8..3cdb1b161bd5 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -609,6 +609,7 @@ 
   Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf
   Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf {
     <LibraryClasses>
+      DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
       NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
   }
 
diff --git a/Silicon/Hisilicon/Hisilicon.dsc.inc b/Silicon/Hisilicon/Hisilicon.dsc.inc
index fadd352192ee..d77f0e35431e 100644
--- a/Silicon/Hisilicon/Hisilicon.dsc.inc
+++ b/Silicon/Hisilicon/Hisilicon.dsc.inc
@@ -56,7 +56,6 @@ 
   DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
   CpuExceptionHandlerLib|ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.inf
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
-  DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
   ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
   ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
   ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf