mirror of https://github.com/acidanthera/audk.git
OvmfPkg/QemuFwCfgLibMmio: Add RISC-V arch support
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> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
f8d0501ded
commit
26aa241d2f
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
Copyright (C) 2013 - 2014, Red Hat, Inc.
|
Copyright (C) 2013 - 2014, Red Hat, Inc.
|
||||||
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
|
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
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
**/
|
**/
|
||||||
|
@ -239,7 +240,7 @@ MmioReadBytes (
|
||||||
UINT8 *Ptr;
|
UINT8 *Ptr;
|
||||||
UINT8 *End;
|
UINT8 *End;
|
||||||
|
|
||||||
#ifdef MDE_CPU_AARCH64
|
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
|
||||||
Left = Size & 7;
|
Left = Size & 7;
|
||||||
#else
|
#else
|
||||||
Left = Size & 3;
|
Left = Size & 3;
|
||||||
|
@ -249,7 +250,7 @@ MmioReadBytes (
|
||||||
Ptr = Buffer;
|
Ptr = Buffer;
|
||||||
End = Ptr + Size;
|
End = Ptr + Size;
|
||||||
|
|
||||||
#ifdef MDE_CPU_AARCH64
|
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
|
||||||
while (Ptr < End) {
|
while (Ptr < End) {
|
||||||
*(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
|
*(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
|
||||||
Ptr += 8;
|
Ptr += 8;
|
||||||
|
@ -322,7 +323,7 @@ DmaTransferBytes (
|
||||||
//
|
//
|
||||||
// This will fire off the transfer.
|
// This will fire off the transfer.
|
||||||
//
|
//
|
||||||
#ifdef MDE_CPU_AARCH64
|
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64)
|
||||||
MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
|
MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
|
||||||
#else
|
#else
|
||||||
MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
|
MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
# The following information is for reference only and not required by the build
|
# The following information is for reference only and not required by the build
|
||||||
# tools.
|
# tools.
|
||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = ARM AARCH64
|
# VALID_ARCHITECTURES = ARM AARCH64 RISCV64
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
|
|
Loading…
Reference in New Issue