public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-plaforms PATCH 0/3] Revise Readme for RISC-V updates
@ 2020-08-27 12:03 Abner Chang
  2020-08-27 12:03 ` [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md Abner Chang
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Abner Chang @ 2020-08-27 12:03 UTC (permalink / raw)
  To: devel; +Cc: abner.chang

Update below Readme.md,
 - edk2-platforms/Readme.md
 - Platform/RISC-V/PlatformPkg/Readme.md
 - Platform/SiFive/U5SeriesPkg/Readme.md

Abner Chang (3):
  edk2-platforms: Revise Readme.md
  RISC-V/PlatformPkg: Revise Readme.md
  Platform/U5SeriesPkg: Revise Readme.md

 Platform/RISC-V/PlatformPkg/Readme.md |  72 +++++++++--------
 Platform/SiFive/U5SeriesPkg/Readme.md | 112 +++++++++++++-------------
 Readme.md                             |   1 +
 3 files changed, 96 insertions(+), 89 deletions(-)

-- 
2.25.0


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

* [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md
  2020-08-27 12:03 [edk2-plaforms PATCH 0/3] Revise Readme for RISC-V updates Abner Chang
@ 2020-08-27 12:03 ` Abner Chang
  2020-08-27 13:01   ` Leif Lindholm
  2020-08-27 12:03 ` [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: " Abner Chang
  2020-08-27 12:03 ` [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: " Abner Chang
  2 siblings, 1 reply; 13+ messages in thread
From: Abner Chang @ 2020-08-27 12:03 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, Daniel Schaefer, Leif Lindholm, Michael D Kinney

Mention to update submodule under for edk2-platforms. It is for RISC-V OpenSBI library.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
---
 Readme.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Readme.md b/Readme.md
index 0675685fb7..d896b2c5fc 100644
--- a/Readme.md
+++ b/Readme.md
@@ -97,6 +97,7 @@ target-specific binutils. These are included with any prepackaged GCC toolchain
    $ git submodule update --init
    ...
    $ git clone https://github.com/tianocore/edk2-platforms.git
+   $ git submodule update --init
    ...
    $ git clone https://github.com/tianocore/edk2-non-osi.git
    ```
-- 
2.25.0


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

* [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: Revise Readme.md
  2020-08-27 12:03 [edk2-plaforms PATCH 0/3] Revise Readme for RISC-V updates Abner Chang
  2020-08-27 12:03 ` [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md Abner Chang
@ 2020-08-27 12:03 ` Abner Chang
  2020-08-27 13:23   ` [edk2-devel] " Leif Lindholm
  2020-08-27 12:03 ` [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: " Abner Chang
  2 siblings, 1 reply; 13+ messages in thread
From: Abner Chang @ 2020-08-27 12:03 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, Daniel Schaefer

Update RISC-V PlatformPkg Readme.md to align with the latest implementation.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>

Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Platform/RISC-V/PlatformPkg/Readme.md | 72 ++++++++++++++-------------
 1 file changed, 37 insertions(+), 35 deletions(-)

diff --git a/Platform/RISC-V/PlatformPkg/Readme.md b/Platform/RISC-V/PlatformPkg/Readme.md
index 2632ebeb28..bd3b823fb4 100644
--- a/Platform/RISC-V/PlatformPkg/Readme.md
+++ b/Platform/RISC-V/PlatformPkg/Readme.md
@@ -1,49 +1,48 @@
-# Introduction
+# Introduction of EDK2 RISC-V Port
 
-## EDK2 RISC-V Platform Packages
-RISC-V platform package provides the generic and common modules for RISC-V
-platforms. RISC-V platform package could include RiscPlatformPkg.dec to
-use the common drivers, libraries, definitions, PCDs and etc. for the
-platform development.
+## EDK2 RISC-V Project
+The edk2 build architecture which is supported and verified on edk2 code base for RISC-V platforms is `RISCV64`.
+The toolchain is on RISC-V GitHub (https://github.com/riscv/riscv-gnu-toolchain) for building edk2 RISC-V binary.
+The corresponding edk2 Toolchain tag for building RISC-V platform is "GCC5" declared in `tools_def.txt`.
 
-There are two packages to support RISC-V:
+There are two packages to support RISC-V edk2 platforms:
 - `edk2-platforms/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec`
 - `edk2-platforms/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec`
 
-`RiscVPlatformPkg` provides SEC phase and NULL libs.
-`RiscVProcessorPkg` provides many libraries, PEIMs and DXE drivers.
+`RiscVPlatformPkg` currently provides the generic SEC driver for all RISC-V platforms, and some platform level libraries.
+`RiscVProcessorPkg` currently provides RISC-V processor related libraries, PEI modules, DXE drivers and industrial
+standard header files.
 
-### Download the sources ###
+## EDK2 RISC-V Platform Package
+RISC-V platform package provides the common modules for RISC-V platforms. RISC-V platform vendors could include
+RiscPlatformPkg.dec to use the common drivers, libraries, definitions, PCDs and etc. for the
+RISC-V platform development.
+
+### Download the Source Code ###
 ```
 git clone https://github.com/tianocore/edk2.git
+git clone https://github.com/tianocore/edk2-platforms.git
 
-git clone https://github.com/changab/edk2-platforms.git
-# Check out branch: riscv-smode-lib
 ```
 
-To build it, you have to follow the regular steps for EDK2 and additionally set
-an environmen variable to point to your RISC-V toolchain installation,
-including the binary prefixes:
-
+You have to follow the build steps for EDK2 (https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-with-EDK-II)
+and additionally set an environment variable to point to your RISC-V toolchain binaries for building RISC-V
+platforms,
 ```
+# e.g. If the toolchain binaries are under /riscv-gnu-toolchain-binaries/bin
 export GCC5_RISCV64_PREFIX=/riscv-gnu-toolchain-binaries/bin/riscv64-unknown-elf-
 ```
 
-Then you can build the image for the SiFive HifiveUnleashed platform:
+Then you can build the edk2 firmware image for RISC-V platforms.
 
 ```
+# e.g. For building SiFive Hifive Unleashed platform:
 build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
 ```
 
-### EDK2 project
-All changes in edk2 are upstream, however, most of the RISC-V code is in
-edk2-platforms. Therefore you have to check out the branch `riscv-smode-lib` on
-`github.com/changab/edk2-platforms`.
-
-The build architecture which is supported and verified so far is `RISCV64`.
-The latest master of the RISC-V toolchain https://github.com/riscv/riscv-gnu-toolchain
-should work but the latest verified commit is `b468107e701433e1caca3dbc8aef8d40`.
-Toolchain tag is "GCC5" declared in `tools_def.txt`
+## RISC-V OpenSBI Library
+RISC-V [OpenSBI](https://github.com/riscv/opensbi) is the implementation of [RISC-V SBI (Supervisor Binary Interface) specification](https://github.com/riscv/riscv-sbi-doc). For EDK2 UEFI firmware solution, RISC-V OpenSBI is integrated as a library [(submoudule)](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) in EDK2 RISC-V Processor Package. The RISC-V OpenSBI library is built in SEC driver
+without any modifications and provides the interfaces for supervisor mode execution environment to execute privileged operations.
 
 ## RISC-V Platform PCD settings
 ### EDK2 Firmware Volume Settings
@@ -54,9 +53,9 @@ EDK2 Firmware volume related PCDs which declared in platform FDF file.
 |PcdRiscVSecFvBase| The base address of SEC Firmware Volume|
 |PcdRiscVSecFvSize| The size of SEC Firmware Volume|
 |PcdRiscVPeiFvBase| The base address of PEI Firmware Volume|
-|PcdRiscVPeiFvSize| The size of SEC Firmware Volume|
+|PcdRiscVPeiFvSize| The size of PEI Firmware Volume|
 |PcdRiscVDxeFvBase| The base address of DXE Firmware Volume|
-|PcdRiscVDxeFvSize| The size of SEC Firmware Volume|
+|PcdRiscVDxeFvSize| The size of DXE Firmware Volume|
 
 ### EDK2 EFI Variable Region Settings
 The PCD settings regard to EFI Variable
@@ -84,21 +83,24 @@ Below PCDs could be set in platform FDF file.
 |--------------|---------|
 |PcdHartCount| Number of RISC-V HARTs, the value is processor-implementation specific|
 |PcdBootHartId| The ID of RISC-V HART to execute main fimrware code and boot system to OS|
+|PcdBootableHartNumber|The bootable HART number, which is incorporate with RISC-V OpenSBI platform hart_index2id value|
 
 ### RISC-V OpenSBI Settings
 
 | **PCD name** |**Usage**|
 |--------------|---------|
-|PcdScratchRamBase| The base address of OpenSBI scratch buffer for all RISC-V HARTs|
-|PcdScratchRamSize| The total size of OpenSBI scratch buffer for all RISC-V HARTs|
-|PcdOpenSbiStackSize| The size of initial stack of each RISC-V HART for booting system use OpenSBI|
+|PcdScratchRamBase| The base address of RISC-V OpenSBI scratch buffer for all RISC-V HARTs|
+|PcdScratchRamSize| The total size of RISC-V OpenSBI scratch buffer for all RISC-V HARTs|
+|PcdOpenSbiStackSize| The size of initial stack of each RISC-V HART for booting system use RISC-V OpenSBI|
 |PcdTemporaryRamBase| The base address of temporary memory for PEI phase|
 |PcdTemporaryRamSize| The temporary memory size for PEI phase|
+|PcdPeiCorePrivilegeMode|The target RISC-V privilege mode for edk2 PEI phase|
 
 ## Supported Operating Systems
-Only support to boot to EFI Shell so far.
-
-Porting GRUB2 and Linux EFISTUB is in progress.
+Currently support boot to EFI Shell and Linux kernel.
+Refer to below link for more information,
+https://github.com/riscv/riscv-uefi-edk2-docs
 
 ## Known Issues and Limitations
-Only RISC-V RV64 is verified.
+Only RISC-V RV64 is verified on edk2.
+
-- 
2.25.0


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

* [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md
  2020-08-27 12:03 [edk2-plaforms PATCH 0/3] Revise Readme for RISC-V updates Abner Chang
  2020-08-27 12:03 ` [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md Abner Chang
  2020-08-27 12:03 ` [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: " Abner Chang
@ 2020-08-27 12:03 ` Abner Chang
  2020-08-27 13:24   ` [edk2-devel] " Leif Lindholm
  2020-08-27 13:43   ` Daniel Schaefer
  2 siblings, 2 replies; 13+ messages in thread
From: Abner Chang @ 2020-08-27 12:03 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, Daniel Schaefer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 9629 bytes --]

Update RISC-V U5SeriesPkg Readme.md to align with the latest implementation.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>

Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 Platform/SiFive/U5SeriesPkg/Readme.md | 112 +++++++++++++-------------
 1 file changed, 58 insertions(+), 54 deletions(-)

diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md b/Platform/SiFive/U5SeriesPkg/Readme.md
index 4d293e54f6..4d404efec4 100644
--- a/Platform/SiFive/U5SeriesPkg/Readme.md
+++ b/Platform/SiFive/U5SeriesPkg/Readme.md
@@ -1,61 +1,59 @@
-# Introduction
-U5SeriesPkg provides the common EFI library and driver modules for SiFive
-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-riscvplatforms branch)
-- **RiscVPlatformPkg**, edk2 master branch
-  (Currently is in edk2-staging/RISC-V-V2 branch)
-- **RiscVPkg**, edk2 master branch
-  (Currently is in edk2-staging/RISC-V-V2 branch)
+# Introduction of SiFive U5 Series Platforms
+U5SeriesPkg provides the common EDK2 libraries and drivers for SiFive U5 series platforms. Currently the supported
+platforms are Freedom U500 VC707 platform and Freedom U540 HiFive Unleashed platform.
+
+Both platforms are built with below common edk2 packages under edk2-platforms repository,
+- [**U5SeriesPkg**](https://github.com/tianocore/edk2-platforms/tree/master/Platform/SiFive/U5SeriesPkg)
+- [**RiscVPlatformPkg**](https://github.com/tianocore/edk2-platforms/tree/master/Platform/RISC-V/PlatformPkg)
+- [**RiscVProcessorPkg**](https://github.com/tianocore/edk2-platforms/tree/master/Silicon/RISC-V/ProcessorPkg)
 
 ## U500 Platform
-This is a sample RISC-V EDK2 platform package used agaist SiFive Freedom U500
+This is a sample RISC-V EDK2 platform package used against to SiFive Freedom U500
 VC707 FPGA Dev Kit, please refer to "SiFive Freedom U500 VC707 FPGA Getting
 Started Guide" on https://www.sifive.com/documentation.
+The binary built from Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board can run on U500 VC707 FPGA board.
+```
+build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+```
 
 ## U540 Platform
-This is a sample RISC-V EDK2 platform package used against SiFive Freedom U540
-HiFive Unleashed development board, please refer to "SiFive Freedom U540-C000
-Manual" on https://www.sifive.com.
-The binary built from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/
-can run on main stream [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)
-using qemu-system-riscv64 under riscv64-softmmu. Launch the binary with
+This is a sample RISC-V EDK2 platform package used for the SiFive Freedom U540 HiFive Unleashed development board, please refer to "SiFive Freedom U540-C000 Manual" on https://www.sifive.com.
+The binary built from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/ can run on both hardware and
+[QEMU](https://git.qemu.org/?p=qemu.git;a=summary). It is confirmed that version 5.0 of QEMU can boot the firmware.
+```
+build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+```
+For running U540 edk2 binary on QEMU, use qemu-system-riscv64 under riscv64-softmmu to launch the binary with
+below parameters,
 
 ```
--cpu sifive-u54 -machine sifive_u
+qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd -m 2048 -nographic -smp cpus=5,maxcpus=5
 ```
 
-## Download the sources
+## Download the Source Code
 ```
-git clone https://github.com/tianocore/edk2-staging.git
-# Checkout RISC-V-V2 branch
+git clone https://github.com/tianocore/edk2.git
 git clone https://github.com/tianocore/edk2-platforms.git
-# Checkout devel-riscvplatforms branch
-git clone https://github.com/tianocore/edk2-non-osi.git
 ```
-
-## Platform Owners
-Chang, Abner <abner.chang@hpe.com>
-Chen, Gilbert <gilbert.chen@hpe.com>
+Refer to [Readme.md](https://github.com/tianocore/edk2-platforms/blob/master/Platform/RISC-V/PlatformPkg/Readme.md) for building RISC-V platforms.
 
 ## Platform Status
-Currently the binary built from U500Pkg can boot SiFive Freedom U500 VC707
+**FreedomU500VC707Board**
+Currently the binary built from U500 edk2 package can boot SiFive Freedom U500 VC707
 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/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`
+**FreedomU540HiFiveUnleashedBoard**
+Currently the binary built from U540 edk2 package can boot SiFive Freedom U540 HiFive Unleashed
+to EFI shell with console in/out enabled and Linux kernel. Please refer to https://github.com/riscv/riscv-uefi-edk2-docs for booting to Linux kernel.
 
 ## Supported Operating Systems
-Only support to boot to EFI Shell so far.
+Please refer to https://github.com/riscv/riscv-uefi-edk2-docs.
 
 ## Known Issues and Limitations
 Only RISC-V RV64 is verified on this platform.
 
 ## Related Materials
+- [RISC-V UEFI Documents](https://github.com/riscv/riscv-uefi-edk2-docs)
 - [RISC-V OpenSbi](https://github.com/riscv/opensbi)
 - [SiFive U500 VC707 FPGA Getting Started Guide](https://sifive.cdn.prismic.io/sifive%2Fc248fabc-5e44-4412-b1c3-6bb6aac73a2c_sifive-u500-vc707-gettingstarted-v0.2.pdf)
 - [SiFive Freedom U540-C000 Manual](https://sifive.cdn.prismic.io/sifive%2F834354f0-08e6-423c-bf1f-0cb58ef14061_fu540-c000-v1.0.pdf)
@@ -63,48 +61,54 @@ Only RISC-V RV64 is verified on this platform.
 
 ## U5SeriesPkg Libraries and Drivers
 ### PeiCoreInfoHobLib
-This is the library to create RISC-V core characteristics for building up
-RISC-V related SMBIOS records to support the unified boot loader and OS image.
+This is the library to create RISC-V core characteristics for building up RISC-V related SMBIOS records to support
+the single boot loader image or OS image on the RISC-V variants
 This library leverage the silicon libraries provided in Silicon/SiFive.
 
 ### RiscVPlatformTimerLib
-This is common U5 series platform timer library which has the
-platform-specific timer implementation.
+This is common U5 series platform timer library which has the platform-specific timer implementation.
+
+### SerialLib
+This is common U5 series platform serial port library.
 
 ### TimerDxe
-This is U5 series platform timer DXE driver whcih has the platform-specific
-timer implementation.
+This is common U5 series platform timer DXE driver which has the platform-specific timer implementation.
 
 ## U500 Platform Libraries and Drivers
 ### RiscVOpensbiPlatformLib
-In order to reduce the dependencies with RISC-V OpenSBI project
-(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build process, the
-implementation of RISC-V EDK2 platform is leveraging platform source code from
+In order to reduce the dependencies with RISC-V OpenSBI project (https://github.com/riscv/opensbi) and fewer
+burdens to EDK2 build process, the implementation of RISC-V EDK2 platform is leveraging platform source code from
 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.
+[RISC-V OpenSBI code tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and built based on edk2
+build environment.
 
 ### PlatformPei
-This is the platform-implementation specific library which is executed in early
-PEI phase for U500 platform initialization.
+This is the platform-implementation specific library which is executed in early PEI phase for U500 platform
+initialization.
 
 ## U540 Platform Libraries and Drivers
 ### RiscVOpensbiPlatformLib
-In order to reduce the dependencies with RISC-V OpenSBI project
-(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build process, the
-implementation of RISC-V EDK2 platform is leveraging platform source code from
+In order to reduce the dependencies with RISC-V OpenSBI project (https://github.com/riscv/opensbi) and fewer
+burdens to EDK2 build process, the implementation of RISC-V EDK2 platform is leveraging platform source code from
 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.
+[RISC-V OpenSBI code tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and built based on edk2
+build environment.
 
 ### PlatformPei
-This is the platform-implementation specific library which is executed in early
-PEI phase for U540 platform initialization.
+This is the platform-implementation specific library which is executed in early PEI phase for U540 platform
+initialization.
 
 ## U5SeriesPkg Platform PCD settings
 
 | **PCD name** |**Usage**|
 |----------------|----------|
+|PcdU5PlatformSystemClock| U5 series platform system clock|
 |PcdNumberofU5Cores| Number of U5 core enabled on U5 series platform|
 |PcdE5MCSupported| Indicates whether the Monitor Core (E5) is supported on U5 series platform|
 |PcdU5UartBase|Platform serial port base address|
+
+
+## Platform Owners
+Chang, Abner <abner.chang@hpe.com>
+Chen, Gilbert <gilbert.chen@hpe.com>
+Schaefer, Daniel <daniel.schaefer@hpe.com>
\ No newline at end of file
-- 
2.25.0


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

* Re: [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md
  2020-08-27 12:03 ` [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md Abner Chang
@ 2020-08-27 13:01   ` Leif Lindholm
  2020-08-27 13:14     ` Abner Chang
  0 siblings, 1 reply; 13+ messages in thread
From: Leif Lindholm @ 2020-08-27 13:01 UTC (permalink / raw)
  To: Abner Chang; +Cc: devel, Daniel Schaefer, Michael D Kinney

You have a typo in the list name inside [] above.
If that's in your static config, please fix it.
If it's not, please make one :)

For this actual patch (unaffected by the above):
Reviewed-by: Leif Lindholm <leif@nuviainc.com>

On Thu, Aug 27, 2020 at 20:03:03 +0800, Abner Chang wrote:
> Mention to update submodule under for edk2-platforms. It is for RISC-V OpenSBI library.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  Readme.md | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Readme.md b/Readme.md
> index 0675685fb7..d896b2c5fc 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -97,6 +97,7 @@ target-specific binutils. These are included with any prepackaged GCC toolchain
>     $ git submodule update --init
>     ...
>     $ git clone https://github.com/tianocore/edk2-platforms.git
> +   $ git submodule update --init
>     ...
>     $ git clone https://github.com/tianocore/edk2-non-osi.git
>     ```
> -- 
> 2.25.0
> 

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

* Re: [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md
  2020-08-27 13:01   ` Leif Lindholm
@ 2020-08-27 13:14     ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2020-08-27 13:14 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: devel@edk2.groups.io, Schaefer, Daniel, Michael D Kinney

Oops!!! It always happens to me. I will correct it.
Thanks :)

> -----Original Message-----
> From: Leif Lindholm [mailto:leif@nuviainc.com]
> Sent: Thursday, August 27, 2020 9:01 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Cc: devel@edk2.groups.io; Schaefer, Daniel <daniel.schaefer@hpe.com>;
> Michael D Kinney <michael.d.kinney@intel.com>
> Subject: Re: [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md
> 
> You have a typo in the list name inside [] above.
> If that's in your static config, please fix it.
> If it's not, please make one :)
> 
> For this actual patch (unaffected by the above):
> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> 
> On Thu, Aug 27, 2020 at 20:03:03 +0800, Abner Chang wrote:
> > Mention to update submodule under for edk2-platforms. It is for RISC-V
> OpenSBI library.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> >
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > ---
> >  Readme.md | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Readme.md b/Readme.md
> > index 0675685fb7..d896b2c5fc 100644
> > --- a/Readme.md
> > +++ b/Readme.md
> > @@ -97,6 +97,7 @@ target-specific binutils. These are included with any
> prepackaged GCC toolchain
> >     $ git submodule update --init
> >     ...
> >     $ git clone https://github.com/tianocore/edk2-platforms.git
> > +   $ git submodule update --init
> >     ...
> >     $ git clone https://github.com/tianocore/edk2-non-osi.git
> >     ```
> > --
> > 2.25.0
> >

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

* Re: [edk2-devel] [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: Revise Readme.md
  2020-08-27 12:03 ` [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: " Abner Chang
@ 2020-08-27 13:23   ` Leif Lindholm
  2020-08-27 16:33     ` Abner Chang
  0 siblings, 1 reply; 13+ messages in thread
From: Leif Lindholm @ 2020-08-27 13:23 UTC (permalink / raw)
  To: devel, abner.chang; +Cc: Daniel Schaefer

On Thu, Aug 27, 2020 at 20:03:04 +0800, Abner Chang wrote:
> Update RISC-V PlatformPkg Readme.md to align with the latest implementation.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> 
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  Platform/RISC-V/PlatformPkg/Readme.md | 72 ++++++++++++++-------------
>  1 file changed, 37 insertions(+), 35 deletions(-)
> 
> diff --git a/Platform/RISC-V/PlatformPkg/Readme.md b/Platform/RISC-V/PlatformPkg/Readme.md
> index 2632ebeb28..bd3b823fb4 100644
> --- a/Platform/RISC-V/PlatformPkg/Readme.md
> +++ b/Platform/RISC-V/PlatformPkg/Readme.md
> @@ -1,49 +1,48 @@
> -# Introduction
> +# Introduction of EDK2 RISC-V Port

This is edk2-platforms: any introduction of edk2 portions should be in edk2.

>  
> -## EDK2 RISC-V Platform Packages
> -RISC-V platform package provides the generic and common modules for RISC-V
> -platforms. RISC-V platform package could include RiscPlatformPkg.dec to
> -use the common drivers, libraries, definitions, PCDs and etc. for the
> -platform development.
> +## EDK2 RISC-V Project
> +The edk2 build architecture which is supported and verified on edk2 code base for RISC-V platforms is `RISCV64`.
> +The toolchain is on RISC-V GitHub (https://github.com/riscv/riscv-gnu-toolchain) for building edk2 RISC-V binary.
> +The corresponding edk2 Toolchain tag for building RISC-V platform is "GCC5" declared in `tools_def.txt`.

Please wrap long lines, like in the text being replaced.
The point of markdown/rst etc is that it can be rendered into
auto-reflowed HTML text *or* read directly in a terminal. Wrapping it
properly for the latter won't impact the former.

>  
> -There are two packages to support RISC-V:
> +There are two packages to support RISC-V edk2 platforms:
>  - `edk2-platforms/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec`
>  - `edk2-platforms/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec`

(I would say edk2-platforms can be left out when referring to the
current repository.)

>  
> -`RiscVPlatformPkg` provides SEC phase and NULL libs.
> -`RiscVProcessorPkg` provides many libraries, PEIMs and DXE drivers.
> +`RiscVPlatformPkg` currently provides the generic SEC driver for all RISC-V platforms, and some platform level libraries.
> +`RiscVProcessorPkg` currently provides RISC-V processor related libraries, PEI modules, DXE drivers and industrial
> +standard header files.
>  
> -### Download the sources ###
> +## EDK2 RISC-V Platform Package

edk2-platforms?

> +RISC-V platform package provides the common modules for RISC-V platforms. RISC-V platform vendors could include
> +RiscPlatformPkg.dec to use the common drivers, libraries, definitions, PCDs and etc. for the
> +RISC-V platform development.
> +
> +### Download the Source Code ###
>  ```
>  git clone https://github.com/tianocore/edk2.git
> +git clone https://github.com/tianocore/edk2-platforms.git
>  
> -git clone https://github.com/changab/edk2-platforms.git
> -# Check out branch: riscv-smode-lib
>  ```
>  
> -To build it, you have to follow the regular steps for EDK2 and additionally set
> -an environmen variable to point to your RISC-V toolchain installation,
> -including the binary prefixes:
> -
> +You have to follow the build steps for EDK2 (https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-with-EDK-II)
> +and additionally set an environment variable to point to your RISC-V toolchain binaries for building RISC-V
> +platforms,
>  ```
> +# e.g. If the toolchain binaries are under /riscv-gnu-toolchain-binaries/bin
>  export GCC5_RISCV64_PREFIX=/riscv-gnu-toolchain-binaries/bin/riscv64-unknown-elf-
>  ```

Look, I realise you guys aren't building natively yet, but I
*strongly* recomment that you start seeing that as something normal
sooner rather than later. There's nothing wrong with describing cross
compilation as well, and in these early days even point to specific
"known good" toolchains, but treating it as the only valid way of
building feeds complacency.

And even while I *did* push for native-is-normal for arm64 from the
earliest days, we still get occasional comments about people using
some archaologic specific linaro build and think the sky will fall on
their heads because it's an ancient build for i686 and no longer runs
on current Linux distros.

/
    Leif

>  
> -Then you can build the image for the SiFive HifiveUnleashed platform:
> +Then you can build the edk2 firmware image for RISC-V platforms.
>  
>  ```
> +# e.g. For building SiFive Hifive Unleashed platform:
>  build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
>  ```
>  
> -### EDK2 project
> -All changes in edk2 are upstream, however, most of the RISC-V code is in
> -edk2-platforms. Therefore you have to check out the branch `riscv-smode-lib` on
> -`github.com/changab/edk2-platforms`.
> -
> -The build architecture which is supported and verified so far is `RISCV64`.
> -The latest master of the RISC-V toolchain https://github.com/riscv/riscv-gnu-toolchain
> -should work but the latest verified commit is `b468107e701433e1caca3dbc8aef8d40`.
> -Toolchain tag is "GCC5" declared in `tools_def.txt`
> +## RISC-V OpenSBI Library
> +RISC-V [OpenSBI](https://github.com/riscv/opensbi) is the implementation of [RISC-V SBI (Supervisor Binary Interface) specification](https://github.com/riscv/riscv-sbi-doc). For EDK2 UEFI firmware solution, RISC-V OpenSBI is integrated as a library [(submoudule)](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) in EDK2 RISC-V Processor Package. The RISC-V OpenSBI library is built in SEC driver
> +without any modifications and provides the interfaces for supervisor mode execution environment to execute privileged operations.
>  
>  ## RISC-V Platform PCD settings
>  ### EDK2 Firmware Volume Settings
> @@ -54,9 +53,9 @@ EDK2 Firmware volume related PCDs which declared in platform FDF file.
>  |PcdRiscVSecFvBase| The base address of SEC Firmware Volume|
>  |PcdRiscVSecFvSize| The size of SEC Firmware Volume|
>  |PcdRiscVPeiFvBase| The base address of PEI Firmware Volume|
> -|PcdRiscVPeiFvSize| The size of SEC Firmware Volume|
> +|PcdRiscVPeiFvSize| The size of PEI Firmware Volume|
>  |PcdRiscVDxeFvBase| The base address of DXE Firmware Volume|
> -|PcdRiscVDxeFvSize| The size of SEC Firmware Volume|
> +|PcdRiscVDxeFvSize| The size of DXE Firmware Volume|
>  
>  ### EDK2 EFI Variable Region Settings
>  The PCD settings regard to EFI Variable
> @@ -84,21 +83,24 @@ Below PCDs could be set in platform FDF file.
>  |--------------|---------|
>  |PcdHartCount| Number of RISC-V HARTs, the value is processor-implementation specific|
>  |PcdBootHartId| The ID of RISC-V HART to execute main fimrware code and boot system to OS|
> +|PcdBootableHartNumber|The bootable HART number, which is incorporate with RISC-V OpenSBI platform hart_index2id value|
>  
>  ### RISC-V OpenSBI Settings
>  
>  | **PCD name** |**Usage**|
>  |--------------|---------|
> -|PcdScratchRamBase| The base address of OpenSBI scratch buffer for all RISC-V HARTs|
> -|PcdScratchRamSize| The total size of OpenSBI scratch buffer for all RISC-V HARTs|
> -|PcdOpenSbiStackSize| The size of initial stack of each RISC-V HART for booting system use OpenSBI|
> +|PcdScratchRamBase| The base address of RISC-V OpenSBI scratch buffer for all RISC-V HARTs|
> +|PcdScratchRamSize| The total size of RISC-V OpenSBI scratch buffer for all RISC-V HARTs|
> +|PcdOpenSbiStackSize| The size of initial stack of each RISC-V HART for booting system use RISC-V OpenSBI|
>  |PcdTemporaryRamBase| The base address of temporary memory for PEI phase|
>  |PcdTemporaryRamSize| The temporary memory size for PEI phase|
> +|PcdPeiCorePrivilegeMode|The target RISC-V privilege mode for edk2 PEI phase|
>  
>  ## Supported Operating Systems
> -Only support to boot to EFI Shell so far.
> -
> -Porting GRUB2 and Linux EFISTUB is in progress.
> +Currently support boot to EFI Shell and Linux kernel.
> +Refer to below link for more information,
> +https://github.com/riscv/riscv-uefi-edk2-docs
>  
>  ## Known Issues and Limitations
> -Only RISC-V RV64 is verified.
> +Only RISC-V RV64 is verified on edk2.
> +
> -- 
> 2.25.0
> 
> 
> 
> 

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

* Re: [edk2-devel] [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md
  2020-08-27 12:03 ` [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: " Abner Chang
@ 2020-08-27 13:24   ` Leif Lindholm
  2020-08-27 13:43   ` Daniel Schaefer
  1 sibling, 0 replies; 13+ messages in thread
From: Leif Lindholm @ 2020-08-27 13:24 UTC (permalink / raw)
  To: devel, abner.chang; +Cc: Daniel Schaefer

Umm, this is empty?

On Thu, Aug 27, 2020 at 20:03:05 +0800, Abner Chang wrote:
> 
> 
> 

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

* Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md
  2020-08-27 12:03 ` [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: " Abner Chang
  2020-08-27 13:24   ` [edk2-devel] " Leif Lindholm
@ 2020-08-27 13:43   ` Daniel Schaefer
  2020-08-27 14:06     ` Abner Chang
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2020-08-27 13:43 UTC (permalink / raw)
  To: Abner Chang, devel; +Cc: leif@nuviainc.com, Michael D Kinney

Oops, you didn't send this to Leif and Mike?

On 8/27/20 2:03 PM, Abner Chang wrote:
> Update RISC-V U5SeriesPkg Readme.md to align with the latest implementation.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> 
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>   Platform/SiFive/U5SeriesPkg/Readme.md | 112 +++++++++++++-------------
>   1 file changed, 58 insertions(+), 54 deletions(-)
> 
> diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md b/Platform/SiFive/U5SeriesPkg/Readme.md
> index 4d293e54f6..4d404efec4 100644
> --- a/Platform/SiFive/U5SeriesPkg/Readme.md
> +++ b/Platform/SiFive/U5SeriesPkg/Readme.md
> @@ -1,61 +1,59 @@
> -# Introduction
> -U5SeriesPkg provides the common EFI library and driver modules for SiFive
> -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-riscvplatforms branch)
> -- **RiscVPlatformPkg**, edk2 master branch
> -  (Currently is in edk2-staging/RISC-V-V2 branch)
> -- **RiscVPkg**, edk2 master branch
> -  (Currently is in edk2-staging/RISC-V-V2 branch)
> +# Introduction of SiFive U5 Series Platforms
> +U5SeriesPkg provides the common EDK2 libraries and drivers for SiFive U5 series platforms. Currently the supported
> +platforms are Freedom U500 VC707 platform and Freedom U540 HiFive Unleashed platform.
> +
> +Both platforms are built with below common edk2 packages under edk2-platforms repository,
> +- [**U5SeriesPkg**](https://github.com/tianocore/edk2-platforms/tree/master/Platform/SiFive/U5SeriesPkg)
> +- [**RiscVPlatformPkg**](https://github.com/tianocore/edk2-platforms/tree/master/Platform/RISC-V/PlatformPkg)
> +- [**RiscVProcessorPkg**](https://github.com/tianocore/edk2-platforms/tree/master/Silicon/RISC-V/ProcessorPkg)
>   
>   ## U500 Platform
> -This is a sample RISC-V EDK2 platform package used agaist SiFive Freedom U500

I don't think we need to say "RISC-V EDK2" so often.

> +This is a sample RISC-V EDK2 platform package used against to SiFive Freedom U500

- RISC-V EDK2

>   VC707 FPGA Dev Kit, please refer to "SiFive Freedom U500 VC707 FPGA Getting
>   Started Guide" on https://www.sifive.com/documentation.
> +The binary built from Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board can run on U500 VC707 FPGA board.
> +```
> +build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> +```
>   
>   ## U540 Platform
> -This is a sample RISC-V EDK2 platform package used against SiFive Freedom U540

- RISC-V EDK2

> -HiFive Unleashed development board, please refer to "SiFive Freedom U540-C000
> -Manual" on https://www.sifive.com.
> -The binary built from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/
> -can run on main stream [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)
> -using qemu-system-riscv64 under riscv64-softmmu. Launch the binary with
> +This is a sample RISC-V EDK2 platform package used for the SiFive Freedom U540 HiFive Unleashed development board, please refer to "SiFive Freedom U540-C000 Manual" on https://www.sifive.com.

- RISC-V EDK2

> +The binary built from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/ can run on both hardware and
> +[QEMU](https://git.qemu.org/?p=qemu.git;a=summary). It is confirmed that version 5.0 of QEMU can boot the firmware.

I think here we should also say: can boot with this firmware to EFI shell and Linux userspace.

> +```
> +build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> +```
> +For running U540 edk2 binary on QEMU, use qemu-system-riscv64 under riscv64-softmmu to launch the binary with
> +below parameters,
>   
>   ```
> --cpu sifive-u54 -machine sifive_u
> +qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd -m 2048 -nographic -smp cpus=5,maxcpus=5
>   ```
>   
> -## Download the sources
> +## Download the Source Code
>   ```
> -git clone https://github.com/tianocore/edk2-staging.git
> -# Checkout RISC-V-V2 branch
> +git clone https://github.com/tianocore/edk2.git
>   git clone https://github.com/tianocore/edk2-platforms.git

Please add --recurse-submodules here to also clone opensbi.

> -# Checkout devel-riscvplatforms branch
> -git clone https://github.com/tianocore/edk2-non-osi.git
>   ```
> -
> -## Platform Owners
> -Chang, Abner <abner.chang@hpe.com>
> -Chen, Gilbert <gilbert.chen@hpe.com>
> +Refer to [Readme.md](https://github.com/tianocore/edk2-platforms/blob/master/Platform/RISC-V/PlatformPkg/Readme.md) for building RISC-V platforms.
>   
>   ## Platform Status
> -Currently the binary built from U500Pkg can boot SiFive Freedom U500 VC707
> +**FreedomU500VC707Board**
> +Currently the binary built from U500 edk2 package can boot SiFive Freedom U500 VC707
>   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/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`
> +**FreedomU540HiFiveUnleashedBoard**
> +Currently the binary built from U540 edk2 package can boot SiFive Freedom U540 HiFive Unleashed
> +to EFI shell with console in/out enabled and Linux kernel. Please refer to https://github.com/riscv/riscv-uefi-edk2-docs for booting to Linux kernel.
>   
>   ## Supported Operating Systems
> -Only support to boot to EFI Shell so far.
> +Please refer to https://github.com/riscv/riscv-uefi-edk2-docs.
>   
>   ## Known Issues and Limitations
>   Only RISC-V RV64 is verified on this platform.
>   
>   ## Related Materials
> +- [RISC-V UEFI Documents](https://github.com/riscv/riscv-uefi-edk2-docs)
>   - [RISC-V OpenSbi](https://github.com/riscv/opensbi)
>   - [SiFive U500 VC707 FPGA Getting Started Guide](https://sifive.cdn.prismic.io/sifive%2Fc248fabc-5e44-4412-b1c3-6bb6aac73a2c_sifive-u500-vc707-gettingstarted-v0.2.pdf)
>   - [SiFive Freedom U540-C000 Manual](https://sifive.cdn.prismic.io/sifive%2F834354f0-08e6-423c-bf1f-0cb58ef14061_fu540-c000-v1.0.pdf)
> @@ -63,48 +61,54 @@ Only RISC-V RV64 is verified on this platform.
>   
>   ## U5SeriesPkg Libraries and Drivers
>   ### PeiCoreInfoHobLib
> -This is the library to create RISC-V core characteristics for building up
> -RISC-V related SMBIOS records to support the unified boot loader and OS image.
> +This is the library to create RISC-V core characteristics for building up RISC-V related SMBIOS records to support
> +the single boot loader image or OS image on the RISC-V variants

Hey! That's not what we discussed ;) What about:

a single boot loader and OS image for all RISC-V platforms by discovering RISC-V hart configurations dynamically.

>   This library leverage the silicon libraries provided in Silicon/SiFive.
>   
>   ### RiscVPlatformTimerLib
> -This is common U5 series platform timer library which has the
> -platform-specific timer implementation.
> +This is common U5 series platform timer library which has the platform-specific timer implementation.
> +
> +### SerialLib
> +This is common U5 series platform serial port library.
>   
>   ### TimerDxe
> -This is U5 series platform timer DXE driver whcih has the platform-specific
> -timer implementation.
> +This is common U5 series platform timer DXE driver which has the platform-specific timer implementation.
>   
>   ## U500 Platform Libraries and Drivers
>   ### RiscVOpensbiPlatformLib
> -In order to reduce the dependencies with RISC-V OpenSBI project
> -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build process, the
> -implementation of RISC-V EDK2 platform is leveraging platform source code from
> +In order to reduce the dependencies with RISC-V OpenSBI project (https://github.com/riscv/opensbi) and fewer
> +burdens to EDK2 build process, the implementation of RISC-V EDK2 platform is leveraging platform source code from
>   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.
> +[RISC-V OpenSBI code tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and built based on edk2
> +build environment.
>   
>   ### PlatformPei
> -This is the platform-implementation specific library which is executed in early
> -PEI phase for U500 platform initialization.
> +This is the platform-implementation specific library which is executed in early PEI phase for U500 platform
> +initialization.
>   
>   ## U540 Platform Libraries and Drivers
>   ### RiscVOpensbiPlatformLib
> -In order to reduce the dependencies with RISC-V OpenSBI project
> -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build process, the
> -implementation of RISC-V EDK2 platform is leveraging platform source code from
> +In order to reduce the dependencies with RISC-V OpenSBI project (https://github.com/riscv/opensbi) and fewer
> +burdens to EDK2 build process,

Hm, we are depending on OpenSBI. You can say to avoid duplicating code we use it.
But we're switching to S-Mode very soon to avoid calling many internal OpenSBI functions
and instead calling the standardized SBI interface.

> the implementation of RISC-V EDK2 platform is leveraging platform source code from
>   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.
> +[RISC-V OpenSBI code tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and built based on edk2
> +build environment.
>   
>   ### PlatformPei
> -This is the platform-implementation specific library which is executed in early
> -PEI phase for U540 platform initialization.
> +This is the platform-implementation specific library which is executed in early PEI phase for U540 platform
> +initialization.
>   
>   ## U5SeriesPkg Platform PCD settings
>   
>   | **PCD name** |**Usage**|
>   |----------------|----------|
> +|PcdU5PlatformSystemClock| U5 series platform system clock|
>   |PcdNumberofU5Cores| Number of U5 core enabled on U5 series platform|
>   |PcdE5MCSupported| Indicates whether the Monitor Core (E5) is supported on U5 series platform|
>   |PcdU5UartBase|Platform serial port base address|
> +
> +
> +## Platform Owners
> +Chang, Abner <abner.chang@hpe.com>
> +Chen, Gilbert <gilbert.chen@hpe.com>
> +Schaefer, Daniel <daniel.schaefer@hpe.com>
> \ No newline at end of file
> 

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

* Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md
  2020-08-27 13:43   ` Daniel Schaefer
@ 2020-08-27 14:06     ` Abner Chang
  2020-08-27 14:54       ` Daniel Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Abner Chang @ 2020-08-27 14:06 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: leif@nuviainc.com, Michael D Kinney

Sorry, I didn't send patch to edk2-platform for a while, let me resend the whole set.

Yes, I missed Mike and Leif...

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Thursday, August 27, 2020 9:44 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: leif@nuviainc.com; Michael D Kinney <michael.d.kinney@intel.com>
> Subject: Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise
> Readme.md
> 
> Oops, you didn't send this to Leif and Mike?
> 
> On 8/27/20 2:03 PM, Abner Chang wrote:
> > Update RISC-V U5SeriesPkg Readme.md to align with the latest
> implementation.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> >
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > ---
> >   Platform/SiFive/U5SeriesPkg/Readme.md | 112 +++++++++++++-----------
> --
> >   1 file changed, 58 insertions(+), 54 deletions(-)
> >
> > diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md
> > b/Platform/SiFive/U5SeriesPkg/Readme.md
> > index 4d293e54f6..4d404efec4 100644
> > --- a/Platform/SiFive/U5SeriesPkg/Readme.md
> > +++ b/Platform/SiFive/U5SeriesPkg/Readme.md
> > @@ -1,61 +1,59 @@
> > -# Introduction
> > -U5SeriesPkg provides the common EFI library and driver modules for
> > SiFive
> > -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-riscvplatforms branch)
> > -- **RiscVPlatformPkg**, edk2 master branch
> > -  (Currently is in edk2-staging/RISC-V-V2 branch)
> > -- **RiscVPkg**, edk2 master branch
> > -  (Currently is in edk2-staging/RISC-V-V2 branch)
> > +# Introduction of SiFive U5 Series Platforms U5SeriesPkg provides the
> > +common EDK2 libraries and drivers for SiFive U5 series platforms.
> > +Currently the supported platforms are Freedom U500 VC707 platform and
> Freedom U540 HiFive Unleashed platform.
> > +
> > +Both platforms are built with below common edk2 packages under
> > +edk2-platforms repository,
> > +-
> > +[**U5SeriesPkg**](https://github.com/tianocore/edk2-
> platforms/tree/ma
> > +ster/Platform/SiFive/U5SeriesPkg)
> > +-
> > +[**RiscVPlatformPkg**](https://github.com/tianocore/edk2-platforms/tr
> > +ee/master/Platform/RISC-V/PlatformPkg)
> > +-
> > +[**RiscVProcessorPkg**](https://github.com/tianocore/edk2-
> platforms/t
> > +ree/master/Silicon/RISC-V/ProcessorPkg)
> >
> >   ## U500 Platform
> > -This is a sample RISC-V EDK2 platform package used agaist SiFive
> > Freedom U500
> 
> I don't think we need to say "RISC-V EDK2" so often.
> 
> > +This is a sample RISC-V EDK2 platform package used against to SiFive
> > +Freedom U500
> 
> - RISC-V EDK2
> 
> >   VC707 FPGA Dev Kit, please refer to "SiFive Freedom U500 VC707 FPGA
> Getting
> >   Started Guide" on https://www.sifive.com/documentation.
> > +The binary built from
> Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board can run on U500
> VC707 FPGA board.
> > +```
> > +build -a RISCV64 -t GCC5 -p
> > +Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> > +```
> >
> >   ## U540 Platform
> > -This is a sample RISC-V EDK2 platform package used against SiFive
> > Freedom U540
> 
> - RISC-V EDK2
> 
> > -HiFive Unleashed development board, please refer to "SiFive Freedom
> > U540-C000 -Manual" on https://www.sifive.com.
> > -The binary built from
> > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/
> > -can run on main stream
> > [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)
> > -using qemu-system-riscv64 under riscv64-softmmu. Launch the binary
> > with
> > +This is a sample RISC-V EDK2 platform package used for the SiFive
> Freedom U540 HiFive Unleashed development board, please refer to "SiFive
> Freedom U540-C000 Manual" on https://www.sifive.com.
> 
> - RISC-V EDK2
> 
> > +The binary built from
> > +Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/ can
> run on both hardware and
> [QEMU](https://git.qemu.org/?p=qemu.git;a=summary). It is confirmed that
> version 5.0 of QEMU can boot the firmware.
> 
> I think here we should also say: can boot with this firmware to EFI shell and
> Linux userspace.
> 
> > +```
> > +build -a RISCV64 -t GCC5 -p
> >
> +Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d
> sc
> > +```
> > +For running U540 edk2 binary on QEMU, use qemu-system-riscv64 under
> > +riscv64-softmmu to launch the binary with below parameters,
> >
> >   ```
> > --cpu sifive-u54 -machine sifive_u
> > +qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd
> > +-m 2048 -nographic -smp cpus=5,maxcpus=5
> >   ```
> >
> > -## Download the sources
> > +## Download the Source Code
> >   ```
> > -git clone https://github.com/tianocore/edk2-staging.git
> > -# Checkout RISC-V-V2 branch
> > +git clone https://github.com/tianocore/edk2.git
> >   git clone https://github.com/tianocore/edk2-platforms.git
> 
> Please add --recurse-submodules here to also clone opensbi.
> 
> > -# Checkout devel-riscvplatforms branch -git clone
> > https://github.com/tianocore/edk2-non-osi.git
> >   ```
> > -
> > -## Platform Owners
> > -Chang, Abner <abner.chang@hpe.com>
> > -Chen, Gilbert <gilbert.chen@hpe.com>
> > +Refer to [Readme.md](https://github.com/tianocore/edk2-
> platforms/blob/master/Platform/RISC-V/PlatformPkg/Readme.md) for
> building RISC-V platforms.
> >
> >   ## Platform Status
> > -Currently the binary built from U500Pkg can boot SiFive Freedom U500
> > VC707
> > +**FreedomU500VC707Board**
> > +Currently the binary built from U500 edk2 package can boot SiFive
> > +Freedom U500 VC707
> >   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/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`
> > +**FreedomU540HiFiveUnleashedBoard**
> > +Currently the binary built from U540 edk2 package can boot SiFive
> > +Freedom U540 HiFive Unleashed to EFI shell with console in/out enabled
> and Linux kernel. Please refer to https://github.com/riscv/riscv-uefi-edk2-
> docs for booting to Linux kernel.
> >
> >   ## Supported Operating Systems
> > -Only support to boot to EFI Shell so far.
> > +Please refer to https://github.com/riscv/riscv-uefi-edk2-docs.
> >
> >   ## Known Issues and Limitations
> >   Only RISC-V RV64 is verified on this platform.
> >
> >   ## Related Materials
> > +- [RISC-V UEFI
> > +Documents](https://github.com/riscv/riscv-uefi-edk2-docs)
> >   - [RISC-V OpenSbi](https://github.com/riscv/opensbi)
> >   - [SiFive U500 VC707 FPGA Getting Started
> Guide](https://sifive.cdn.prismic.io/sifive%2Fc248fabc-5e44-4412-b1c3-
> 6bb6aac73a2c_sifive-u500-vc707-gettingstarted-v0.2.pdf)
> >   - [SiFive Freedom U540-C000
> > Manual](https://sifive.cdn.prismic.io/sifive%2F834354f0-08e6-423c-bf1f
> > -0cb58ef14061_fu540-c000-v1.0.pdf)
> > @@ -63,48 +61,54 @@ Only RISC-V RV64 is verified on this platform.
> >
> >   ## U5SeriesPkg Libraries and Drivers
> >   ### PeiCoreInfoHobLib
> > -This is the library to create RISC-V core characteristics for
> > building up -RISC-V related SMBIOS records to support the unified boot
> loader and OS image.
> > +This is the library to create RISC-V core characteristics for
> > +building up RISC-V related SMBIOS records to support the single boot
> > +loader image or OS image on the RISC-V variants
> 
> Hey! That's not what we discussed ;) What about:
> 
> a single boot loader and OS image for all RISC-V platforms by discovering
> RISC-V hart configurations dynamically.
> 
> >   This library leverage the silicon libraries provided in Silicon/SiFive.
> >
> >   ### RiscVPlatformTimerLib
> > -This is common U5 series platform timer library which has the
> > -platform-specific timer implementation.
> > +This is common U5 series platform timer library which has the platform-
> specific timer implementation.
> > +
> > +### SerialLib
> > +This is common U5 series platform serial port library.
> >
> >   ### TimerDxe
> > -This is U5 series platform timer DXE driver whcih has the
> > platform-specific -timer implementation.
> > +This is common U5 series platform timer DXE driver which has the
> platform-specific timer implementation.
> >
> >   ## U500 Platform Libraries and Drivers
> >   ### RiscVOpensbiPlatformLib
> > -In order to reduce the dependencies with RISC-V OpenSBI project
> > -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > process, the -implementation of RISC-V EDK2 platform is leveraging
> > platform source code from
> > +In order to reduce the dependencies with RISC-V OpenSBI project
> > +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > +process, the implementation of RISC-V EDK2 platform is leveraging
> > +platform source code from
> >   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.
> > +[RISC-V OpenSBI code
> > +tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and
> built based on edk2 build environment.
> >
> >   ### PlatformPei
> > -This is the platform-implementation specific library which is
> > executed in early -PEI phase for U500 platform initialization.
> > +This is the platform-implementation specific library which is
> > +executed in early PEI phase for U500 platform initialization.
> >
> >   ## U540 Platform Libraries and Drivers
> >   ### RiscVOpensbiPlatformLib
> > -In order to reduce the dependencies with RISC-V OpenSBI project
> > -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > process, the -implementation of RISC-V EDK2 platform is leveraging
> > platform source code from
> > +In order to reduce the dependencies with RISC-V OpenSBI project
> > +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > +process,
> 
> Hm, we are depending on OpenSBI. You can say to avoid duplicating code we
> use it.
> But we're switching to S-Mode very soon to avoid calling many internal
> OpenSBI functions and instead calling the standardized SBI interface.
> 
> > the implementation of RISC-V EDK2 platform is leveraging platform source
> code from
> >   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.
> > +[RISC-V OpenSBI code
> > +tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and
> built based on edk2 build environment.
> >
> >   ### PlatformPei
> > -This is the platform-implementation specific library which is
> > executed in early -PEI phase for U540 platform initialization.
> > +This is the platform-implementation specific library which is
> > +executed in early PEI phase for U540 platform initialization.
> >
> >   ## U5SeriesPkg Platform PCD settings
> >
> >   | **PCD name** |**Usage**|
> >   |----------------|----------|
> > +|PcdU5PlatformSystemClock| U5 series platform system clock|
> >   |PcdNumberofU5Cores| Number of U5 core enabled on U5 series
> platform|
> >   |PcdE5MCSupported| Indicates whether the Monitor Core (E5) is
> supported on U5 series platform|
> >   |PcdU5UartBase|Platform serial port base address|
> > +
> > +
> > +## Platform Owners
> > +Chang, Abner <abner.chang@hpe.com>
> > +Chen, Gilbert <gilbert.chen@hpe.com>
> > +Schaefer, Daniel <daniel.schaefer@hpe.com>
> > \ No newline at end of file
> >

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

* Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md
  2020-08-27 14:06     ` Abner Chang
@ 2020-08-27 14:54       ` Daniel Schaefer
  2020-08-27 16:37         ` Abner Chang
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2020-08-27 14:54 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io
  Cc: leif@nuviainc.com, Michael D Kinney

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

I still put a review below, by the way 😉
________________________________
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
Sent: Thursday, August 27, 2020 22:06
To: Schaefer, Daniel <daniel.schaefer@hpe.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: leif@nuviainc.com <leif@nuviainc.com>; Michael D Kinney <michael.d.kinney@intel.com>
Subject: RE: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md

Sorry, I didn't send patch to edk2-platform for a while, let me resend the whole set.

Yes, I missed Mike and Leif...

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Thursday, August 27, 2020 9:44 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: leif@nuviainc.com; Michael D Kinney <michael.d.kinney@intel.com>
> Subject: Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise
> Readme.md
>
> Oops, you didn't send this to Leif and Mike?
>
> On 8/27/20 2:03 PM, Abner Chang wrote:
> > Update RISC-V U5SeriesPkg Readme.md to align with the latest
> implementation.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> >
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > ---
> >   Platform/SiFive/U5SeriesPkg/Readme.md | 112 +++++++++++++-----------
> --
> >   1 file changed, 58 insertions(+), 54 deletions(-)
> >
> > diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md
> > b/Platform/SiFive/U5SeriesPkg/Readme.md
> > index 4d293e54f6..4d404efec4 100644
> > --- a/Platform/SiFive/U5SeriesPkg/Readme.md
> > +++ b/Platform/SiFive/U5SeriesPkg/Readme.md
> > @@ -1,61 +1,59 @@
> > -# Introduction
> > -U5SeriesPkg provides the common EFI library and driver modules for
> > SiFive
> > -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-riscvplatforms branch)
> > -- **RiscVPlatformPkg**, edk2 master branch
> > -  (Currently is in edk2-staging/RISC-V-V2 branch)
> > -- **RiscVPkg**, edk2 master branch
> > -  (Currently is in edk2-staging/RISC-V-V2 branch)
> > +# Introduction of SiFive U5 Series Platforms U5SeriesPkg provides the
> > +common EDK2 libraries and drivers for SiFive U5 series platforms.
> > +Currently the supported platforms are Freedom U500 VC707 platform and
> Freedom U540 HiFive Unleashed platform.
> > +
> > +Both platforms are built with below common edk2 packages under
> > +edk2-platforms repository,
> > +-
> > +[**U5SeriesPkg**](https://github.com/tianocore/edk2-
> platforms/tree/ma
> > +ster/Platform/SiFive/U5SeriesPkg)
> > +-
> > +[**RiscVPlatformPkg**](https://github.com/tianocore/edk2-platforms/tr
> > +ee/master/Platform/RISC-V/PlatformPkg)
> > +-
> > +[**RiscVProcessorPkg**](https://github.com/tianocore/edk2-
> platforms/t
> > +ree/master/Silicon/RISC-V/ProcessorPkg)
> >
> >   ## U500 Platform
> > -This is a sample RISC-V EDK2 platform package used agaist SiFive
> > Freedom U500
>
> I don't think we need to say "RISC-V EDK2" so often.
>
> > +This is a sample RISC-V EDK2 platform package used against to SiFive
> > +Freedom U500
>
> - RISC-V EDK2
>
> >   VC707 FPGA Dev Kit, please refer to "SiFive Freedom U500 VC707 FPGA
> Getting
> >   Started Guide" on https://www.sifive.com/documentation.
> > +The binary built from
> Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board can run on U500
> VC707 FPGA board.
> > +```
> > +build -a RISCV64 -t GCC5 -p
> > +Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> > +```
> >
> >   ## U540 Platform
> > -This is a sample RISC-V EDK2 platform package used against SiFive
> > Freedom U540
>
> - RISC-V EDK2
>
> > -HiFive Unleashed development board, please refer to "SiFive Freedom
> > U540-C000 -Manual" on https://www.sifive.com.
> > -The binary built from
> > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/
> > -can run on main stream
> > [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)
> > -using qemu-system-riscv64 under riscv64-softmmu. Launch the binary
> > with
> > +This is a sample RISC-V EDK2 platform package used for the SiFive
> Freedom U540 HiFive Unleashed development board, please refer to "SiFive
> Freedom U540-C000 Manual" on https://www.sifive.com.
>
> - RISC-V EDK2
>
> > +The binary built from
> > +Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/ can
> run on both hardware and
> [QEMU](https://git.qemu.org/?p=qemu.git;a=summary). It is confirmed that
> version 5.0 of QEMU can boot the firmware.
>
> I think here we should also say: can boot with this firmware to EFI shell and
> Linux userspace.
>
> > +```
> > +build -a RISCV64 -t GCC5 -p
> >
> +Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d
> sc
> > +```
> > +For running U540 edk2 binary on QEMU, use qemu-system-riscv64 under
> > +riscv64-softmmu to launch the binary with below parameters,
> >
> >   ```
> > --cpu sifive-u54 -machine sifive_u
> > +qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd
> > +-m 2048 -nographic -smp cpus=5,maxcpus=5
> >   ```
> >
> > -## Download the sources
> > +## Download the Source Code
> >   ```
> > -git clone https://github.com/tianocore/edk2-staging.git
> > -# Checkout RISC-V-V2 branch
> > +git clone https://github.com/tianocore/edk2.git
> >   git clone https://github.com/tianocore/edk2-platforms.git
>
> Please add --recurse-submodules here to also clone opensbi.
>
> > -# Checkout devel-riscvplatforms branch -git clone
> > https://github.com/tianocore/edk2-non-osi.git
> >   ```
> > -
> > -## Platform Owners
> > -Chang, Abner <abner.chang@hpe.com>
> > -Chen, Gilbert <gilbert.chen@hpe.com>
> > +Refer to [Readme.md](https://github.com/tianocore/edk2-
> platforms/blob/master/Platform/RISC-V/PlatformPkg/Readme.md) for
> building RISC-V platforms.
> >
> >   ## Platform Status
> > -Currently the binary built from U500Pkg can boot SiFive Freedom U500
> > VC707
> > +**FreedomU500VC707Board**
> > +Currently the binary built from U500 edk2 package can boot SiFive
> > +Freedom U500 VC707
> >   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/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`
> > +**FreedomU540HiFiveUnleashedBoard**
> > +Currently the binary built from U540 edk2 package can boot SiFive
> > +Freedom U540 HiFive Unleashed to EFI shell with console in/out enabled
> and Linux kernel. Please refer to https://github.com/riscv/riscv-uefi-edk2-
> docs for booting to Linux kernel.
> >
> >   ## Supported Operating Systems
> > -Only support to boot to EFI Shell so far.
> > +Please refer to https://github.com/riscv/riscv-uefi-edk2-docs.
> >
> >   ## Known Issues and Limitations
> >   Only RISC-V RV64 is verified on this platform.
> >
> >   ## Related Materials
> > +- [RISC-V UEFI
> > +Documents](https://github.com/riscv/riscv-uefi-edk2-docs)
> >   - [RISC-V OpenSbi](https://github.com/riscv/opensbi)
> >   - [SiFive U500 VC707 FPGA Getting Started
> Guide](https://sifive.cdn.prismic.io/sifive%2Fc248fabc-5e44-4412-b1c3-
> 6bb6aac73a2c_sifive-u500-vc707-gettingstarted-v0.2.pdf)
> >   - [SiFive Freedom U540-C000
> > Manual](https://sifive.cdn.prismic.io/sifive%2F834354f0-08e6-423c-bf1f
> > -0cb58ef14061_fu540-c000-v1.0.pdf)
> > @@ -63,48 +61,54 @@ Only RISC-V RV64 is verified on this platform.
> >
> >   ## U5SeriesPkg Libraries and Drivers
> >   ### PeiCoreInfoHobLib
> > -This is the library to create RISC-V core characteristics for
> > building up -RISC-V related SMBIOS records to support the unified boot
> loader and OS image.
> > +This is the library to create RISC-V core characteristics for
> > +building up RISC-V related SMBIOS records to support the single boot
> > +loader image or OS image on the RISC-V variants
>
> Hey! That's not what we discussed ;) What about:
>
> a single boot loader and OS image for all RISC-V platforms by discovering
> RISC-V hart configurations dynamically.
>
> >   This library leverage the silicon libraries provided in Silicon/SiFive.
> >
> >   ### RiscVPlatformTimerLib
> > -This is common U5 series platform timer library which has the
> > -platform-specific timer implementation.
> > +This is common U5 series platform timer library which has the platform-
> specific timer implementation.
> > +
> > +### SerialLib
> > +This is common U5 series platform serial port library.
> >
> >   ### TimerDxe
> > -This is U5 series platform timer DXE driver whcih has the
> > platform-specific -timer implementation.
> > +This is common U5 series platform timer DXE driver which has the
> platform-specific timer implementation.
> >
> >   ## U500 Platform Libraries and Drivers
> >   ### RiscVOpensbiPlatformLib
> > -In order to reduce the dependencies with RISC-V OpenSBI project
> > -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > process, the -implementation of RISC-V EDK2 platform is leveraging
> > platform source code from
> > +In order to reduce the dependencies with RISC-V OpenSBI project
> > +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > +process, the implementation of RISC-V EDK2 platform is leveraging
> > +platform source code from
> >   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.
> > +[RISC-V OpenSBI code
> > +tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and
> built based on edk2 build environment.
> >
> >   ### PlatformPei
> > -This is the platform-implementation specific library which is
> > executed in early -PEI phase for U500 platform initialization.
> > +This is the platform-implementation specific library which is
> > +executed in early PEI phase for U500 platform initialization.
> >
> >   ## U540 Platform Libraries and Drivers
> >   ### RiscVOpensbiPlatformLib
> > -In order to reduce the dependencies with RISC-V OpenSBI project
> > -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > process, the -implementation of RISC-V EDK2 platform is leveraging
> > platform source code from
> > +In order to reduce the dependencies with RISC-V OpenSBI project
> > +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > +process,
>
> Hm, we are depending on OpenSBI. You can say to avoid duplicating code we
> use it.
> But we're switching to S-Mode very soon to avoid calling many internal
> OpenSBI functions and instead calling the standardized SBI interface.
>
> > the implementation of RISC-V EDK2 platform is leveraging platform source
> code from
> >   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.
> > +[RISC-V OpenSBI code
> > +tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and
> built based on edk2 build environment.
> >
> >   ### PlatformPei
> > -This is the platform-implementation specific library which is
> > executed in early -PEI phase for U540 platform initialization.
> > +This is the platform-implementation specific library which is
> > +executed in early PEI phase for U540 platform initialization.
> >
> >   ## U5SeriesPkg Platform PCD settings
> >
> >   | **PCD name** |**Usage**|
> >   |----------------|----------|
> > +|PcdU5PlatformSystemClock| U5 series platform system clock|
> >   |PcdNumberofU5Cores| Number of U5 core enabled on U5 series
> platform|
> >   |PcdE5MCSupported| Indicates whether the Monitor Core (E5) is
> supported on U5 series platform|
> >   |PcdU5UartBase|Platform serial port base address|
> > +
> > +
> > +## Platform Owners
> > +Chang, Abner <abner.chang@hpe.com>
> > +Chen, Gilbert <gilbert.chen@hpe.com>
> > +Schaefer, Daniel <daniel.schaefer@hpe.com>
> > \ No newline at end of file
> >

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

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

* Re: [edk2-devel] [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: Revise Readme.md
  2020-08-27 13:23   ` [edk2-devel] " Leif Lindholm
@ 2020-08-27 16:33     ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2020-08-27 16:33 UTC (permalink / raw)
  To: Leif Lindholm, devel@edk2.groups.io; +Cc: Schaefer, Daniel

I just resent the whole set of patches without missing patch 3/3. Some comments you mentioned were addressed but the lines are still too long. Will fix it with your comment on v2 patch.

> -----Original Message-----
> From: Leif Lindholm [mailto:leif@nuviainc.com]
> Sent: Thursday, August 27, 2020 9:24 PM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> Cc: Schaefer, Daniel <daniel.schaefer@hpe.com>
> Subject: Re: [edk2-devel] [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg:
> Revise Readme.md
> 
> On Thu, Aug 27, 2020 at 20:03:04 +0800, Abner Chang wrote:
> > Update RISC-V PlatformPkg Readme.md to align with the latest
> implementation.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> > Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> >
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> > ---
> >  Platform/RISC-V/PlatformPkg/Readme.md | 72
> > ++++++++++++++-------------
> >  1 file changed, 37 insertions(+), 35 deletions(-)
> >
> > diff --git a/Platform/RISC-V/PlatformPkg/Readme.md
> > b/Platform/RISC-V/PlatformPkg/Readme.md
> > index 2632ebeb28..bd3b823fb4 100644
> > --- a/Platform/RISC-V/PlatformPkg/Readme.md
> > +++ b/Platform/RISC-V/PlatformPkg/Readme.md
> > @@ -1,49 +1,48 @@
> > -# Introduction
> > +# Introduction of EDK2 RISC-V Port
> 
> This is edk2-platforms: any introduction of edk2 portions should be in edk2.
> 
> >
> > -## EDK2 RISC-V Platform Packages
> > -RISC-V platform package provides the generic and common modules for
> > RISC-V -platforms. RISC-V platform package could include
> > RiscPlatformPkg.dec to -use the common drivers, libraries,
> > definitions, PCDs and etc. for the -platform development.
> > +## EDK2 RISC-V Project
> > +The edk2 build architecture which is supported and verified on edk2 code
> base for RISC-V platforms is `RISCV64`.
> > +The toolchain is on RISC-V GitHub (https://github.com/riscv/riscv-gnu-
> toolchain) for building edk2 RISC-V binary.
> > +The corresponding edk2 Toolchain tag for building RISC-V platform is
> "GCC5" declared in `tools_def.txt`.
> 
> Please wrap long lines, like in the text being replaced.
> The point of markdown/rst etc is that it can be rendered into auto-reflowed
> HTML text *or* read directly in a terminal. Wrapping it properly for the latter
> won't impact the former.
> 
> >
> > -There are two packages to support RISC-V:
> > +There are two packages to support RISC-V edk2 platforms:
> >  - `edk2-platforms/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec`
> >  - `edk2-platforms/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec`
> 
> (I would say edk2-platforms can be left out when referring to the current
> repository.)
> 
> >
> > -`RiscVPlatformPkg` provides SEC phase and NULL libs.
> > -`RiscVProcessorPkg` provides many libraries, PEIMs and DXE drivers.
> > +`RiscVPlatformPkg` currently provides the generic SEC driver for all RISC-V
> platforms, and some platform level libraries.
> > +`RiscVProcessorPkg` currently provides RISC-V processor related
> > +libraries, PEI modules, DXE drivers and industrial standard header files.
> >
> > -### Download the sources ###
> > +## EDK2 RISC-V Platform Package
> 
> edk2-platforms?
> 
> > +RISC-V platform package provides the common modules for RISC-V
> > +platforms. RISC-V platform vendors could include RiscPlatformPkg.dec
> > +to use the common drivers, libraries, definitions, PCDs and etc. for the
> RISC-V platform development.
> > +
> > +### Download the Source Code ###
> >  ```
> >  git clone https://github.com/tianocore/edk2.git
> > +git clone https://github.com/tianocore/edk2-platforms.git
> >
> > -git clone https://github.com/changab/edk2-platforms.git
> > -# Check out branch: riscv-smode-lib
> >  ```
> >
> > -To build it, you have to follow the regular steps for EDK2 and
> > additionally set -an environmen variable to point to your RISC-V
> > toolchain installation, -including the binary prefixes:
> > -
> > +You have to follow the build steps for EDK2
> > +(https://github.com/tianocore/tianocore.github.io/wiki/Getting-Starte
> > +d-with-EDK-II) and additionally set an environment variable to point
> > +to your RISC-V toolchain binaries for building RISC-V platforms,
> >  ```
> > +# e.g. If the toolchain binaries are under
> > +/riscv-gnu-toolchain-binaries/bin
> >  export
> > GCC5_RISCV64_PREFIX=/riscv-gnu-toolchain-binaries/bin/riscv64-
> unknown-
> > elf-
> >  ```
> 
> Look, I realise you guys aren't building natively yet, but I
> *strongly* recomment that you start seeing that as something normal
> sooner rather than later. There's nothing wrong with describing cross
> compilation as well, and in these early days even point to specific "known
> good" toolchains, but treating it as the only valid way of building feeds
> complacency.
> 
> And even while I *did* push for native-is-normal for arm64 from the earliest
> days, we still get occasional comments about people using some archaologic
> specific linaro build and think the sky will fall on their heads because it's an
> ancient build for i686 and no longer runs on current Linux distros.
> 
> /
>     Leif
> 
> >
> > -Then you can build the image for the SiFive HifiveUnleashed platform:
> > +Then you can build the edk2 firmware image for RISC-V platforms.
> >
> >  ```
> > +# e.g. For building SiFive Hifive Unleashed platform:
> >  build -a RISCV64 -t GCC5 -p
> >
> Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
> >  ```
> >
> > -### EDK2 project
> > -All changes in edk2 are upstream, however, most of the RISC-V code is
> > in -edk2-platforms. Therefore you have to check out the branch
> > `riscv-smode-lib` on -`github.com/changab/edk2-platforms`.
> > -
> > -The build architecture which is supported and verified so far is `RISCV64`.
> > -The latest master of the RISC-V toolchain
> > https://github.com/riscv/riscv-gnu-toolchain
> > -should work but the latest verified commit is
> `b468107e701433e1caca3dbc8aef8d40`.
> > -Toolchain tag is "GCC5" declared in `tools_def.txt`
> > +## RISC-V OpenSBI Library
> > +RISC-V [OpenSBI](https://github.com/riscv/opensbi) is the
> > +implementation of [RISC-V SBI (Supervisor Binary Interface)
> specification](https://github.com/riscv/riscv-sbi-doc). For EDK2 UEFI
> firmware solution, RISC-V OpenSBI is integrated as a library
> [(submoudule)](Silicon/RISC-
> V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) in EDK2 RISC-V Processor
> Package. The RISC-V OpenSBI library is built in SEC driver without any
> modifications and provides the interfaces for supervisor mode execution
> environment to execute privileged operations.
> >
> >  ## RISC-V Platform PCD settings
> >  ### EDK2 Firmware Volume Settings
> > @@ -54,9 +53,9 @@ EDK2 Firmware volume related PCDs which declared in
> platform FDF file.
> >  |PcdRiscVSecFvBase| The base address of SEC Firmware Volume|
> > |PcdRiscVSecFvSize| The size of SEC Firmware Volume|
> > |PcdRiscVPeiFvBase| The base address of PEI Firmware Volume|
> > -|PcdRiscVPeiFvSize| The size of SEC Firmware Volume|
> > +|PcdRiscVPeiFvSize| The size of PEI Firmware Volume|
> >  |PcdRiscVDxeFvBase| The base address of DXE Firmware Volume|
> > -|PcdRiscVDxeFvSize| The size of SEC Firmware Volume|
> > +|PcdRiscVDxeFvSize| The size of DXE Firmware Volume|
> >
> >  ### EDK2 EFI Variable Region Settings  The PCD settings regard to EFI
> > Variable @@ -84,21 +83,24 @@ Below PCDs could be set in platform FDF
> > file.
> >  |--------------|---------|
> >  |PcdHartCount| Number of RISC-V HARTs, the value is
> > processor-implementation specific|  |PcdBootHartId| The ID of RISC-V
> > HART to execute main fimrware code and boot system to OS|
> > +|PcdBootableHartNumber|The bootable HART number, which is
> incorporate
> > +|PcdBootableHartNumber|with RISC-V OpenSBI platform hart_index2id
> > +|PcdBootableHartNumber|value|
> >
> >  ### RISC-V OpenSBI Settings
> >
> >  | **PCD name** |**Usage**|
> >  |--------------|---------|
> > -|PcdScratchRamBase| The base address of OpenSBI scratch buffer for
> > -|PcdScratchRamBase| all RISC-V HARTs|
> > -|PcdScratchRamSize| The total size of OpenSBI scratch buffer for all
> > -|PcdScratchRamSize| RISC-V HARTs|
> > -|PcdOpenSbiStackSize| The size of initial stack of each RISC-V HART
> > -|PcdOpenSbiStackSize| for booting system use OpenSBI|
> > +|PcdScratchRamBase| The base address of RISC-V OpenSBI scratch buffer
> > +|PcdScratchRamBase| for all RISC-V HARTs|
> > +|PcdScratchRamSize| The total size of RISC-V OpenSBI scratch buffer
> > +|PcdScratchRamSize| for all RISC-V HARTs|
> > +|PcdOpenSbiStackSize| The size of initial stack of each RISC-V HART
> > +|PcdOpenSbiStackSize| for booting system use RISC-V OpenSBI|
> >  |PcdTemporaryRamBase| The base address of temporary memory for PEI
> > phase|  |PcdTemporaryRamSize| The temporary memory size for PEI
> phase|
> > +|PcdPeiCorePrivilegeMode|The target RISC-V privilege mode for edk2
> > +|PcdPeiCorePrivilegeMode|PEI phase|
> >
> >  ## Supported Operating Systems
> > -Only support to boot to EFI Shell so far.
> > -
> > -Porting GRUB2 and Linux EFISTUB is in progress.
> > +Currently support boot to EFI Shell and Linux kernel.
> > +Refer to below link for more information,
> > +https://github.com/riscv/riscv-uefi-edk2-docs
> >
> >  ## Known Issues and Limitations
> > -Only RISC-V RV64 is verified.
> > +Only RISC-V RV64 is verified on edk2.
> > +
> > --
> > 2.25.0
> >
> >
> > 
> >

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

* Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md
  2020-08-27 14:54       ` Daniel Schaefer
@ 2020-08-27 16:37         ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2020-08-27 16:37 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: leif@nuviainc.com, Michael D Kinney

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

I resent the patches v2  with your comments addressed.

One response to your comment is in below,

From: Schaefer, Daniel
Sent: Thursday, August 27, 2020 10:55 PM
To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; devel@edk2.groups.io
Cc: leif@nuviainc.com; Michael D Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md

I still put a review below, by the way 😉
________________________________
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com<mailto:abner.chang@hpe.com>>
Sent: Thursday, August 27, 2020 22:06
To: Schaefer, Daniel <daniel.schaefer@hpe.com<mailto:daniel.schaefer@hpe.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
Cc: leif@nuviainc.com<mailto:leif@nuviainc.com> <leif@nuviainc.com<mailto:leif@nuviainc.com>>; Michael D Kinney <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>
Subject: RE: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise Readme.md

Sorry, I didn't send patch to edk2-platform for a while, let me resend the whole set.

Yes, I missed Mike and Leif...

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Thursday, August 27, 2020 9:44 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com<mailto:abner.chang@hpe.com>>;
> devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: leif@nuviainc.com<mailto:leif@nuviainc.com>; Michael D Kinney <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>
> Subject: Re: [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: Revise
> Readme.md
>
> Oops, you didn't send this to Leif and Mike?
>
> On 8/27/20 2:03 PM, Abner Chang wrote:
> > Update RISC-V U5SeriesPkg Readme.md to align with the latest
> implementation.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com<mailto:abner.chang@hpe.com>>
> > Co-authored-by: Daniel Schaefer <daniel.schaefer@hpe.com<mailto:daniel.schaefer@hpe.com>>
> >
> > Cc: Daniel Schaefer <daniel.schaefer@hpe.com<mailto:daniel.schaefer@hpe.com>>
> > ---
> >   Platform/SiFive/U5SeriesPkg/Readme.md | 112 +++++++++++++-----------
> --
> >   1 file changed, 58 insertions(+), 54 deletions(-)
> >
> > diff --git a/Platform/SiFive/U5SeriesPkg/Readme.md
> > b/Platform/SiFive/U5SeriesPkg/Readme.md
> > index 4d293e54f6..4d404efec4 100644
> > --- a/Platform/SiFive/U5SeriesPkg/Readme.md
> > +++ b/Platform/SiFive/U5SeriesPkg/Readme.md
> > @@ -1,61 +1,59 @@
> > -# Introduction
> > -U5SeriesPkg provides the common EFI library and driver modules for
> > SiFive
> > -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-riscvplatforms branch)
> > -- **RiscVPlatformPkg**, edk2 master branch
> > -  (Currently is in edk2-staging/RISC-V-V2 branch)
> > -- **RiscVPkg**, edk2 master branch
> > -  (Currently is in edk2-staging/RISC-V-V2 branch)
> > +# Introduction of SiFive U5 Series Platforms U5SeriesPkg provides the
> > +common EDK2 libraries and drivers for SiFive U5 series platforms.
> > +Currently the supported platforms are Freedom U500 VC707 platform and
> Freedom U540 HiFive Unleashed platform.
> > +
> > +Both platforms are built with below common edk2 packages under
> > +edk2-platforms repository,
> > +-
> > +[**U5SeriesPkg**](https://github.com/tianocore/edk2-
> platforms/tree/ma
> > +ster/Platform/SiFive/U5SeriesPkg)
> > +-
> > +[**RiscVPlatformPkg**](https://github.com/tianocore/edk2-platforms/tr
> > +ee/master/Platform/RISC-V/PlatformPkg)
> > +-
> > +[**RiscVProcessorPkg**](https://github.com/tianocore/edk2-
> platforms/t
> > +ree/master/Silicon/RISC-V/ProcessorPkg)
> >
> >   ## U500 Platform
> > -This is a sample RISC-V EDK2 platform package used agaist SiFive
> > Freedom U500
>
> I don't think we need to say "RISC-V EDK2" so often.
>
> > +This is a sample RISC-V EDK2 platform package used against to SiFive
> > +Freedom U500
>
> - RISC-V EDK2
>
> >   VC707 FPGA Dev Kit, please refer to "SiFive Freedom U500 VC707 FPGA
> Getting
> >   Started Guide" on https://www.sifive.com/documentation.
> > +The binary built from
> Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board can run on U500
> VC707 FPGA board.
> > +```
> > +build -a RISCV64 -t GCC5 -p
> > +Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
> > +```
> >
> >   ## U540 Platform
> > -This is a sample RISC-V EDK2 platform package used against SiFive
> > Freedom U540
>
> - RISC-V EDK2
>
> > -HiFive Unleashed development board, please refer to "SiFive Freedom
> > U540-C000 -Manual" on https://www.sifive.com.
> > -The binary built from
> > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/
> > -can run on main stream
> > [QEMU](https://git.qemu.org/?p=qemu.git;a=summary)
> > -using qemu-system-riscv64 under riscv64-softmmu. Launch the binary
> > with
> > +This is a sample RISC-V EDK2 platform package used for the SiFive
> Freedom U540 HiFive Unleashed development board, please refer to "SiFive
> Freedom U540-C000 Manual" on https://www.sifive.com.
>
> - RISC-V EDK2
>
> > +The binary built from
> > +Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/ can
> run on both hardware and
> [QEMU](https://git.qemu.org/?p=qemu.git;a=summary). It is confirmed that
> version 5.0 of QEMU can boot the firmware.
>
> I think here we should also say: can boot with this firmware to EFI shell and
> Linux userspace.
>
> > +```
> > +build -a RISCV64 -t GCC5 -p
> >
> +Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d
> sc
> > +```
> > +For running U540 edk2 binary on QEMU, use qemu-system-riscv64 under
> > +riscv64-softmmu to launch the binary with below parameters,
> >
> >   ```
> > --cpu sifive-u54 -machine sifive_u
> > +qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd
> > +-m 2048 -nographic -smp cpus=5,maxcpus=5
> >   ```
> >
> > -## Download the sources
> > +## Download the Source Code
> >   ```
> > -git clone https://github.com/tianocore/edk2-staging.git
> > -# Checkout RISC-V-V2 branch
> > +git clone https://github.com/tianocore/edk2.git
> >   git clone https://github.com/tianocore/edk2-platforms.git
>
> Please add --recurse-submodules here to also clone opensbi.
>
> > -# Checkout devel-riscvplatforms branch -git clone
> > https://github.com/tianocore/edk2-non-osi.git
> >   ```
> > -
> > -## Platform Owners
> > -Chang, Abner <abner.chang@hpe.com<mailto:abner.chang@hpe.com>>
> > -Chen, Gilbert <gilbert.chen@hpe.com<mailto:gilbert.chen@hpe.com>>
> > +Refer to [Readme.md](https://github.com/tianocore/edk2-
> platforms/blob/master/Platform/RISC-V/PlatformPkg/Readme.md) for
> building RISC-V platforms.
> >
> >   ## Platform Status
> > -Currently the binary built from U500Pkg can boot SiFive Freedom U500
> > VC707
> > +**FreedomU500VC707Board**
> > +Currently the binary built from U500 edk2 package can boot SiFive
> > +Freedom U500 VC707
> >   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/U5SeriesPkg/FreedomU500VC707Board/U500.dsc`
> > +**FreedomU540HiFiveUnleashedBoard**
> > +Currently the binary built from U540 edk2 package can boot SiFive
> > +Freedom U540 HiFive Unleashed to EFI shell with console in/out enabled
> and Linux kernel. Please refer to https://github.com/riscv/riscv-uefi-edk2-
> docs for booting to Linux kernel.
> >
> >   ## Supported Operating Systems
> > -Only support to boot to EFI Shell so far.
> > +Please refer to https://github.com/riscv/riscv-uefi-edk2-docs.
> >
> >   ## Known Issues and Limitations
> >   Only RISC-V RV64 is verified on this platform.
> >
> >   ## Related Materials
> > +- [RISC-V UEFI
> > +Documents](https://github.com/riscv/riscv-uefi-edk2-docs)
> >   - [RISC-V OpenSbi](https://github.com/riscv/opensbi)
> >   - [SiFive U500 VC707 FPGA Getting Started
> Guide](https://sifive.cdn.prismic.io/sifive%2Fc248fabc-5e44-4412-b1c3-
> 6bb6aac73a2c_sifive-u500-vc707-gettingstarted-v0.2.pdf)
> >   - [SiFive Freedom U540-C000
> > Manual](https://sifive.cdn.prismic.io/sifive%2F834354f0-08e6-423c-bf1f
> > -0cb58ef14061_fu540-c000-v1.0.pdf)
> > @@ -63,48 +61,54 @@ Only RISC-V RV64 is verified on this platform.
> >
> >   ## U5SeriesPkg Libraries and Drivers
> >   ### PeiCoreInfoHobLib
> > -This is the library to create RISC-V core characteristics for
> > building up -RISC-V related SMBIOS records to support the unified boot
> loader and OS image.
> > +This is the library to create RISC-V core characteristics for
> > +building up RISC-V related SMBIOS records to support the single boot
> > +loader image or OS image on the RISC-V variants
>
> Hey! That's not what we discussed ;) What about:
>
> a single boot loader and OS image for all RISC-V platforms by discovering
> RISC-V hart configurations dynamically.
>
> >   This library leverage the silicon libraries provided in Silicon/SiFive.
> >
> >   ### RiscVPlatformTimerLib
> > -This is common U5 series platform timer library which has the
> > -platform-specific timer implementation.
> > +This is common U5 series platform timer library which has the platform-
> specific timer implementation.
> > +
> > +### SerialLib
> > +This is common U5 series platform serial port library.
> >
> >   ### TimerDxe
> > -This is U5 series platform timer DXE driver whcih has the
> > platform-specific -timer implementation.
> > +This is common U5 series platform timer DXE driver which has the
> platform-specific timer implementation.
> >
> >   ## U500 Platform Libraries and Drivers
> >   ### RiscVOpensbiPlatformLib
> > -In order to reduce the dependencies with RISC-V OpenSBI project
> > -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > process, the -implementation of RISC-V EDK2 platform is leveraging
> > platform source code from
> > +In order to reduce the dependencies with RISC-V OpenSBI project
> > +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > +process, the implementation of RISC-V EDK2 platform is leveraging
> > +platform source code from
> >   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.
> > +[RISC-V OpenSBI code
> > +tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and
> built based on edk2 build environment.
> >
> >   ### PlatformPei
> > -This is the platform-implementation specific library which is
> > executed in early -PEI phase for U500 platform initialization.
> > +This is the platform-implementation specific library which is
> > +executed in early PEI phase for U500 platform initialization.
> >
> >   ## U540 Platform Libraries and Drivers
> >   ### RiscVOpensbiPlatformLib
> > -In order to reduce the dependencies with RISC-V OpenSBI project
> > -(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > process, the -implementation of RISC-V EDK2 platform is leveraging
> > platform source code from
> > +In order to reduce the dependencies with RISC-V OpenSBI project
> > +(https://github.com/riscv/opensbi) and fewer burdens to EDK2 build
> > +process,
>
> Hm, we are depending on OpenSBI. You can say to avoid duplicating code we
> use it.
[Chang, Abner] Above is addressed, but below two lines look  more like the design architecture which I think we can mention this in riscv-uefi-doc repo under RISC-V GitHub.

> But we're switching to S-Mode very soon to avoid calling many internal
> OpenSBI functions and instead calling the standardized SBI interface.
>
> > the implementation of RISC-V EDK2 platform is leveraging platform source
> code from
> >   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.
> > +[RISC-V OpenSBI code
> > +tree](Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi) and
> built based on edk2 build environment.
> >
> >   ### PlatformPei
> > -This is the platform-implementation specific library which is
> > executed in early -PEI phase for U540 platform initialization.
> > +This is the platform-implementation specific library which is
> > +executed in early PEI phase for U540 platform initialization.
> >
> >   ## U5SeriesPkg Platform PCD settings
> >
> >   | **PCD name** |**Usage**|
> >   |----------------|----------|
> > +|PcdU5PlatformSystemClock| U5 series platform system clock|
> >   |PcdNumberofU5Cores| Number of U5 core enabled on U5 series
> platform|
> >   |PcdE5MCSupported| Indicates whether the Monitor Core (E5) is
> supported on U5 series platform|
> >   |PcdU5UartBase|Platform serial port base address|
> > +
> > +
> > +## Platform Owners
> > +Chang, Abner <abner.chang@hpe.com<mailto:abner.chang@hpe.com>>
> > +Chen, Gilbert <gilbert.chen@hpe.com<mailto:gilbert.chen@hpe.com>>
> > +Schaefer, Daniel <daniel.schaefer@hpe.com<mailto:daniel.schaefer@hpe.com>>
> > \ No newline at end of file
> >

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

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

end of thread, other threads:[~2020-08-27 16:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-27 12:03 [edk2-plaforms PATCH 0/3] Revise Readme for RISC-V updates Abner Chang
2020-08-27 12:03 ` [edk2-plaforms PATCH 1/3] edk2-platforms: Revise Readme.md Abner Chang
2020-08-27 13:01   ` Leif Lindholm
2020-08-27 13:14     ` Abner Chang
2020-08-27 12:03 ` [edk2-plaforms PATCH 2/3] RISC-V/PlatformPkg: " Abner Chang
2020-08-27 13:23   ` [edk2-devel] " Leif Lindholm
2020-08-27 16:33     ` Abner Chang
2020-08-27 12:03 ` [edk2-plaforms PATCH 3/3] Platform/U5SeriesPkg: " Abner Chang
2020-08-27 13:24   ` [edk2-devel] " Leif Lindholm
2020-08-27 13:43   ` Daniel Schaefer
2020-08-27 14:06     ` Abner Chang
2020-08-27 14:54       ` Daniel Schaefer
2020-08-27 16:37         ` Abner Chang

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