[edk2-devel] [PATCH v3 0/8] EDK2 on RISC-V Sophgo SG2042 platform

caiyuqing_hz@163.com posted 8 patches 7 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/cover.1694010673.git.202235273@mail.sdu.edu.cn
There is a newer version of this series
Platform/Sophgo/SG2042_EVB_Board/SG2042.dec   |  19 +
Silicon/Sophgo/SG2042Pkg/SG2042Pkg.dec        |  35 +
Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc   | 548 +++++++++++
Platform/Sophgo/SG2042_EVB_Board/SG2042.fdf   | 248 +++++
.../SG2042Pkg/Drivers/MmcDxe/MmcDxe.inf       |  46 +
.../PlatformUpdateMmuDxe.inf                  |  34 +
.../SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.inf |  47 +
.../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  39 +
Silicon/Sophgo/SG2042Pkg/Sec/SecMain.inf      |  68 ++
Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.h | 513 ++++++++++
.../SG2042Pkg/Drivers/SdHostDxe/SdHci.h       | 309 ++++++
Silicon/Sophgo/SG2042Pkg/Include/MmcHost.h    | 225 +++++
Silicon/Sophgo/SG2042Pkg/Sec/SecMain.h        | 104 ++
.../SG2042Pkg/Drivers/MmcDxe/ComponentName.c  | 156 +++
.../SG2042Pkg/Drivers/MmcDxe/Diagnostics.c    | 323 ++++++
Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.c | 527 ++++++++++
.../SG2042Pkg/Drivers/MmcDxe/MmcBlockIo.c     | 643 ++++++++++++
.../SG2042Pkg/Drivers/MmcDxe/MmcDebug.c       | 194 ++++
.../Drivers/MmcDxe/MmcIdentification.c        | 719 ++++++++++++++
.../PlatformUpdateMmuDxe.c                    | 593 +++++++++++
.../SG2042Pkg/Drivers/SdHostDxe/SdHci.c       | 929 ++++++++++++++++++
.../SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.c   | 450 +++++++++
.../SmbiosPlatformDxe/SmbiosPlatformDxe.c     | 805 +++++++++++++++
Silicon/Sophgo/SG2042Pkg/Sec/Cpu.c            |  29 +
Silicon/Sophgo/SG2042Pkg/Sec/Memory.c         | 347 +++++++
Silicon/Sophgo/SG2042Pkg/Sec/Platform.c       | 130 +++
Silicon/Sophgo/SG2042Pkg/Sec/SecMain.c        | 115 +++
Platform/Sophgo/About_Sophgo_platform.md      |  39 +
.../Documents/Media/EDK2_SDU_Programme.png    | Bin 0 -> 59830 bytes
.../Sophgo/Documents/Media/SG2042_CPU.png     | Bin 0 -> 806062 bytes
.../Documents/Media/Sophgo_SG2042_EVB.png     | Bin 0 -> 1445528 bytes
Platform/Sophgo/Maintainers.md                | 107 ++
Platform/Sophgo/SG2042_EVB_Board/Readme.md    | 100 ++
.../Sophgo/SG2042_EVB_Board/SG2042.fdf.inc    |  62 ++
.../Sophgo/SG2042_EVB_Board/VarStore.fdf.inc  |  77 ++
Silicon/Sophgo/SG2042Pkg/SG2042Pkg.uni        |  13 +
Silicon/Sophgo/SG2042Pkg/SG2042PkgExtra.uni   |  12 +
Silicon/Sophgo/SG2042Pkg/Sec/SecEntry.S       |  18 +
38 files changed, 8623 insertions(+)
create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.dec
create mode 100644 Silicon/Sophgo/SG2042Pkg/SG2042Pkg.dec
create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc
create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.fdf
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcDxe.inf
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/PlatformUpdateMmuDxe/PlatformUpdateMmuDxe.inf
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.inf
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.inf
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.h
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHci.h
create mode 100644 Silicon/Sophgo/SG2042Pkg/Include/MmcHost.h
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.h
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/ComponentName.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Diagnostics.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcBlockIo.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcDebug.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcIdentification.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/PlatformUpdateMmuDxe/PlatformUpdateMmuDxe.c
create mode 100755 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHci.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/Cpu.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/Memory.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/Platform.c
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.c
create mode 100644 Platform/Sophgo/About_Sophgo_platform.md
create mode 100644 Platform/Sophgo/Documents/Media/EDK2_SDU_Programme.png
create mode 100644 Platform/Sophgo/Documents/Media/SG2042_CPU.png
create mode 100644 Platform/Sophgo/Documents/Media/Sophgo_SG2042_EVB.png
create mode 100644 Platform/Sophgo/Maintainers.md
create mode 100644 Platform/Sophgo/SG2042_EVB_Board/Readme.md
create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.fdf.inc
create mode 100644 Platform/Sophgo/SG2042_EVB_Board/VarStore.fdf.inc
create mode 100644 Silicon/Sophgo/SG2042Pkg/SG2042Pkg.uni
create mode 100644 Silicon/Sophgo/SG2042Pkg/SG2042PkgExtra.uni
create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecEntry.S
[edk2-devel] [PATCH v3 0/8] EDK2 on RISC-V Sophgo SG2042 platform
Posted by caiyuqing_hz@163.com 7 months, 3 weeks ago
From: caiyuqing379 <202235273@mail.sdu.edu.cn>

