You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "lupyuen (via GitHub)" <gi...@apache.org> on 2024/06/16 12:07:24 UTC
[PR] arch/risc-v: Add support for SOPHGO SG2000 SoC (T-Head C906) [nuttx]
lupyuen opened a new pull request, #12506:
URL: https://github.com/apache/nuttx/pull/12506
## Summary
This PR adds support for the SOPHGO SG2000 SoC, based on T-Head C906 64-bit RISC-V Core. This will be used by the upcoming port of NuttX for Milk-V Duo S SBC.
Most of the code was derived from NuttX for Ox64 BL808. [The source files are explained in the articles here](https://github.com/lupyuen/nuttx-sg2000)
### Modified Files in arch/risc-v
`Kconfig`: Added ARCH_CHIP_SG2000 for SG2000 SoC
### New Files in arch/risc-v
`include/sg2000/chip.h`: SG2000 Definitions
`include/sg2000/irq.h`: External Interrupts
`src/sg2000/chip.h`: Interrupt Stack Macro
`src/sg2000/sg2000_allocateheap.c`: Kernel Heap
`src/sg2000/sg2000_head.S`: Linux Header and Boot Code
`src/sg2000/sg2000_irq.c`: Configure Interrupts
`src/sg2000/sg2000_irq_dispatch.c`: Dispatch Interrupts
`src/sg2000/sg2000_memorymap.h`: Memory Map
`src/sg2000/sg2000_mm_init.c`, `sg2000_mm_init.h`: Memory Mgmt
`src/sg2000/sg2000_pgalloc.c`: Page Allocator
`src/sg2000/sg2000_start.c`: Startup Code
`src/sg2000/sg2000_timerisr.c`: Timer Interrupt
`src/sg2000/hardware/sg2000_memorymap.h`: PLIC and UART Base Address
`src/sg2000/hardware/sg2000_plic.h`: PLIC Register Addresses
`src/sg2000/Kconfig`: SG2000 Config
`src/sg2000/Make.defs`: Makefile
## Impact
This PR is needed for the upcoming port of NuttX for Milk-V Duo S SBC.
No impact on existing code, since the BL808 source files are not used by existing code.
## Testing
We tested the SG2000 source files on Milk-V Duo S SBC. NuttX boots correctly to NSH Shell:
- [NuttX Log for Milk-V Duo S SBC](https://gist.github.com/lupyuen/a2ed75590ea9a007b8e5a1b9da47e60f)
- [Milk-V Duo S Source Code](https://github.com/lupyuen2/wip-nuttx/pull/58/files)
```text
Starting kernel ...
ABC
NuttShell (NSH) NuttX-12.4.0
nsh> uname -a
NuttX 12.4.0 f12ad97561 Jun 16 2024 18:51:25 risc-v duos
nsh> free
total used free maxused maxfree nused nfree
Kmem: 2061304 11624 2049680 38208 2042848 34 5
Page: 20971520 647168 20324352 20324352
nsh> ls /dev
/dev:
console
null
ram0
ttyS0
zero
nsh> ps
PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK USED FILLED COMMAND
0 0 0 FIFO Kthread - Ready 0000000000000000 003056 001424 46.5% Idle_Task
1 1 100 RR Kthread - Waiting Semaphore 0000000000000000 001968 000720 36.5% lpwork 0x804022a8 0x804022d0
3 3 100 RR Task - Running 0000000000000000 003008 001520 50.5% /system/bin/init
nsh> hello
Hello, World!!
hello [0:100]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arch/risc-v: Add support for SOPHGO SG2000 SoC (T-Head C906) [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #12506:
URL: https://github.com/apache/nuttx/pull/12506
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org