public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
@ 2020-02-09 19:07 Rebecca Cran
  2020-02-10  0:11 ` Rebecca Cran
  0 siblings, 1 reply; 7+ messages in thread
From: Rebecca Cran @ 2020-02-09 19:07 UTC (permalink / raw)
  To: devel@edk2.groups.io, Abner Chang, Gilbert Chen

Hi,


I recently got a HiFive Unleashed board, and am interested in trying out
RISCV EDK2 firmware either on it or in Qemu.

It looks like the opensbi submodule in
edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi needs updated
though: the commit currently used -
be92da280d87c38a2e0adc5d3f43bab7b5468f09 - is missing files such as
sbi_hfence.S mentioned in
RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf .


-- 
Rebecca Cran



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
  2020-02-09 19:07 [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc Rebecca Cran
@ 2020-02-10  0:11 ` Rebecca Cran
  2020-02-10  1:53   ` Abner Chang
  0 siblings, 1 reply; 7+ messages in thread
From: Rebecca Cran @ 2020-02-10  0:11 UTC (permalink / raw)
  To: devel@edk2.groups.io, Abner Chang, Gilbert Chen

On 2020-02-09 12:07, Rebecca Cran wrote:
> I recently got a HiFive Unleashed board, and am interested in trying out
> RISCV EDK2 firmware either on it or in Qemu.
>
> It looks like the opensbi submodule in
> edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi needs updated
> though: the commit currently used -
> be92da280d87c38a2e0adc5d3f43bab7b5468f09 - is missing files such as
> sbi_hfence.S mentioned in
> RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf .


After updating the opensbi submodule to master, I now get a compile error:


/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:
In function 'sbi_ecall_find_extension':
/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:11:
error: implicit declaration of function 'container_of'
[-Werror=implicit-function-declaration]
  sbi_list_for_each_entry(t, &ecall_exts_list, head) {
           ^~~~~~~~~~~~
/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:50:
error: expected expression before 'typeof'
  sbi_list_for_each_entry(t, &ecall_exts_list, head) {
                                                  ^~~~
/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:132:
error: expected expression before 'typeof'
  sbi_list_for_each_entry(t, &ecall_exts_list, head) {
                                                                                                                                   
^
/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:
In function 'sbi_ecall_unregister_extension':
/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:64:50:
error: expected expression before 'typeof'
  sbi_list_for_each_entry(t, &ecall_exts_list, head) {
                                                  ^~~~
/home/bcran/workspace/edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:64:132:
error: expected expression before 'typeof'
  sbi_list_for_each_entry(t, &ecall_exts_list, head) {
                                                                                                                                   
^
cc1: all warnings being treated as errors

-- 
Rebecca Cran



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
  2020-02-10  0:11 ` Rebecca Cran
@ 2020-02-10  1:53   ` Abner Chang
  2020-02-10 15:13     ` [edk2-devel] " daniel.schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Abner Chang @ 2020-02-10  1:53 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Chen, Gilbert

Hi Rebecca,
The RISC-V code on edk2-staging has the corresponding changes in order to incorporate with opensbi tag v0.6, however opensbi tag v0.6 is not released yet (supposed to release in weeks ago). Our changes were made based on opensbi tag v0.6 though.
Please stay in tune with my email send to edk2 mail list for the RISC-V edk2 port readiness.
Opensbi changes often, that is expected we get build error with the master. So I will make sure everything is good once 0.6 is released.

Thanks
Abner
 

