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

risc-v/k230: initial Asymmetric Multi-Processing support #11673

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

yf13
Copy link
Contributor

@yf13 yf13 commented Feb 8, 2024

Summary

K230 chip has two T-Head C908 RiscV cores, previously we run NuttX either on little or big cores. This patch runs NuttX on both cores with OpenAMP support via the RPTUN driver and the Svpbmt extension of T-Head C908.

New additions:

  • in arch/risc-v/src/k230

    • k230_rptun.c K230 RPTUN driver
    • k230_rptun.h K230 RPTUN driver header file
  • in boards/risc-v/k230/canmv230

    • configs/master Build config for master node
    • configs/remote Build config for remote node
    • scripts/ld-rptun.script Build script for RPTUN

Major changes:

  • arch/risc-v/Kconfig Select NUTTSBI_LATE_INIT upon NUTTSBI
  • in arch/risc-v/include
    • k230/irq.h Add UART3 IRQ defs
  • in arch/risc-v/src/k230
    • Kconfig Add RPTUN related config items
    • Make.defs Add k230-rptun.c to sources
    • hardware/k230_memorymap.h Add K230 device and CSR defs
    • k230_hart.c Add hart ctrl for RPTUN
    • k230_hart.h Add hart ctrl for RPTUN
    • k230_mm_init.c Add Svpmbt to support RPTUN
    • k230_start.c Revised to support RPMsg UART
  • in boards/risc-v/k230/canmv230
    • scripts/Make.defs Add RPTUN script selection
    • src/canmv_init.c Add RPTUN and RPMsg_UART initialization
  • in Documentation/platforms/risc-v/k230/boards/canmv230/
    • index.rst Add AMP usage info.

Impact

CanMV230 device

Testing

Checked with CanMV230 device:

## Starting application at 0x08000000 ...
ABCk230_rptun_init: 
cleared 224 @ 0x80200000
rp_get_resource: shmem:0x80200000, dev:0x8082360
rp_set_callback: 0x801dc5a, arg:0x808edb0

NuttShell (NSH) NuttX-12.4.0-RC0
master> cu

NuttShell (NSH) NuttX-12.4.0-RC0
remote> df -h
  Filesystem      Size      Used  Available Mounted on
  procfs            0B        0B         0B /proc
  romfs            72K       72K         0B /system/bin
remote> ~master> 
master> df -h
  Filesystem      Size      Used  Available Mounted on
  procfs            0B        0B         0B /proc
  romfs           171K      171K         0B /system/bin
master>

Thanks

yf13 added a commit to yf13/nuttx that referenced this pull request Feb 8, 2024
rpmsg_ping.c is blocking CI checks for RPTUN related patches like apache#11673.
this patch simply fix the compilation issue of rpmsg_ping.c:

- line 191: overflow conversion from "long unsigned int" to "unsigned int"
- line 226: "sendlen" used uninitialized

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
acassis pushed a commit that referenced this pull request Feb 8, 2024
rpmsg_ping.c is blocking CI checks for RPTUN related patches like #11673.
this patch simply fix the compilation issue of rpmsg_ping.c:

- line 191: overflow conversion from "long unsigned int" to "unsigned int"
- line 226: "sendlen" used uninitialized

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
@acassis
Copy link
Contributor

acassis commented Feb 9, 2024

@yf13 suggestion: please extent this Testing and create an entry at https://nuttx.apache.org/docs/latest/platforms/risc-v/k230/boards/canmv230/index.html explain how to use it. So more people could test it easily and also it will avoid another hidden feature.

@yf13
Copy link
Contributor Author

yf13 commented Feb 10, 2024

@acassis thanks for reminding, the doc has been updated and passed documentation checks.
However, it seems that linux/sim-01 is broken due to "lighting-app'? Please let me know if there is anything I can do.

@xiaoxiang781216
Copy link
Contributor

@acassis thanks for reminding, the doc has been updated and passed documentation checks. However, it seems that linux/sim-01 is broken due to "lighting-app'? Please let me know if there is anything I can do.

@zhhyu7 look like matter ci break.

boards/risc-v/k230/canmv230/src/canmv_init.c Outdated Show resolved Hide resolved
arch/risc-v/src/k230/k230_rptun.c Show resolved Hide resolved
arch/risc-v/src/k230/k230_rptun.c Show resolved Hide resolved
arch/risc-v/src/k230/k230_rptun.c Show resolved Hide resolved
arch/risc-v/src/k230/k230_rptun.c Show resolved Hide resolved
arch/risc-v/src/k230/k230_rptun.c Show resolved Hide resolved
arch/risc-v/src/k230/k230_rptun.h Outdated Show resolved Hide resolved
@xiaoxiang781216
Copy link
Contributor

@yf13 please reference this patch #11409.

K230 chip has two T-Head C908 RiscV cores, previously we run NuttX
on either little or big cores. This patch runs NuttX on both cores
with OpenAMP support via the RPTUN driver.

New additions:

- in arch/risc-v/src/k230
  - k230_rptun.c              K230 RPTUN driver
  - k230_rptun.h              K230 RPTUN driver header file

- in baords/risc-v/k230/canmv230
  - configs/master            Build config for master node
  - configs/remote            Build config for remote node
  - scripts/ld-rptun.script   Build script for RPTUN

Major changes:

- arch/risc-v/Kconfig         Select NUTTSBI_LATE_INIT upon NUTTSBI
- in arch/risc-v/include
  - k230/irq.h                Add UART3 IRQ defs
- in arch/risc-v/src/k230
  - Kconfig                   Add RPTUN related config items
  - Make.defs                 Add k230-rptun.c to sources
  - hardware/k230_memorymap.h Add K230 device and CSR defs
  - k230_hart.c               Add hart ctrl for RPTUN
  - k230_hart.h               Add hart ctrl for RPTUN
  - k230_mm_init.c            Add Svpmbt to support RPTUN
  - k230_start.c              Revised to support RPMsg UART
- in boards/risc-v/k230/canmv230
  - scripts/Make.defs         Add RPTUN script selection
  - src/canmv_init.c          Add RPTUN and RPMsg_UART initialization
- in Documentation/platforms/risc-v/k230/boards/canmv230
  - index.rst                 Add AMP usage information.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
@yf13
Copy link
Contributor Author

yf13 commented Feb 11, 2024

@xiaoxiang781216 and @acassis it seems that Mac(sim-01) is blocking CI checks now:

 Error: /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h:59:44: error: expected ';' after top level declarator

@acassis acassis merged commit a4b22fe into apache:master Feb 13, 2024
27 checks passed
halyssonJr pushed a commit to halyssonJr/nuttx that referenced this pull request Apr 10, 2024
rpmsg_ping.c is blocking CI checks for RPTUN related patches like apache#11673.
this patch simply fix the compilation issue of rpmsg_ping.c:

- line 191: overflow conversion from "long unsigned int" to "unsigned int"
- line 226: "sendlen" used uninitialized

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
anchao pushed a commit to anchao/nuttx that referenced this pull request Sep 6, 2024
rpmsg_ping.c is blocking CI checks for RPTUN related patches like apache#11673.
this patch simply fix the compilation issue of rpmsg_ping.c:

- line 191: overflow conversion from "long unsigned int" to "unsigned int"
- line 226: "sendlen" used uninitialized

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants