diff mbox

[Linaro-uefi,linaro-uefi,v6,32/37] Hisilicon/D05: flash related drivers switch to use generic BaseMemoryLib

Message ID 1481021828-59826-33-git-send-email-heyi.guo@linaro.org
State Superseded
Headers show

Commit Message

gary guo Dec. 6, 2016, 10:57 a.m. UTC
The BaseMemoryLib has switch to use BaseMemoryLibOptDxe at OPP, but
the flash module is device attributes and have to be alignment accessed.
so we change the flash related drivers to use generic BaseMemoryLib which
is alignment access.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
---
 Platforms/Hisilicon/D05/D05.dsc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ard Biesheuvel Dec. 6, 2016, 11:08 a.m. UTC | #1
On 6 December 2016 at 10:57, Heyi Guo <heyi.guo@linaro.org> wrote:
> The BaseMemoryLib has switch to use BaseMemoryLibOptDxe at OPP, but
> the flash module is device attributes and have to be alignment accessed.
> so we change the flash related drivers to use generic BaseMemoryLib which
> is alignment access.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

In the longer term, I would like to fix these drivers so they don't
use generic CopyMem() functionality on flash regions, but for now,
this is the best workaround

For this patch and the two following ones

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

> ---
>  Platforms/Hisilicon/D05/D05.dsc | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/Platforms/Hisilicon/D05/D05.dsc b/Platforms/Hisilicon/D05/D05.dsc
> index edaad18..3242b29 100644
> --- a/Platforms/Hisilicon/D05/D05.dsc
> +++ b/Platforms/Hisilicon/D05/D05.dsc
> @@ -494,6 +494,7 @@
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> @@ -608,7 +609,10 @@
>    OpenPlatformPkg/Chips/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
>
>  !ifdef $(FDT_ENABLE)
> -  OpenPlatformPkg/Chips/Hisilicon/Drivers/UpdateFdtDxe/UpdateFdtDxe.inf
> +  OpenPlatformPkg/Chips/Hisilicon/Drivers/UpdateFdtDxe/UpdateFdtDxe.inf {
> +    <LibraryClasses>
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  }
>  !endif #$(FDT_ENABLE)
>
>    #PCIe Support
> --
> 1.9.1
>
Leif Lindholm Dec. 6, 2016, 11:54 a.m. UTC | #2
On Tue, Dec 06, 2016 at 06:57:03PM +0800, Heyi Guo wrote:
> The BaseMemoryLib has switch to use BaseMemoryLibOptDxe at OPP, but
> the flash module is device attributes and have to be alignment accessed.
> so we change the flash related drivers to use generic BaseMemoryLib which
> is alignment access.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

With Ard's R-b:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  Platforms/Hisilicon/D05/D05.dsc | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Platforms/Hisilicon/D05/D05.dsc b/Platforms/Hisilicon/D05/D05.dsc
> index edaad18..3242b29 100644
> --- a/Platforms/Hisilicon/D05/D05.dsc
> +++ b/Platforms/Hisilicon/D05/D05.dsc
> @@ -494,6 +494,7 @@
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> @@ -608,7 +609,10 @@
>    OpenPlatformPkg/Chips/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
>  
>  !ifdef $(FDT_ENABLE)
> -  OpenPlatformPkg/Chips/Hisilicon/Drivers/UpdateFdtDxe/UpdateFdtDxe.inf
> +  OpenPlatformPkg/Chips/Hisilicon/Drivers/UpdateFdtDxe/UpdateFdtDxe.inf {
> +    <LibraryClasses>
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  }
>  !endif #$(FDT_ENABLE)
>  
>    #PCIe Support
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/Platforms/Hisilicon/D05/D05.dsc b/Platforms/Hisilicon/D05/D05.dsc
index edaad18..3242b29 100644
--- a/Platforms/Hisilicon/D05/D05.dsc
+++ b/Platforms/Hisilicon/D05/D05.dsc
@@ -494,6 +494,7 @@ 
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
@@ -608,7 +609,10 @@ 
   OpenPlatformPkg/Chips/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
 
 !ifdef $(FDT_ENABLE)
-  OpenPlatformPkg/Chips/Hisilicon/Drivers/UpdateFdtDxe/UpdateFdtDxe.inf
+  OpenPlatformPkg/Chips/Hisilicon/Drivers/UpdateFdtDxe/UpdateFdtDxe.inf {
+    <LibraryClasses>
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  }
 !endif #$(FDT_ENABLE)
 
   #PCIe Support