> -----Original Message-----
> From: Rebecca Cran [mailto:rebecca@bsdio.com]
> Sent: Monday, February 10, 2020 8:11 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>; Chen, Gilbert <gilbert.chen@hpe.com>
> Subject: Re: [staging/RISC-V-V2]: Need to bump opensbi submodule to get
> sbi_hfence.S etc.
> 
> On 2020-02-09 12:07, Rebecca Cran wrote:
> > I recently got a HiFive Unleashed board, and am interested in trying
> > out RISCV EDK2 firmware either on it or in Qemu.
> >
> > It looks like the opensbi submodule in
> > edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi needs updated
> > though: the commit currently used -
> > be92da280d87c38a2e0adc5d3f43bab7b5468f09 - is missing files such as
> > sbi_hfence.S mentioned in
> > RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf .
> 
> 
> After updating the opensbi submodule to master, I now get a compile error:
> 
> 
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:
> In function 'sbi_ecall_find_extension':
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:11:
> error: implicit declaration of function 'container_of'
> [-Werror=implicit-function-declaration]
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>            ^~~~~~~~~~~~
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:50:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>                                                   ^~~~
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:132:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
> 
> ^
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:
> In function 'sbi_ecall_unregister_extension':
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:64:50:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>                                                   ^~~~
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:64:132:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
> 
> ^
> cc1: all warnings being treated as errors
> 
> --
> Rebecca Cran
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
  2020-02-10  1:53   ` Abner Chang
@ 2020-02-10 15:13     ` daniel.schaefer
  2020-02-10 16:24       ` Rebecca Cran
  0 siblings, 1 reply; 7+ messages in thread
From: daniel.schaefer @ 2020-02-10 15:13 UTC (permalink / raw)
  To: Rebecca Cran
  Cc: Chang, Abner (HPS SW/FW Technologist), Chen, Gilbert,
	devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 5617 bytes --]

Hi Rebecca,

if you want to update to opensbi master, please apply this patch.
Since opensbi 0.6 hasn't been released yet, we haven't pushed the fixes yet.
Atish said it will be out soon.


diff --git a/RiscVPkg/Include/OpensbiTypes.h b/RiscVPkg/Include/OpensbiTypes.h
index 800f97759a..c77dbdec11 100644
--- a/RiscVPkg/Include/OpensbiTypes.h
+++ b/RiscVPkg/Include/OpensbiTypes.h
@@ -46,6 +46,17 @@ typedef UINT64   physical_size_t;
 #define likely(x) __builtin_expect((x), 1)
 #define unlikely(x) __builtin_expect((x), 0)

+#undef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#define container_of(ptr, type, member) ({            \
+  const typeof(((type *)0)->member) * __mptr = (ptr); \
+  (type *)((char *)__mptr - offsetof(type, member)); })
+
 #define CLAMP(a, lo, hi) MIN(MAX(a, lo), hi)
 #define ROUNDUP(a, b) ((((a)-1) / (b) + 1) * (b))
 #define ROUNDDOWN(a, b) ((a) / (b) * (b))
diff --git a/RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf b/RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf
index a5e59463f1..d966330818 100644
--- a/RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf
+++ b/RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf
@@ -22,6 +22,10 @@
   opensbi/lib/sbi/riscv_locks.c
   opensbi/lib/sbi/sbi_console.c
   opensbi/lib/sbi/sbi_ecall.c
+  opensbi/lib/sbi/sbi_ecall_vendor.c
+  opensbi/lib/sbi/sbi_ecall_replace.c
+  opensbi/lib/sbi/sbi_ecall_legacy.c
+  opensbi/lib/sbi/sbi_ecall_base.c
   opensbi/lib/sbi/sbi_emulate_csr.c
   opensbi/lib/sbi/sbi_fifo.c
   opensbi/lib/sbi/sbi_hart.c
diff --git a/RiscVPkg/Library/RiscVOpensbiLib/opensbi b/RiscVPkg/Library/RiscVOpensbiLib/opensbi
index be92da280d..ec29e1cf73 160000
--- a/RiscVPkg/Library/RiscVOpensbiLib/opensbi
+++ b/RiscVPkg/Library/RiscVOpensbiLib/opensbi
@@ -1 +1 @@
-Subproject commit be92da280d87c38a2e0adc5d3f43bab7b5468f09
+Subproject commit ec29e1cf73ffe96a646daa7c2b288aa280e4be37


Cheers,
Daniel
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Abner Chang <abner.chang@hpe.com>
Sent: Monday, February 10, 2020 02:53
To: Rebecca Cran <rebecca@bsdio.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Chen, Gilbert <gilbert.chen@hpe.com>
Subject: Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.

Hi Rebecca,
The RISC-V code on edk2-staging has the corresponding changes in order to incorporate with opensbi tag v0.6, however opensbi tag v0.6 is not released yet (supposed to release in weeks ago). Our changes were made based on opensbi tag v0.6 though.
Please stay in tune with my email send to edk2 mail list for the RISC-V edk2 port readiness.
Opensbi changes often, that is expected we get build error with the master. So I will make sure everything is good once 0.6 is released.

Thanks
Abner


> -----Original Message-----
> From: Rebecca Cran [mailto:rebecca@bsdio.com]
> Sent: Monday, February 10, 2020 8:11 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>; Chen, Gilbert <gilbert.chen@hpe.com>
> Subject: Re: [staging/RISC-V-V2]: Need to bump opensbi submodule to get
> sbi_hfence.S etc.
>
> On 2020-02-09 12:07, Rebecca Cran wrote:
> > I recently got a HiFive Unleashed board, and am interested in trying
> > out RISCV EDK2 firmware either on it or in Qemu.
> >
> > It looks like the opensbi submodule in
> > edk2-staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi needs updated
> > though: the commit currently used -
> > be92da280d87c38a2e0adc5d3f43bab7b5468f09 - is missing files such as
> > sbi_hfence.S mentioned in
> > RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf .
>
>
> After updating the opensbi submodule to master, I now get a compile error:
>
>
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:
> In function 'sbi_ecall_find_extension':
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:11:
> error: implicit declaration of function 'container_of'
> [-Werror=implicit-function-declaration]
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>            ^~~~~~~~~~~~
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:50:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>                                                   ^~~~
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:32:132:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>
> ^
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:
> In function 'sbi_ecall_unregister_extension':
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:64:50:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>                                                   ^~~~
> /home/bcran/workspace/edk2-
> staging/RiscVPkg/Library/RiscVOpensbiLib/opensbi/lib/sbi/sbi_ecall.c:64:132:
> error: expected expression before 'typeof'
>   sbi_list_for_each_entry(t, &ecall_exts_list, head) {
>
> ^
> cc1: all warnings being treated as errors
>
> --
> Rebecca Cran
>





[-- Attachment #2: Type: text/html, Size: 8672 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
  2020-02-10 15:13     ` [edk2-devel] " daniel.schaefer
@ 2020-02-10 16:24       ` Rebecca Cran
  2020-02-10 16:39         ` Abner Chang
  2020-02-13  1:39         ` Abner Chang
  0 siblings, 2 replies; 7+ messages in thread
From: Rebecca Cran @ 2020-02-10 16:24 UTC (permalink / raw)
  To: Schaefer, Daniel Helmut (DualStudy)
  Cc: Chang, Abner (HPS SW/FW Technologist), Chen, Gilbert,
	devel@edk2.groups.io

On 2020-02-10 08:13, Schaefer, Daniel Helmut (DualStudy) wrote:
> if you want to update to opensbi master, please apply this patch.
> Since opensbi 0.6 hasn't been released yet, we haven't pushed the
> fixes yet.
> Atish said it will be out soon.


Thanks! That worked, with a couple of changes. It seems commit
ec29e1cf73ffe96a646daa7c2b288aa280e4be37 isn't in the opensbi repo, and
the latest master code requires the following patch (I'm assuming 64-bit
MMIO _is_ supported!):


diff --git
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
index 3b3637995d..f72122b21b 100644
---
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
+++
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
@@ -168,7 +168,7 @@ static int U540_timer_init(bool cold_boot)
 
     if (cold_boot) {
         rc = clint_cold_timer_init(CLINT_REG_BASE_ADDR,
-                       U540_HART_COUNT);
+                       U540_HART_COUNT, TRUE);^M
         if (rc)
             return rc;
     }



I don't know if Platform/SiFive/U5SeriesPkg/Readme.md is still used, but
I noticed it's a bit out-of-date, and I believe the following patch
fixes some issues including typos:


diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md
b/Platform/SiFive/U5SeriesPkg/Readme.md
index 535fa9d430..d6db7c9150 100644
--- a/Platform/SiFive/U5SeriesPkg/Readme.md
+++ b/Platform/SiFive/U5SeriesPkg/Readme.md
@@ -4,8 +4,8 @@ U5 series core platforms. Currently the supported
platforms are Freedom
 U500 VC707 platform and Freedom U540 HiFive Unleashed platform.
 
 Both platforms are built with below common packages,
-- **U5SeriesPkg**, edk2 platform branch
-  (Currently is in edk2-platforms/devel-riscv-v2-PATCHv5 branch)
+- **U5SeriesPkg**, edk2-platforms master branch^M
+  (Currently is in edk2-platforms/devel-riscvplatforms branch)^M
 - **RiscVPlatformPkg**, edk2 master branch
   (Currently is in edk2-staging/RISC-V-V2 branch)
 - **RiscVPkg**, edk2 master branch
@@ -17,11 +17,11 @@ VC707 FPGA Dev Kit, please refer to "SiFive Freedom
U500 VC707 FPGA Getting
 Started Guide" on https://www.sifive.com/documentation.
 
 ## U540 Platform
-This is a sample RISC-V EDK2 platform package used agaist SiFive
Freedom U540
+This is a sample RISC-V EDK2 platform package used against SiFive
Freedom U540^M
 HiFive Unleashed development board, please refer to "SiFive Freedom
U540-C000
 Manual" on https://www.sifive.com.
-The binary built from Platform/SiFive/FreedomU540HiFiveUnleashedBoard
can run
-on main stream [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)
+The binary built from
Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/^M
+can run on main stream [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)^M
 using qemu-system-riscv64 under riscv64-softmmu. Launch the binary with
 
 ```
@@ -33,8 +33,7 @@ using qemu-system-riscv64 under riscv64-softmmu.
Launch the binary with
 git clone https://github.com/tianocore/edk2-staging.git
 # Checkout RISC-V-V2 branch
 git clone https://github.com/tianocore/edk2-platforms.git
-# Checkout devel-riscv-v2-PATCHv5 branch
-git clone https://github.com/tianocore/edk2-non-osi.git
+# Checkout devel-riscvplatforms branch^M
 ```
 
 ## Platform Owners
@@ -47,7 +46,7 @@ FPGA to EFI shell with console in/out enabled.
 
 ## Linux Build Instructions
 You can build the RISC-V platform using below script,
-`build -a RISCV64  -t GCC5 -p
Platform/SiFive/FreedomU500VC707Board/U500.dsc`
+`build -a RISCV64 -t GCC5 -p
Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`^M
 
 ## Supported Operating Systems
 Only support to boot to EFI Shell so far.
@@ -68,18 +67,18 @@ RISC-V related SMBIOS records to support the unified
boot loader and OS image.
 This library leverage the silicon libraries provided in Silicon/SiFive.
 
 ### RiscVPlatformTimerLib
-This is common U5 series  platform timer library which has the
+This is common U5 series platform timer library which has the^M
 platform-specific timer implementation.
 
 ### TimerDxe
-This is U5 series  platform timer DXE driver whcih has the
platform-specific
+This is U5 series platform timer DXE driver which has the
platform-specific^M
 timer implementation.
 
 ## U500 Platform Libraries and Drivers
-### RiscVOpnesbiPlatformLib
+### RiscVOpensbiPlatformLib^M
 In order to reduce the dependencies with RISC-V OpenSBI project
-(https://github.com/riscv/opensbi) and less burdens to EDK2 build
process, the
-implementation of RISC-V EDK2 platform is leverage platform source code
from
+(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
process, the^M
+implementation of RISC-V EDK2 platform is leveraging platform source
code from^M
 OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned from
 RISC-V OpenSBI code tree (in EDK2 RiscVPkg) and built based on EDK2 build
 environment.
@@ -89,10 +88,10 @@ This is the platform-implementation specific library
which is executed in early
 PEI phase for U500 platform initialization.
 
 ## U540 Platform Libraries and Drivers
-### RiscVOpnesbiPlatformLib
+### RiscVOpensbiPlatformLib^M
 In order to reduce the dependencies with RISC-V OpenSBI project
-(https://github.com/riscv/opensbi) and less burdens to EDK2 build
process, the
-implementation of RISC-V EDK2 platform is leverage platform source code
from
+(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
process, the^M
+implementation of RISC-V EDK2 platform is leveraging platform source
code from^M
 OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned from
 RISC-V OpenSBI code tree (in EDK2 RiscVPkg) and built based on EDK2 build
 environment.



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
  2020-02-10 16:24       ` Rebecca Cran
@ 2020-02-10 16:39         ` Abner Chang
  2020-02-13  1:39         ` Abner Chang
  1 sibling, 0 replies; 7+ messages in thread
From: Abner Chang @ 2020-02-10 16:39 UTC (permalink / raw)
  To: devel@edk2.groups.io, rebecca@bsdio.com,
	Schaefer, Daniel Helmut (DualStudy)
  Cc: Chen, Gilbert

Thanks Rebecca. Yes, the readme.md is still used. I will check your patch.


-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Rebecca Cran
Sent: Tuesday, February 11, 2020 12:24 AM
To: Schaefer, Daniel Helmut (DualStudy) <daniel.schaefer@hpe.com>
Cc: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Chen, Gilbert <gilbert.chen@hpe.com>; devel@edk2.groups.io
Subject: Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.

On 2020-02-10 08:13, Schaefer, Daniel Helmut (DualStudy) wrote:
> if you want to update to opensbi master, please apply this patch.
> Since opensbi 0.6 hasn't been released yet, we haven't pushed the 
> fixes yet.
> Atish said it will be out soon.


Thanks! That worked, with a couple of changes. It seems commit
ec29e1cf73ffe96a646daa7c2b288aa280e4be37 isn't in the opensbi repo, and the latest master code requires the following patch (I'm assuming 64-bit MMIO _is_ supported!):


diff --git
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
index 3b3637995d..f72122b21b 100644
---
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
+++
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c
@@ -168,7 +168,7 @@ static int U540_timer_init(bool cold_boot)
 
     if (cold_boot) {
         rc = clint_cold_timer_init(CLINT_REG_BASE_ADDR,
-                       U540_HART_COUNT);
+                       U540_HART_COUNT, TRUE);^M
         if (rc)
             return rc;
     }



I don't know if Platform/SiFive/U5SeriesPkg/Readme.md is still used, but I noticed it's a bit out-of-date, and I believe the following patch fixes some issues including typos:


diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md
b/Platform/SiFive/U5SeriesPkg/Readme.md
index 535fa9d430..d6db7c9150 100644
--- a/Platform/SiFive/U5SeriesPkg/Readme.md
+++ b/Platform/SiFive/U5SeriesPkg/Readme.md
@@ -4,8 +4,8 @@ U5 series core platforms. Currently the supported platforms are Freedom
 U500 VC707 platform and Freedom U540 HiFive Unleashed platform.
 
 Both platforms are built with below common packages,
-- **U5SeriesPkg**, edk2 platform branch
-  (Currently is in edk2-platforms/devel-riscv-v2-PATCHv5 branch)
+- **U5SeriesPkg**, edk2-platforms master branch^M
+  (Currently is in edk2-platforms/devel-riscvplatforms branch)^M
 - **RiscVPlatformPkg**, edk2 master branch
   (Currently is in edk2-staging/RISC-V-V2 branch)
 - **RiscVPkg**, edk2 master branch
@@ -17,11 +17,11 @@ VC707 FPGA Dev Kit, please refer to "SiFive Freedom
U500 VC707 FPGA Getting
 Started Guide" on https://www.sifive.com/documentation .
 
 ## U540 Platform
-This is a sample RISC-V EDK2 platform package used agaist SiFive Freedom U540
+This is a sample RISC-V EDK2 platform package used against SiFive
Freedom U540^M
 HiFive Unleashed development board, please refer to "SiFive Freedom
U540-C000
 Manual" on https://www.sifive.com .
-The binary built from Platform/SiFive/FreedomU540HiFiveUnleashedBoard
can run
-on main stream [QEMU](https://git.qemu.org/?p=qemu.git;a=summary )
+The binary built from
Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/^M
+can run on main stream 
+[QEMU](INVALID URI REMOVED
+g_-3Fp-3Dqemu.git-3Ba-3Dsummary-29-255EM&d=DwIF-g&c=C5b8zRQO1miGmBeVZ2L
+FWg&r=_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3E&m=HxXHuY_9jAKWxvrHTbm
+2zuUZlHhjTs5V4lDto0Lzipk&s=YPUqX3i3iQnU2UwGUb8-AL-IZ5-Uszd6E0r9qL5jo_0&
+e=
 using qemu-system-riscv64 under riscv64-softmmu. Launch the binary with
 
 ```
@@ -33,8 +33,7 @@ using qemu-system-riscv64 under riscv64-softmmu.
Launch the binary with
 git clone https://github.com/tianocore/edk2-staging.git
 # Checkout RISC-V-V2 branch
 git clone https://github.com/tianocore/edk2-platforms.git
-# Checkout devel-riscv-v2-PATCHv5 branch -git clone https://github.com/tianocore/edk2-non-osi.git
+# Checkout devel-riscvplatforms branch^M
 ```
 
 ## Platform Owners
@@ -47,7 +46,7 @@ FPGA to EFI shell with console in/out enabled.
 
 ## Linux Build Instructions
 You can build the RISC-V platform using below script, -`build -a RISCV64  -t GCC5 -p Platform/SiFive/FreedomU500VC707Board/U500.dsc`
+`build -a RISCV64 -t GCC5 -p
Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`^M
 
 ## Supported Operating Systems
 Only support to boot to EFI Shell so far.
@@ -68,18 +67,18 @@ RISC-V related SMBIOS records to support the unified boot loader and OS image.
 This library leverage the silicon libraries provided in Silicon/SiFive.
 
 ### RiscVPlatformTimerLib
-This is common U5 series  platform timer library which has the
+This is common U5 series platform timer library which has the^M
 platform-specific timer implementation.
 
 ### TimerDxe
-This is U5 series  platform timer DXE driver whcih has the platform-specific
+This is U5 series platform timer DXE driver which has the
platform-specific^M
 timer implementation.
 
 ## U500 Platform Libraries and Drivers
-### RiscVOpnesbiPlatformLib
+### RiscVOpensbiPlatformLib^M
 In order to reduce the dependencies with RISC-V OpenSBI project
-(https://github.com/riscv/opensbi) and less burdens to EDK2 build process, the -implementation of RISC-V EDK2 platform is leverage platform source code from
+(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
process, the^M
+implementation of RISC-V EDK2 platform is leveraging platform source
code from^M
 OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned from
 RISC-V OpenSBI code tree (in EDK2 RiscVPkg) and built based on EDK2 build
 environment.
@@ -89,10 +88,10 @@ This is the platform-implementation specific library which is executed in early
 PEI phase for U500 platform initialization.
 
 ## U540 Platform Libraries and Drivers
-### RiscVOpnesbiPlatformLib
+### RiscVOpensbiPlatformLib^M
 In order to reduce the dependencies with RISC-V OpenSBI project
-(https://github.com/riscv/opensbi) and less burdens to EDK2 build process, the -implementation of RISC-V EDK2 platform is leverage platform source code from
+(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
process, the^M
+implementation of RISC-V EDK2 platform is leveraging platform source
code from^M
 OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned from
 RISC-V OpenSBI code tree (in EDK2 RiscVPkg) and built based on EDK2 build
 environment.






^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc.
  2020-02-10 16:24       ` Rebecca Cran
  2020-02-10 16:39         ` Abner Chang
@ 2020-02-13  1:39         ` Abner Chang
  1 sibling, 0 replies; 7+ messages in thread
From: Abner Chang @ 2020-02-13  1:39 UTC (permalink / raw)
  To: devel@edk2.groups.io, rebecca@bsdio.com,
	Schaefer, Daniel Helmut (DualStudy)
  Cc: Chen, Gilbert

Hi Rebecca,
We fixed the build errors in order to incorporate with latest OpenSBI lib. Both changes were on RISC-V-V2 and devel-riscvplatorms branches which are same as before. However, we rebased and force updated it in order to keep the commits clear. We may keep doing this until we get those branches into main stream.
Also, as we confirm with OpenSBI guys, they mentioned that the stable tag may be released couple weeks later. That means you will have to update OpenSBI to the latest by manually due to we don't have tag for it.

Regards,
Abner

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Rebecca Cran
> Sent: Tuesday, February 11, 2020 12:24 AM
> To: Schaefer, Daniel Helmut (DualStudy) <daniel.schaefer@hpe.com>
> Cc: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> Chen, Gilbert <gilbert.chen@hpe.com>; devel@edk2.groups.io
> Subject: Re: [edk2-devel] [staging/RISC-V-V2]: Need to bump opensbi
> submodule to get sbi_hfence.S etc.
> 
> On 2020-02-10 08:13, Schaefer, Daniel Helmut (DualStudy) wrote:
> > if you want to update to opensbi master, please apply this patch.
> > Since opensbi 0.6 hasn't been released yet, we haven't pushed the
> > fixes yet.
> > Atish said it will be out soon.
> 
> 
> Thanks! That worked, with a couple of changes. It seems commit
> ec29e1cf73ffe96a646daa7c2b288aa280e4be37 isn't in the opensbi repo, and
> the latest master code requires the following patch (I'm assuming 64-bit
> MMIO _is_ supported!):
> 
> 
> diff --git
> a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library
> /OpensbiPlatformLib/Platform.c
> b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library
> /OpensbiPlatformLib/Platform.c
> index 3b3637995d..f72122b21b 100644
> ---
> a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library
> /OpensbiPlatformLib/Platform.c
> +++
> b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library
> /OpensbiPlatformLib/Platform.c
> @@ -168,7 +168,7 @@ static int U540_timer_init(bool cold_boot)
> 
>      if (cold_boot) {
>          rc = clint_cold_timer_init(CLINT_REG_BASE_ADDR,
> -                       U540_HART_COUNT);
> +                       U540_HART_COUNT, TRUE);^M
>          if (rc)
>              return rc;
>      }
> 
> 
> 
> I don't know if Platform/SiFive/U5SeriesPkg/Readme.md is still used, but I
> noticed it's a bit out-of-date, and I believe the following patch fixes some
> issues including typos:
> 
> 
> diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md
> b/Platform/SiFive/U5SeriesPkg/Readme.md
> index 535fa9d430..d6db7c9150 100644
> --- a/Platform/SiFive/U5SeriesPkg/Readme.md
> +++ b/Platform/SiFive/U5SeriesPkg/Readme.md
> @@ -4,8 +4,8 @@ U5 series core platforms. Currently the supported
> platforms are Freedom
>  U500 VC707 platform and Freedom U540 HiFive Unleashed platform.
> 
>  Both platforms are built with below common packages,
> -- **U5SeriesPkg**, edk2 platform branch
> -  (Currently is in edk2-platforms/devel-riscv-v2-PATCHv5 branch)
> +- **U5SeriesPkg**, edk2-platforms master branch^M
> +  (Currently is in edk2-platforms/devel-riscvplatforms branch)^M
>  - **RiscVPlatformPkg**, edk2 master branch
>    (Currently is in edk2-staging/RISC-V-V2 branch)
>  - **RiscVPkg**, edk2 master branch
> @@ -17,11 +17,11 @@ VC707 FPGA Dev Kit, please refer to "SiFive Freedom
> U500 VC707 FPGA Getting
>  Started Guide" on INVALID URI REMOVED
> 3A__www.sifive.com_documentation&d=DwIF-
> g&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nH
> p9P7Z5q59A3E&m=HxXHuY_9jAKWxvrHTbm2zuUZlHhjTs5V4lDto0Lzipk&s=54
> 3BZ6IUkXHI39_LU_12CPm-_kVRueQxvUPbDvP1Y2Y&e= .
> 
>  ## U540 Platform
> -This is a sample RISC-V EDK2 platform package used agaist SiFive Freedom
> U540
> +This is a sample RISC-V EDK2 platform package used against SiFive
> Freedom U540^M
>  HiFive Unleashed development board, please refer to "SiFive Freedom
> U540-C000
>  Manual" on INVALID URI REMOVED
> 3A__www.sifive.com&d=DwIF-
> g&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nH
> p9P7Z5q59A3E&m=HxXHuY_9jAKWxvrHTbm2zuUZlHhjTs5V4lDto0Lzipk&s=ku
> LOpyvDGMRUPou_2CAMCV7_gfkLNsuSfAPyf4nH4lI&e= .
> -The binary built from Platform/SiFive/FreedomU540HiFiveUnleashedBoard
> can run
> -on main stream
> [QEMU](INVALID URI REMOVED
> 3A__git.qemu.org_-3Fp-3Dqemu.git-3Ba-3Dsummary&d=DwIF-
> g&c=C5b8zRQO1miGmBeVZ2LFWg&r=_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nH
> p9P7Z5q59A3E&m=HxXHuY_9jAKWxvrHTbm2zuUZlHhjTs5V4lDto0Lzipk&s=A
> wqoWN_XfmU4GzhfY_hb_7EW9vT0hyYGhx_XugGgL8g&e= )
> +The binary built from
> Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/^M
> +can run on main stream
> +[QEMU](INVALID URI REMOVED
> 3A__git.qemu.or
> +g_-3Fp-3Dqemu.git-3Ba-3Dsummary-29-255EM&d=DwIF-
> g&c=C5b8zRQO1miGmBeVZ2L
> +FWg&r=_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3E&m=HxXHuY_
> 9jAKWxvrHTbm
> +2zuUZlHhjTs5V4lDto0Lzipk&s=YPUqX3i3iQnU2UwGUb8-AL-IZ5-
> Uszd6E0r9qL5jo_0&
> +e=
>  using qemu-system-riscv64 under riscv64-softmmu. Launch the binary with
> 
>  ```
> @@ -33,8 +33,7 @@ using qemu-system-riscv64 under riscv64-softmmu.
> Launch the binary with
>  git clone https://github.com/tianocore/edk2-staging.git
>  # Checkout RISC-V-V2 branch
>  git clone https://github.com/tianocore/edk2-platforms.git
> -# Checkout devel-riscv-v2-PATCHv5 branch -git clone
> https://github.com/tianocore/edk2-non-osi.git
> +# Checkout devel-riscvplatforms branch^M
>  ```
> 
>  ## Platform Owners
> @@ -47,7 +46,7 @@ FPGA to EFI shell with console in/out enabled.
> 
>  ## Linux Build Instructions
>  You can build the RISC-V platform using below script, -`build -a RISCV64  -t
> GCC5 -p Platform/SiFive/FreedomU500VC707Board/U500.dsc`
> +`build -a RISCV64 -t GCC5 -p
> Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`^M
> 
>  ## Supported Operating Systems
>  Only support to boot to EFI Shell so far.
> @@ -68,18 +67,18 @@ RISC-V related SMBIOS records to support the unified
> boot loader and OS image.
>  This library leverage the silicon libraries provided in Silicon/SiFive.
> 
>  ### RiscVPlatformTimerLib
> -This is common U5 series  platform timer library which has the
> +This is common U5 series platform timer library which has the^M
>  platform-specific timer implementation.
> 
>  ### TimerDxe
> -This is U5 series  platform timer DXE driver whcih has the platform-specific
> +This is U5 series platform timer DXE driver which has the
> platform-specific^M
>  timer implementation.
> 
>  ## U500 Platform Libraries and Drivers
> -### RiscVOpnesbiPlatformLib
> +### RiscVOpensbiPlatformLib^M
>  In order to reduce the dependencies with RISC-V OpenSBI project
> -(https://github.com/riscv/opensbi) and less burdens to EDK2 build process,
> the -implementation of RISC-V EDK2 platform is leverage platform source
> code from
> +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> process, the^M
> +implementation of RISC-V EDK2 platform is leveraging platform source
> code from^M
>  OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned
> from
>  RISC-V OpenSBI code tree (in EDK2 RiscVPkg) and built based on EDK2 build
>  environment.
> @@ -89,10 +88,10 @@ This is the platform-implementation specific library
> which is executed in early
>  PEI phase for U500 platform initialization.
> 
>  ## U540 Platform Libraries and Drivers
> -### RiscVOpnesbiPlatformLib
> +### RiscVOpensbiPlatformLib^M
>  In order to reduce the dependencies with RISC-V OpenSBI project
> -(https://github.com/riscv/opensbi) and less burdens to EDK2 build process,
> the -implementation of RISC-V EDK2 platform is leverage platform source
> code from
> +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> process, the^M
> +implementation of RISC-V EDK2 platform is leveraging platform source
> code from^M
>  OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned
> from
>  RISC-V OpenSBI code tree (in EDK2 RiscVPkg) and built based on EDK2 build
>  environment.
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-13  1:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-09 19:07 [staging/RISC-V-V2]: Need to bump opensbi submodule to get sbi_hfence.S etc Rebecca Cran
2020-02-10  0:11 ` Rebecca Cran
2020-02-10  1:53   ` Abner Chang
2020-02-10 15:13     ` [edk2-devel] " daniel.schaefer
2020-02-10 16:24       ` Rebecca Cran
2020-02-10 16:39         ` Abner Chang
2020-02-13  1:39         ` Abner Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox