From: "Dhaval Sharma" <dhaval@rivosinc.com>
To: devel@edk2.groups.io
Cc: Guo Dong <guo.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
Sean Rhodes <sean@starlabs.systems>,
James Lu <james.lu@intel.com>, Gua Guo <gua.guo@intel.com>,
Sunil V <sunilvl@ventanamicro.com>
Subject: [PATCH v1 6/8] UefiPayloadPkg: Add FirmwareContext for RV64
Date: Thu, 11 May 2023 12:42:24 +0530 [thread overview]
Message-ID: <20230511071226.19726-7-dhaval@rivosinc.com> (raw)
In-Reply-To: <20230511071226.19726-1-dhaval@rivosinc.com>
RV CPU driver requires access to HartID and FDT passed by BL.
Set it through FirmwareContext. In future this should be passed
as part of FDT itself to avoid any custome structures.
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Cc: Sunil V <sunilvl@ventanamicro.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
---
UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf | 2 ++
UefiPayloadPkg/UefiPayloadEntry/RiscV64/Rv64FdtParserLib.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
index 9b21b218a657..0cc3c0994aa1 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
@@ -61,6 +61,8 @@ [LibraryClasses]
CpuLib
FdtLib
+[LibraryClasses.RISCV64]
+ RiscVSbiLib
[Guids]
gEfiMemoryTypeInformationGuid
gEfiFirmwareFileSystem2Guid
diff --git a/UefiPayloadPkg/UefiPayloadEntry/RiscV64/Rv64FdtParserLib.c b/UefiPayloadPkg/UefiPayloadEntry/RiscV64/Rv64FdtParserLib.c
index 76f0600482f7..7be38bb742f6 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/RiscV64/Rv64FdtParserLib.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/RiscV64/Rv64FdtParserLib.c
@@ -30,6 +30,7 @@
#include <UniversalPayload/ExtraData.h>
#include <UniversalPayload/SerialPortInfo.h>
#include <Guid/PcdDataBaseSignatureGuid.h>
+#include <Library/BaseRiscVSbiLib.h>
#include <libfdt.h>
#define E820_RAM 1
@@ -376,6 +377,14 @@ BuildBlHobs (
UINTN FdtPages;
UINT64 *FdtHobData;
CONST VOID *Fdt;
+ EFI_FFS_FILE_HEADER *FileHeader;
+ EFI_FIRMWARE_VOLUME_HEADER *DxeCoreFv;
+ EFI_STATUS Status;
+ EFI_RISCV_FIRMWARE_CONTEXT FirmwareContext;
+
+ FirmwareContext.BootHartId = Param1;
+ FirmwareContext.FlattenedDeviceTree = Param2;
+ SetFirmwareContextPointer (&FirmwareContext);
Fdt = (VOID *)Param2;
MinimalNeededSize = FixedPcdGet32 (PcdSystemMemoryUefiRegionSize);
--
2.34.1
next prev parent reply other threads:[~2023-05-11 7:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 7:12 DRAFT: [PATCH v1 0/8] RiscV64 Support In UPL Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 1/8] UefiPayloadPkg: Remove FP Init from UPL entry Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 2/8] UefiPayloadPkg: Move INT prog outside common flow Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 3/8] UefiPayloadPkg: Basic Infra To Enable RV64 UPL Support Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 4/8] UefiPayloadPkg: Update input params as per latest UPL spec Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 5/8] UefiPayloadPkg: Hook to parse IN params as per " Dhaval Sharma
2023-05-11 7:12 ` Dhaval Sharma [this message]
2023-05-11 7:12 ` [PATCH v1 7/8] UefiPayloadPkg: Find DxeFV and create required FV HOB Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 8/8] UefiPayloadPkg: Add RV64 driver to boot to UEFI Shell Dhaval Sharma
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=20230511071226.19726-7-dhaval@rivosinc.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