public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: <devel@edk2.groups.io>
Cc: Sami Mujawar <sami.mujawar@arm.com>, <ard.biesheuvel@arm.com>,
	<leif@nuviainc.com>, <thomas.abraham@arm.com>,
	<Matteo.Carlini@arm.com>, <Laura.Moretta@arm.com>, <nd@arm.com>
Subject: [PATCH edk2-platforms v1 1/2] Platform/ARM: Link NorFlashDxe with BaseMemoryLibMmio
Date: Thu, 14 May 2020 09:46:06 +0100	[thread overview]
Message-ID: <20200514084607.25956-2-sami.mujawar@arm.com> (raw)
In-Reply-To: <20200514084607.25956-1-sami.mujawar@arm.com>

NorFlashDxe must use aligned MMIO accesses to
read data from flash as this is device memory.

The AlignedCopyMem() in NorFlashDxe was used to
copy the flash data which prevented unaligned
access to device memory. However, the compiler
could optimize the code to generate pre/post
indexed or LDP operations. This is a problem
for guest/virtual firmware as the hypervisor
code cannot get the syndrome information for
the trapped accesses.

To address the such issues, BaseMemoryLibMmio
library has been introduced to perform aligned
MMIO accesses.

The NorFlashDxe has been updated to use
CopyMem() instead of using AlignedCopyMem()
and therefore the NorFlashDxe must be linked
with BaseMemoryLibMmio.

This patch updates the workspace files to link
NorFlashDxe with BaseMemoryLibMmio for the
following platforms:
  - Arm Juno
  - Sgi Platform
  - Arm VExpress CTA15-A7
  - Arm VExpress FVP

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/JunoPkg/ArmJuno.dsc                     | 7 +++++--
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc              | 5 ++++-
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 7 +++++--
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 7 +++++--
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index a6ea957b383219283354500d4c9f0baaa7ade6c9..fc9f2450fddac69e605a2821efa5fc3476ac7c2f 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2020, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -275,7 +275,10 @@ [Components.common]
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
-  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf {
+    <LibraryClasses>
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf
+  }
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
 
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index f5f9f144eee9ee1d24aaac1a434a7d26f28c4eb3..c57c561c58502f3429f353207680692d3be2b837 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -225,7 +225,10 @@ [Components.common]
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
-  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf {
+    <LibraryClasses>
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf
+  }
   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
   EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 144dd4f8b8e9bf3639719709ad02c042ea8481eb..3a2d25bc8ec64094f3c51b203cde678afbf43d78 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2012-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2012-2020, ARM Limited. All rights reserved.
 #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -228,7 +228,10 @@ [Components.common]
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
-  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf {
+    <LibraryClasses>
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf
+  }
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index a6f536a332281a624403dac2e4bf18aa9ba96d0b..b0066e12d75820ebf5972d73b4b3907f3f5f697e 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2020, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -270,7 +270,10 @@ [Components.common]
 !endif
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
-  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf {
+    <LibraryClasses>
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLibMmio/BaseMemoryLibMmio.inf
+  }
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
 !ifdef EDK2_ENABLE_PL111
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


  reply	other threads:[~2020-05-14  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14  8:46 [PATCH edk2-platforms v1 0/1] Use BaseMemoryLibMmio with NorFlashDxe Sami Mujawar
2020-05-14  8:46 ` Sami Mujawar [this message]
2020-05-14  8:46 ` [PATCH edk2-platforms v1 2/2] Platform/Comcast: Link NorFlashDxe with BaseMemoryLibMmio Sami Mujawar

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=20200514084607.25956-2-sami.mujawar@arm.com \
    --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