Description:
  Deploy EDK2 to run on 64-core CPU under RISC-V architecture, and successfully boot to OS.
  Implementation can be found on https://github.com/AII-SDU/edk2-platforms/tree/devel-Sophgo/SG2042Pkg/Platform/Sophgo.

Current progress and status:
  1.Adopted the scheme of separating OpenSBI and EDK2. It follows PEI less design.
  2.The startup process is roughly: ZSBL + FSBL + OpenSBI + EDK2 + GRUB + Linux OS.
    The boot medium is SD card, where ZSBL is loaded and executed by an auxiliary MCU, performing initial initialization
    operations such as DIMM initialization. FSBL then continues with further initialization tasks. OpenSBI is used to
    initialize the hardware platform and kernel. Additionally, we have upgraded the OpenSBI from version V0.9 to V1.2 to
    align with community progress. EDK2, running in S-mode, handles configuration operations, primarily completing the
    SD card driver in the DXE stage, while PCIe driver testing and follow-up work are planned. GRUB2 is used to load the
    operating system, facilitating subsequent operations.

Testing:
  1.Test the project on Sophgo SG2042 EVB and be able to launch Linux OS
  2.Test the project on Milk V Pioneer board and is able to boot into the UEFI shell.
    However, the SD card driver could not correctly recognize all partitions and start Linux OS.

Current limitation:
  1.PCIE driver is not currently supported.
  2.MMU support
    SG2042 (Xuantie C920) MMU can be enabled in SV39 mode. Introduce the PCD variable
    PcdForceNoMMU to disable MMU configuration. Currently, enabling MMU results in a
    timeout for reading data blocks from the SD card, So MMU is disabled by default.
  3.Clang toolchain support
    Build the port using the CLANGDWARF toolchain (clang version 18.0.0). It is able
    to build successfully but the compiled binary was not fully work.

Signed-off-by: caiyuqing379 <202235273@mail.sdu.edu.cn>
Co-authored-by: USER0FISH <libing1202@outlook.com>
Cc: dahogn <dahogn@hotmail.com>
Cc: meng-cz <mengcz1126@gmail.com>
Cc: yli147 <yong.li@intel.com>
Cc: ChaiEvan <evan.chai@intel.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>

caiyuqing379 (8):
  Sophgo/SG2042Pkg: Add SmbiosPlatformDxe module.
  Sophgo/SG2042Pkg: Add PlatformUpdateMmuDxe module.
  Sophgo/SG2042Pkg: Add Sophgo SDHCI driver.
  Sophgo/SG2042Pkg: Add base MMC driver.
  Sophgo/SG2042Pkg: Add SEC module.
  Sophgo/SG2042_EVB_Board: Add Sophgo SG2042 platform.
  Sophgo/SG2042Pkg: Add SG2042Pkg.
  Sophgo/SG2042Pkg: Add platform readme and document.

 Platform/Sophgo/SG2042_EVB_Board/SG2042.dec   |  19 +
 Silicon/Sophgo/SG2042Pkg/SG2042Pkg.dec        |  35 +
 Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc   | 548 +++++++++++
 Platform/Sophgo/SG2042_EVB_Board/SG2042.fdf   | 248 +++++
 .../SG2042Pkg/Drivers/MmcDxe/MmcDxe.inf       |  46 +
 .../PlatformUpdateMmuDxe.inf                  |  34 +
 .../SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.inf |  47 +
 .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  39 +
 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.inf      |  68 ++
 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.h | 513 ++++++++++
 .../SG2042Pkg/Drivers/SdHostDxe/SdHci.h       | 309 ++++++
 Silicon/Sophgo/SG2042Pkg/Include/MmcHost.h    | 225 +++++
 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.h        | 104 ++
 .../SG2042Pkg/Drivers/MmcDxe/ComponentName.c  | 156 +++
 .../SG2042Pkg/Drivers/MmcDxe/Diagnostics.c    | 323 ++++++
 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.c | 527 ++++++++++
 .../SG2042Pkg/Drivers/MmcDxe/MmcBlockIo.c     | 643 ++++++++++++
 .../SG2042Pkg/Drivers/MmcDxe/MmcDebug.c       | 194 ++++
 .../Drivers/MmcDxe/MmcIdentification.c        | 719 ++++++++++++++
 .../PlatformUpdateMmuDxe.c                    | 593 +++++++++++
 .../SG2042Pkg/Drivers/SdHostDxe/SdHci.c       | 929 ++++++++++++++++++
 .../SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.c   | 450 +++++++++
 .../SmbiosPlatformDxe/SmbiosPlatformDxe.c     | 805 +++++++++++++++
 Silicon/Sophgo/SG2042Pkg/Sec/Cpu.c            |  29 +
 Silicon/Sophgo/SG2042Pkg/Sec/Memory.c         | 347 +++++++
 Silicon/Sophgo/SG2042Pkg/Sec/Platform.c       | 130 +++
 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.c        | 115 +++
 Platform/Sophgo/About_Sophgo_platform.md      |  39 +
 .../Documents/Media/EDK2_SDU_Programme.png    | Bin 0 -> 59830 bytes
 .../Sophgo/Documents/Media/SG2042_CPU.png     | Bin 0 -> 806062 bytes
 .../Documents/Media/Sophgo_SG2042_EVB.png     | Bin 0 -> 1445528 bytes
 Platform/Sophgo/Maintainers.md                | 107 ++
 Platform/Sophgo/SG2042_EVB_Board/Readme.md    | 100 ++
 .../Sophgo/SG2042_EVB_Board/SG2042.fdf.inc    |  62 ++
 .../Sophgo/SG2042_EVB_Board/VarStore.fdf.inc  |  77 ++
 Silicon/Sophgo/SG2042Pkg/SG2042Pkg.uni        |  13 +
 Silicon/Sophgo/SG2042Pkg/SG2042PkgExtra.uni   |  12 +
 Silicon/Sophgo/SG2042Pkg/Sec/SecEntry.S       |  18 +
 38 files changed, 8623 insertions(+)
 create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.dec
 create mode 100644 Silicon/Sophgo/SG2042Pkg/SG2042Pkg.dec
 create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc
 create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.fdf
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcDxe.inf
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/PlatformUpdateMmuDxe/PlatformUpdateMmuDxe.inf
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.inf
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.inf
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.h
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHci.h
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Include/MmcHost.h
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.h
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/ComponentName.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Diagnostics.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/Mmc.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcBlockIo.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcDebug.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/MmcDxe/MmcIdentification.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/PlatformUpdateMmuDxe/PlatformUpdateMmuDxe.c
 create mode 100755 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHci.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SdHostDxe/SdHostDxe.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/Cpu.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/Memory.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/Platform.c
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecMain.c
 create mode 100644 Platform/Sophgo/About_Sophgo_platform.md
 create mode 100644 Platform/Sophgo/Documents/Media/EDK2_SDU_Programme.png
 create mode 100644 Platform/Sophgo/Documents/Media/SG2042_CPU.png
 create mode 100644 Platform/Sophgo/Documents/Media/Sophgo_SG2042_EVB.png
 create mode 100644 Platform/Sophgo/Maintainers.md
 create mode 100644 Platform/Sophgo/SG2042_EVB_Board/Readme.md
 create mode 100644 Platform/Sophgo/SG2042_EVB_Board/SG2042.fdf.inc
 create mode 100644 Platform/Sophgo/SG2042_EVB_Board/VarStore.fdf.inc
 create mode 100644 Silicon/Sophgo/SG2042Pkg/SG2042Pkg.uni
 create mode 100644 Silicon/Sophgo/SG2042Pkg/SG2042PkgExtra.uni
 create mode 100644 Silicon/Sophgo/SG2042Pkg/Sec/SecEntry.S

--
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108376): https://edk2.groups.io/g/devel/message/108376
Mute This Topic: https://groups.io/mt/101213489/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 0/8] EDK2 on RISC-V Sophgo SG2042 platform
Posted by Sunil V L 7 months, 2 weeks ago
On Thu, Sep 07, 2023 at 06:25:43PM +0800, caiyuqing_hz@163.com wrote:
> From: caiyuqing379 <202235273@mail.sdu.edu.cn>
> 
> Description:
>   Deploy EDK2 to run on 64-core CPU under RISC-V architecture, and successfully boot to OS.
>   Implementation can be found on https://github.com/AII-SDU/edk2-platforms/tree/devel-Sophgo/SG2042Pkg/Platform/Sophgo.
> 
> Current progress and status:
>   1.Adopted the scheme of separating OpenSBI and EDK2. It follows PEI less design.
>   2.The startup process is roughly: ZSBL + FSBL + OpenSBI + EDK2 + GRUB + Linux OS.
>     The boot medium is SD card, where ZSBL is loaded and executed by an auxiliary MCU, performing initial initialization
>     operations such as DIMM initialization. FSBL then continues with further initialization tasks. OpenSBI is used to
>     initialize the hardware platform and kernel. Additionally, we have upgraded the OpenSBI from version V0.9 to V1.2 to
>     align with community progress. EDK2, running in S-mode, handles configuration operations, primarily completing the
>     SD card driver in the DXE stage, while PCIe driver testing and follow-up work are planned. GRUB2 is used to load the
>     operating system, facilitating subsequent operations.
> 
> Testing:
>   1.Test the project on Sophgo SG2042 EVB and be able to launch Linux OS
>   2.Test the project on Milk V Pioneer board and is able to boot into the UEFI shell.
>     However, the SD card driver could not correctly recognize all partitions and start Linux OS.
> 
> Current limitation:
>   1.PCIE driver is not currently supported.
>   2.MMU support
>     SG2042 (Xuantie C920) MMU can be enabled in SV39 mode. Introduce the PCD variable
>     PcdForceNoMMU to disable MMU configuration. Currently, enabling MMU results in a
>     timeout for reading data blocks from the SD card, So MMU is disabled by default.
>   3.Clang toolchain support
>     Build the port using the CLANGDWARF toolchain (clang version 18.0.0). It is able
>     to build successfully but the compiled binary was not fully work.
> 
Please add patch revision history which helps reviewers to understand
what has changed compared to previous version of the series.

> Signed-off-by: caiyuqing379 <202235273@mail.sdu.edu.cn>
> Co-authored-by: USER0FISH <libing1202@outlook.com>
> Cc: dahogn <dahogn@hotmail.com>
> Cc: meng-cz <mengcz1126@gmail.com>
> Cc: yli147 <yong.li@intel.com>
> Cc: ChaiEvan <evan.chai@intel.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> 
As per Maintainers.txt, Leif and Mike are high level maintainers for
edk2-platforms. Please CC both in future.

Thanks,
Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108706): https://edk2.groups.io/g/devel/message/108706
Mute This Topic: https://groups.io/mt/101213489/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-