From: "Abner Chang" <abner.chang@hpe.com>
To: devel@edk2.groups.io
Cc: abner.chang@hpe.com
Subject: [PATCH 36/79] RISC-V: Switch to latest OpenSBI
Date: Sat, 8 Jan 2022 12:10:56 +0800 [thread overview]
Message-ID: <20220108041121.16005-35-abner.chang@hpe.com> (raw)
In-Reply-To: <20220108041121.16005-1-abner.chang@hpe.com>
(This is migrated from edk2-platforms)
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
.../RiscVOpensbiLib/RiscVOpensbiLib.inf | 13 ++++++---
.../Include/Library/RiscVEdk2SbiLib.h | 1 +
.../ProcessorPkg/Include/OpensbiTypes.h | 1 +
.../Library/OpensbiPlatformLibNull/Platform.c | 27 ++++++++++++-------
.../PlatformPkg/Universal/Sec/SecMain.c | 5 ++--
.../Universal/Sec/Riscv64/SecEntry.S | 2 ++
6 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf b/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf
index 71cc76444e..e40a797896 100644
--- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf
+++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf
@@ -23,6 +23,7 @@
opensbi/lib/sbi/sbi_bitmap.c
opensbi/lib/sbi/sbi_bitops.c
opensbi/lib/sbi/sbi_console.c
+ opensbi/lib/sbi/sbi_domain.c
opensbi/lib/sbi/sbi_ecall.c
opensbi/lib/sbi/sbi_ecall_base.c
opensbi/lib/sbi/sbi_ecall_hsm.c
@@ -51,27 +52,33 @@
opensbi/lib/utils/fdt/fdt_helper.c
opensbi/lib/utils/fdt/fdt_fixup.c
+ opensbi/lib/utils/fdt/fdt_domain.c
opensbi/lib/utils/ipi/fdt_ipi.c
- opensbi/lib/utils/ipi/fdt_ipi_clint.c
+ opensbi/lib/utils/ipi/aclint_mswi.c
+ opensbi/lib/utils/ipi/fdt_ipi_mswi.c
opensbi/lib/utils/irqchip/fdt_irqchip.c
opensbi/lib/utils/irqchip/fdt_irqchip_plic.c
opensbi/lib/utils/irqchip/plic.c
opensbi/lib/utils/reset/fdt_reset.c
opensbi/lib/utils/reset/fdt_reset_htif.c
opensbi/lib/utils/reset/fdt_reset_sifive.c
+ opensbi/lib/utils/reset/fdt_reset_thead.c
+ opensbi/lib/utils/reset/fdt_reset_thead_asm.S
opensbi/lib/utils/serial/fdt_serial.c
opensbi/lib/utils/serial/fdt_serial_htif.c
opensbi/lib/utils/serial/fdt_serial_shakti.c
opensbi/lib/utils/serial/fdt_serial_sifive.c
opensbi/lib/utils/serial/fdt_serial_uart8250.c
+ opensbi/lib/utils/serial/fdt_serial_gaisler.c
+ opensbi/lib/utils/serial/gaisler-uart.c
opensbi/lib/utils/serial/shakti-uart.c
opensbi/lib/utils/serial/sifive-uart.c
opensbi/lib/utils/serial/uart8250.c
- opensbi/lib/utils/sys/clint.c
opensbi/lib/utils/sys/htif.c
opensbi/lib/utils/sys/sifive_test.c
opensbi/lib/utils/timer/fdt_timer.c
- opensbi/lib/utils/timer/fdt_timer_clint.c
+ opensbi/lib/utils/timer/aclint_mtimer.c
+ opensbi/lib/utils/timer/fdt_timer_mtimer.c
[Packages]
EmbeddedPkg/EmbeddedPkg.dec # For libfdt.
diff --git a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h
index f81ea06b05..66a87cb8c3 100644
--- a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h
+++ b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h
@@ -16,6 +16,7 @@
#include <IndustryStandard/RiscVOpensbi.h>
#include <sbi/sbi_scratch.h>
#include <sbi/sbi_platform.h>
+#include <sbi/sbi_ecall.h>
//
// EDK2 OpenSBI Firmware extension.
diff --git a/Silicon/RISC-V/ProcessorPkg/Include/OpensbiTypes.h b/Silicon/RISC-V/ProcessorPkg/Include/OpensbiTypes.h
index 37e407908a..8a6ea97708 100644
--- a/Silicon/RISC-V/ProcessorPkg/Include/OpensbiTypes.h
+++ b/Silicon/RISC-V/ProcessorPkg/Include/OpensbiTypes.h
@@ -49,6 +49,7 @@ typedef UINT64 physical_size_t;
#define __packed __attribute__((packed))
#define __noreturn __attribute__((noreturn))
+#define __aligned(x) __attribute__((aligned(x)))
#if defined(__GNUC__) || defined(__clang__)
#define likely(x) __builtin_expect((x), 1)
diff --git a/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c
index e78d811f4c..b7e39d19c1 100644
--- a/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c
+++ b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c
@@ -14,31 +14,38 @@
#include <sbi/sbi_platform.h>
const struct sbi_platform_operations platform_ops = {
- .pmp_region_count = NULL,
- .pmp_region_info = NULL,
+ .early_init = NULL,
.final_init = NULL,
+ .early_exit = NULL,
+ .final_exit = NULL,
+ .domains_root_regions = NULL,
+ .domains_init = NULL,
.console_putc = NULL,
.console_getc = NULL,
.console_init = NULL,
.irqchip_init = NULL,
+ .irqchip_exit = NULL,
.ipi_send = NULL,
.ipi_clear = NULL,
.ipi_init = NULL,
+ .ipi_exit = NULL,
+ .get_tlbr_flush_limit = NULL,
.timer_value = NULL,
.timer_event_stop = NULL,
.timer_event_start = NULL,
.timer_init = NULL,
- .system_reboot = NULL,
- .system_shutdown = NULL
+ .timer_exit = NULL,
+ .system_reset_check = NULL,
+ .system_reset = NULL,
};
-const struct sbi_platform platform = {
- .opensbi_version = OPENSBI_VERSION, // The OpenSBI version this platform table is built bassed on.
- .platform_version = SBI_PLATFORM_VERSION(0x0000, 0x0000), // SBI Platform version 1.0
- .name = "NULL platform",
+struct sbi_platform platform = {
+ .opensbi_version = OPENSBI_VERSION,
+ .platform_version = SBI_PLATFORM_VERSION(0x0, 0x01),
+ .name = "NULL Platform",
.features = 0,
.hart_count = 0,
+ .hart_index2id = 0,
.hart_stack_size = 0,
- .disabled_hart_mask = 0,
- .platform_ops_addr = 0
+ .platform_ops_addr = 0,
};
diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c
index 0af0b4bac8..e9f030f352 100644
--- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c
+++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c
@@ -21,6 +21,7 @@
#include <sbi/sbi_platform.h> // Reference to header file in opensbi
#include <sbi/sbi_init.h> // Reference to header file in opensbi
#include <sbi/sbi_ecall.h> // Reference to header file in opensbi
+#include <sbi/sbi_trap.h> // Reference to header file in opensbi
//
// Indicates the boot hart (PcdBootHartId) OpenSBI initialization is done.
@@ -434,7 +435,7 @@ EFI_STATUS EFIAPI TemporaryRamDone (
STATIC int SbiEcallFirmwareHandler (
IN unsigned long ExtId,
IN unsigned long FuncId,
- IN unsigned long *Args,
+ IN CONST struct sbi_trap_regs *TrapRegs,
OUT unsigned long *OutVal,
OUT struct sbi_trap_info *OutTrap
)
@@ -446,7 +447,7 @@ STATIC int SbiEcallFirmwareHandler (
*OutVal = (unsigned long) sbi_scratch_thishart_ptr();
break;
case SBI_EXT_FW_MSCRATCH_HARTID_FUNC:
- *OutVal = (unsigned long) sbi_hartid_to_scratch (Args[0]);
+ *OutVal = (unsigned long) sbi_hartid_to_scratch (TrapRegs->a0);
break;
default:
Ret = SBI_ENOTSUPP;
diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S
index d3d589aefc..692985cefb 100644
--- a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S
+++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S
@@ -21,6 +21,8 @@
.text
.align 3
+ .globl _start_warm
+
ASM_FUNC (_ModuleEntryPoint)
/*
* Jump to warm-boot if this is not the selected core booting,
--
2.31.1
next prev parent reply other threads:[~2022-01-08 5:12 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 4:10 [PATCH 02/79] ProcessorPkg/Library: RISC-V CPU library Abner Chang
2022-01-08 4:10 ` [PATCH 03/79] ProcessorPkg/Library: Add RISC-V exception library Abner Chang
2022-01-08 4:10 ` [PATCH 04/79] ProcessorPkg/Library: Add RISC-V timer library Abner Chang
2022-01-08 4:10 ` [PATCH 05/79] ProcessorPkg/RiscVOpensbLib: Add opensbi submodule Abner Chang
2022-01-08 4:10 ` [PATCH 06/79] ProcessorPkg/Library: Add RiscVOpensbiLib Abner Chang
2022-01-08 4:10 ` [PATCH 07/79] ProcessorPkg/Library: Add RiscVEdk2SbiLib Abner Chang
2022-01-08 4:10 ` [PATCH 08/79] ProcessorPkg/Library: RISC-V PEI Service Table Pointer library Abner Chang
2022-01-08 4:10 ` [PATCH 09/79] ProcessorPkg/CpuDxe: Add RISC-V CPU DXE driver Abner Chang
2022-01-08 4:10 ` [PATCH 10/79] ProcessorPkg/SmbiosDxe: Generic SMBIOS DXE driver for RISC-V platforms Abner Chang
2022-01-08 4:10 ` [PATCH 11/79] ProcesorPkg/Library: NULL instance of RISC-V platform timer library Abner Chang
2022-01-08 4:10 ` [PATCH 12/79] RISC-V/ProcessorPkg: RISC-V package Abner Chang
2022-01-08 4:10 ` [PATCH 13/79] PlatformPkg/Library: RISC-V Platform Temporary Memory library Abner Chang
2022-01-08 4:10 ` [PATCH 14/79] PlatformPkg/Library: Add FirmwareContextProcessorSpecificLib module Abner Chang
2022-01-08 4:10 ` [PATCH 15/79] PlatformPkg/Library: NULL instance of RiscVOpensbiPlatformLib Abner Chang
2022-01-08 4:10 ` [PATCH 16/79] PlatformPkg/Library: NULL instance of PlatformMemoryTestLib Abner Chang
2022-01-08 4:10 ` [PATCH 17/79] PlatformPkg/Library: NULL instance of PlatformUpdateProgressLib Abner Chang
2022-01-08 4:10 ` [PATCH 18/79] PlatformPkg/Library: Platform Boot Manager library Abner Chang
2022-01-08 4:10 ` [PATCH 19/79] PlatformPkg/SecMain: RISC-V SecMain module Abner Chang
2022-01-08 4:10 ` [PATCH 20/79] PlatformPkg: Add RiscVPlatformPkg Abner Chang
2022-01-08 4:10 ` [PATCH 21/79] RISC-V/PlatformPkg: Revise Readme.md Abner Chang
2022-01-08 4:10 ` [PATCH 22/79] Silicon/SiFive: Handle case of NULL FirmwareContext Abner Chang
2022-01-08 4:10 ` [PATCH 23/79] Silicon/RISC-V: Update old SMBIOS struct filed name Abner Chang
2022-01-08 4:10 ` [PATCH 24/79] Platform/RISC-V: Consume MdeLibs.dsc.inc for RegisterFilterLib Abner Chang
2022-01-08 4:10 ` [PATCH 25/79] Silicon/RISC_V: " Abner Chang
2022-01-08 4:10 ` [PATCH 26/79] RISC-V/CpuDxe: Ignore set memory attributes failure Abner Chang
2022-01-08 4:10 ` [PATCH 27/79] Signal EndOfDxe in boot manager Abner Chang
2022-01-08 4:10 ` [PATCH 28/79] U5SeriesPkg: Deduplicate PlatformPei Abner Chang
2022-01-08 4:10 ` [PATCH 29/79] RISC-V: Split SMBIOS out of PlatformPei Abner Chang
2022-01-08 4:10 ` [PATCH 30/79] RISC-V: Use U5 SMBIOS library only for those platforms Abner Chang
2022-01-08 4:10 ` [PATCH 31/79] Silicon/RISC-V: Introduce FirmwareContext library Abner Chang
2022-01-08 4:10 ` [PATCH 32/79] Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib Abner Chang
2022-01-08 4:10 ` [PATCH 33/79] RISC-V/PlatformPkg: Build DeviceTree and use that in SEC Abner Chang
2022-01-08 4:10 ` [PATCH 34/79] RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB Abner Chang
2022-01-08 4:10 ` [PATCH 35/79] RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table Abner Chang
2022-01-08 4:10 ` Abner Chang [this message]
2022-01-08 4:10 ` [PATCH 37/79] RISC-V: Implement ResetSystem RT call Abner Chang
2022-01-08 4:10 ` [PATCH 38/79] Move OpenSbiPlatformLib to RISC-V/PlatformPkg Abner Chang
2022-01-08 4:10 ` [PATCH 39/79] RISC-V/PlatformPkg: Update document Abner Chang
2022-01-08 4:11 ` [PATCH 40/79] RISC-V: Add RISC-V PeiCoreEntryPoint library Abner Chang
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=20220108041121.16005-35-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