public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abner Chang" <abner.chang@hpe.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Daniel Schaefer <daniel.schaefer@hpe.com>,
	Sunil V L <sunilvl@ventanamicro.com>
Subject: [PATCH V3 08/12] OvmfPkg/QemuFwCfgLibMMIO: Add RISC-V arch support
Date: Thu, 30 Sep 2021 08:45:44 +0800	[thread overview]
Message-ID: <20210930004548.3033-9-abner.chang@hpe.com> (raw)
In-Reply-To: <20210930004548.3033-1-abner.chang@hpe.com>

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
---
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf | 2 +-
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c   | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
index 67531517b7..4b0dfbcb0d 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
@@ -23,7 +23,7 @@
 # The following information is for reference only and not required by the build
 # tools.
 #
-#  VALID_ARCHITECTURES           = ARM AARCH64
+#  VALID_ARCHITECTURES           = ARM AARCH64 RISCV64
 #
 
 [Sources]
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c
index e2ac4108d1..b953f2eb6c 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c
@@ -4,6 +4,7 @@
 
   Copyright (C) 2013 - 2014, Red Hat, Inc.
   Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -239,7 +240,7 @@ MmioReadBytes (
   UINT8 *Ptr;
   UINT8 *End;
 
-#ifdef MDE_CPU_AARCH64
+#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
   Left = Size & 7;
 #else
   Left = Size & 3;
@@ -249,7 +250,7 @@ MmioReadBytes (
   Ptr = Buffer;
   End = Ptr + Size;
 
-#ifdef MDE_CPU_AARCH64
+#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
   while (Ptr < End) {
     *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
     Ptr += 8;
@@ -322,7 +323,7 @@ DmaTransferBytes (
   //
   // This will fire off the transfer.
   //
-#ifdef MDE_CPU_AARCH64
+#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
   MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
 #else
   MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
-- 
2.17.1


  parent reply	other threads:[~2021-09-30  1:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  0:45 [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg Abner Chang
2021-09-30  0:45 ` [PATCH V3 01/12] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg Abner Chang
2021-09-30  0:45 ` [PATCH V3 02/12] MdePkg: Add PcdPciIoTranslation PCD Abner Chang
2021-09-30  0:45 ` [PATCH V3 03/12] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg Abner Chang
2021-09-30  0:45 ` [PATCH V3 04/12] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg Abner Chang
2021-09-30  0:45 ` [PATCH V3 05/12] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe " Abner Chang
2021-09-30  0:45 ` [PATCH V3 06/12] OvmfPkg/HighMemDxe: Add RISC-V in the supported arch Abner Chang
2021-09-30  0:45 ` [PATCH V3 07/12] ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg Abner Chang
2021-09-30  0:45 ` Abner Chang [this message]
2021-09-30  0:45 ` [PATCH V3 09/12] MdePkg: Add PcdPciMmio32(64)Translation PCDs Abner Chang
2021-09-30  0:45 ` [PATCH V3 10/12] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Abner Chang
2021-09-30  0:45 ` [PATCH V3 11/12] OvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch Abner Chang
2021-09-30  0:45 ` [PATCH V3 12/12] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt Abner Chang
2021-09-30  2:39 ` [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg Yao, Jiewen
2021-09-30  7:12 ` Gerd Hoffmann
2021-10-03  8:11 ` Daniel Schaefer
2021-10-04 10:05 ` Sunil V L
2021-10-05  9:30 ` [edk2-devel] " Ard Biesheuvel
2021-10-05 15:00   ` Abner Chang
     [not found]   ` <16AB2A90260D3DD8.20282@groups.io>
2021-10-06  9:27     ` Abner Chang
2021-10-08  3:14       ` 回复: " gaoliming
2021-10-08  3:39         ` Abner Chang
2021-10-11  1:22           ` 回复: " gaoliming
2021-10-12  4:16             ` Abner Chang
2021-10-14  9:51               ` Ard Biesheuvel
2021-10-14 10:13                 ` Abner Chang
2021-10-14 10:57                   ` Ard Biesheuvel

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=20210930004548.3033-9-abner.chang@hpe.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