[edk2] [PATCH] Platform/ARM: Fix flash alignment access

evan.lloyd@arm.com posted 1 patch 6 years, 9 months ago
Failed in applying to current master (apply log)
Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
[edk2] [PATCH] Platform/ARM: Fix flash alignment access
Posted by evan.lloyd@arm.com 6 years, 9 months ago
From: Alexei Fedorov <Alexei.Fedorov@arm.com>

Flash memory is mapped as device memory and should use only aligned
accesses.
Update VariableRuntimeDxe from using BaseMemoryLibOptDxe to the generic
BaseMemoryLib which provides aligned memory access only.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
 Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 5c2a29fe8330bbf308e31e34b617517a5aebcf6d..9d7317683ef39ab47429234b98d94c04953b41cb 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -234,6 +234,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 1f612cc282eb8bf4fdc74ff0933c36ecf70c6daf..6c6c8d3938e61abf7456b4c2cd6b464c0238353b 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
 #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
@@ -215,6 +215,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 3dbc105f6f8a565da34807508ac8178e4d524e41..295e9a126b0ebaa4653d7e25e2f7d8c396403764 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -224,6 +224,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] Platform/ARM: Fix flash alignment access
Posted by Ard Biesheuvel 6 years, 9 months ago
On 22 January 2018 at 16:59,  <evan.lloyd@arm.com> wrote:
> From: Alexei Fedorov <Alexei.Fedorov@arm.com>
>
> Flash memory is mapped as device memory and should use only aligned
> accesses.
> Update VariableRuntimeDxe from using BaseMemoryLibOptDxe to the generic
> BaseMemoryLib which provides aligned memory access only.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>

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

> ---
>  Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
>  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
>  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
> index 5c2a29fe8330bbf308e31e34b617517a5aebcf6d..9d7317683ef39ab47429234b98d94c04953b41cb 100644
> --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
> +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
> @@ -234,6 +234,7 @@ [Components.common]
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>
> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> index 1f612cc282eb8bf4fdc74ff0933c36ecf70c6daf..6c6c8d3938e61abf7456b4c2cd6b464c0238353b 100644
> --- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> @@ -1,5 +1,5 @@
>  #
> -#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
> +#  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
>  #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
>  #
>  #  This program and the accompanying materials
> @@ -215,6 +215,7 @@ [Components.common]
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
> index 3dbc105f6f8a565da34807508ac8178e4d524e41..295e9a126b0ebaa4653d7e25e2f7d8c396403764 100644
> --- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
> @@ -224,6 +224,7 @@ [Components.common]
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> --
> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] Platform/ARM: Fix flash alignment access
Posted by Ard Biesheuvel 6 years, 9 months ago
On 22 January 2018 at 17:27, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 22 January 2018 at 16:59,  <evan.lloyd@arm.com> wrote:
>> From: Alexei Fedorov <Alexei.Fedorov@arm.com>
>>
>> Flash memory is mapped as device memory and should use only aligned
>> accesses.
>> Update VariableRuntimeDxe from using BaseMemoryLibOptDxe to the generic
>> BaseMemoryLib which provides aligned memory access only.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
>> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>

Pushed as 88e967c5d2f0

Thanks guys

>> ---
>>  Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
>>  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
>>  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
>>  3 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
>> index 5c2a29fe8330bbf308e31e34b617517a5aebcf6d..9d7317683ef39ab47429234b98d94c04953b41cb 100644
>> --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
>> +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
>> @@ -234,6 +234,7 @@ [Components.common]
>>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>>      <LibraryClasses>
>>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
>> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>>    }
>>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>
>> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
>> index 1f612cc282eb8bf4fdc74ff0933c36ecf70c6daf..6c6c8d3938e61abf7456b4c2cd6b464c0238353b 100644
>> --- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
>> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
>> @@ -1,5 +1,5 @@
>>  #
>> -#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
>> +#  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
>>  #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
>>  #
>>  #  This program and the accompanying materials
>> @@ -215,6 +215,7 @@ [Components.common]
>>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>>      <LibraryClasses>
>>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
>> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>>    }
>>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
>> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
>> index 3dbc105f6f8a565da34807508ac8178e4d524e41..295e9a126b0ebaa4653d7e25e2f7d8c396403764 100644
>> --- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
>> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
>> @@ -224,6 +224,7 @@ [Components.common]
>>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>>      <LibraryClasses>
>>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
>> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>>    }
>>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
>> --
>> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel