Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: riscv64: Unify the 'c906' and 'virt64' architecture portings #9181

Merged
merged 5 commits into from
Sep 11, 2024

Commits on Sep 2, 2024

  1. Configuration menu
    Copy the full SHA
    3824a4d View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. feat: libcpu/risc-v: unify context on c906, virt64

    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 <[email protected]>
    polarvid committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    d075e71 View commit details
    Browse the repository at this point in the history
  2. feat: libcpu/risc-v: unify mmu related works

    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 <[email protected]>
    polarvid committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    66b6566 View commit details
    Browse the repository at this point in the history
  3. feat: libcpu/risc-v: unify interrupt & IO on rv64

    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 <[email protected]>
    polarvid committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    f9d13eb View commit details
    Browse the repository at this point in the history
  4. feat: libcpu/risc-v: unify low-level bringups

    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 <[email protected]>
    polarvid committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    2a2fa98 View commit details
    Browse the repository at this point in the history