feat: riscv64: Unify the 'c906' and 'virt64' architecture portings#9181
Merged
mysterywolf merged 5 commits intoRT-Thread:masterfrom Sep 11, 2024
Merged
feat: riscv64: Unify the 'c906' and 'virt64' architecture portings#9181mysterywolf merged 5 commits intoRT-Thread:masterfrom
mysterywolf merged 5 commits intoRT-Thread:masterfrom
Conversation
3d9b0f7 to
b48eac7
Compare
b48eac7 to
fd9b8bb
Compare
fd9b8bb to
bbf2b08
Compare
This was referenced Aug 28, 2024
caf56d7 to
e05fdca
Compare
e05fdca to
7ec91b9
Compare
Contributor
Author
|
@heyuanjie87 原来的 milkv 修改我放 https://github.com/polarvid/rt-thread-mirror/tree/TEST/rv-next 分支上面了,你可以基于那个审查一下这个 PR ,感谢。 |
Contributor
周一帮你测试下 |
Changes: - added config for NEW_CTX_SWITCH - used new context on c906 sched switch routine - update _rt_hw_stack_init to fit into NEW_CTX_SWITCH - separated vector ctx from the generic Signed-off-by: Shell <smokewood@qq.com>
These changes are designed to standardize the memory management across 'virt64' and 'c906', ensuring efficient handling of address spaces and page tables. Changes: - Creation of ASID management files (`asid.c`) for both 'c906' and 'virt64' architectures, which is essential for maintaining stability. - Extensive updates to the MMU configuration and handling in `mmu.c` and `mmu.h` files. - Addition of functions to manage ASID allocation and switching of page tables. - For c906, accommodated the early memory setup to the one from virt64. Signed-off-by: Shell <smokewood@qq.com>
This patch aims to unify the two currently separated RISC-V 64-bit architecture ports, 'virt64' and 'c906', into a single generic 'common64' port. The changes include renaming files and updating includes to use a unified 'interrupt.h' header, as well as making adjustments to IO and trap handling to be more consistent between the two architectures. Changes: - Renamed 'rt_interrupt.h' to 'interrupt.h' and updated includes accordingly. - Unified IO register access functions in 'riscv_io.h'. - Added 'opcode.h' for portable assembly support. - Updated 'plic.c' and 'plic.h' to handle interrupts in a unified manner. - Modified 'trap.c' to handle exceptions and interrupts consistently for 'rv64'. Signed-off-by: Shell <smokewood@qq.com>
This patch consolidates the separated architecture-specific code for rv64 (virt64 and c906) under a more unified approach. The changes aim to enhance maintainability and code reuse, reducing duplication between these two architectures while adding small improvements in porting compatibility. Changes: - Modified build scripts (SConscript) for both virt64 and c906 to remove ASID and vector dependencies when not required. - Updated c906's sbi.c and sbi.h to use standard integer types (uint32_t) and include the missing <stdint.h> header. - Unified inline function declaration for `sbi_call` across both c906 and virt64 using `rt_inline`. - Disabled FPU and vector in c906's startup assembly file, aligning it with the virt64 handling. - Corrected syscall handler type definitions in c906 for consistency. Signed-off-by: Shell <smokewood@qq.com>
7ec91b9 to
2a2fa98
Compare
Contributor
|
初步测试成功: BSP:https://github.com/heyuanjie87/bsp-MilkvDuo-xx 测试输出: |
heyuanjie87
approved these changes
Sep 11, 2024
mysterywolf
approved these changes
Sep 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Part of the patch set on #9151
Unify the 'c906' and 'virt64' under RISC-V portings.
你的解决方案是什么 (what is your solution)
See messages on each commit for detailed descriptions.
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up