-
Notifications
You must be signed in to change notification settings - Fork 997
riscv: add new kendryte k210 chip #1149
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
d1f82ba
Add new kendryte k210 target definition
c403181
Split RISC-V targets into 32/64-bit
0050a82
Add llvm code model option in target definition
99c777c
Changes according to @aykevl's feedback
0b8a889
cmsis-svd: change submodule url to the TinyGo fork
d2edc3f
maix-bit: add code model in target definition
c407177
maixbit: add board definition and dummy runtime
73cca1f
maixbit (uart): working on data tx
15330e7
riscv: align stack and data sections to 8 bytes
30ca2f4
maixbit (uart): serial is working with echo example
c28e217
riscv: fix offset in 64bit scheduler
c53a80c
maixbit: add chip datasheet link and reformat code
7e6252c
maixbit: remove atomic operations
468dbd9
maixbit: init fpioa clock at reset
89ba7d9
maixbit: support both GPIO and GPIOHS controllers
a66a7ea
maixbit: add GPIOHS pin interrupt support
e13c077
maixbit: add SPI support
c4e5362
maixbit: add I2C support
2d30ea6
maixbit: add smoke test
40b5481
builder: add support for 64-bit RISC-V
0cca6a1
maixbit (i2c): fix rx fifo buffer length
be7ae85
maixbit (gpio): fix pin configuration
fcc79ee
maixbit: workaround to avoid medium code model
35ec8b0
maixbit (interruptions): fix fpioa function test
88be30b
riscv: refactor assembly files to support RV64 and F extension
2be5923
maixbit: use custom linker script
c874cbe
runtime: reuse common code between 32 and 64-bit RISC-V
c0bc2a2
maixbit: changes according to feedback
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Submodule cmsis-svd
updated
4 files
| +5 −0 | data/Kendryte-Community/LICENSE | |
| +8 −0 | data/Kendryte-Community/README.md | |
| +7,718 −0 | data/Kendryte-Community/k210.svd | |
| +1 −1 | data/SiFive-Community/e310x.svd |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| #ifdef __riscv_flen | ||
| #define NREG 48 | ||
| #define LFREG flw | ||
| #define SFREG fsw | ||
| #else | ||
| #define NREG 16 | ||
| #endif | ||
|
|
||
| #if __riscv_xlen==64 | ||
| #define REGSIZE 8 | ||
| #define SREG sd | ||
| #define LREG ld | ||
| #else | ||
| #define REGSIZE 4 | ||
| #define SREG sw | ||
| #define LREG lw | ||
| #endif | ||
|
|
||
| .section .text.handleInterruptASM | ||
| .global handleInterruptASM | ||
| .type handleInterruptASM,@function | ||
| handleInterruptASM: | ||
| // Save and restore all registers, because the hardware only saves/restores | ||
| // the pc. | ||
| // Note: we have to do this in assembly because the "interrupt"="machine" | ||
| // attribute is broken in LLVM: https://bugs.llvm.org/show_bug.cgi?id=42984 | ||
| addi sp, sp, -NREG*REGSIZE | ||
| SREG ra, 0*REGSIZE(sp) | ||
| SREG t0, 1*REGSIZE(sp) | ||
| SREG t1, 2*REGSIZE(sp) | ||
| SREG t2, 3*REGSIZE(sp) | ||
| SREG a0, 4*REGSIZE(sp) | ||
| SREG a1, 5*REGSIZE(sp) | ||
| SREG a2, 6*REGSIZE(sp) | ||
| SREG a3, 7*REGSIZE(sp) | ||
| SREG a4, 8*REGSIZE(sp) | ||
| SREG a5, 9*REGSIZE(sp) | ||
| SREG a6, 10*REGSIZE(sp) | ||
| SREG a7, 11*REGSIZE(sp) | ||
| SREG t3, 12*REGSIZE(sp) | ||
| SREG t4, 13*REGSIZE(sp) | ||
| SREG t5, 14*REGSIZE(sp) | ||
| SREG t6, 15*REGSIZE(sp) | ||
| #ifdef __riscv_flen | ||
| SFREG f0, (0 + 16)*REGSIZE(sp) | ||
| SFREG f1, (1 + 16)*REGSIZE(sp) | ||
| SFREG f2, (2 + 16)*REGSIZE(sp) | ||
| SFREG f3, (3 + 16)*REGSIZE(sp) | ||
| SFREG f4, (4 + 16)*REGSIZE(sp) | ||
| SFREG f5, (5 + 16)*REGSIZE(sp) | ||
| SFREG f6, (6 + 16)*REGSIZE(sp) | ||
| SFREG f7, (7 + 16)*REGSIZE(sp) | ||
| SFREG f8, (8 + 16)*REGSIZE(sp) | ||
| SFREG f9, (9 + 16)*REGSIZE(sp) | ||
| SFREG f10,(10 + 16)*REGSIZE(sp) | ||
| SFREG f11,(11 + 16)*REGSIZE(sp) | ||
| SFREG f12,(12 + 16)*REGSIZE(sp) | ||
| SFREG f13,(13 + 16)*REGSIZE(sp) | ||
| SFREG f14,(14 + 16)*REGSIZE(sp) | ||
| SFREG f15,(15 + 16)*REGSIZE(sp) | ||
| SFREG f16,(16 + 16)*REGSIZE(sp) | ||
| SFREG f17,(17 + 16)*REGSIZE(sp) | ||
| SFREG f18,(18 + 16)*REGSIZE(sp) | ||
| SFREG f19,(19 + 16)*REGSIZE(sp) | ||
| SFREG f20,(20 + 16)*REGSIZE(sp) | ||
| SFREG f21,(21 + 16)*REGSIZE(sp) | ||
| SFREG f22,(22 + 16)*REGSIZE(sp) | ||
| SFREG f23,(23 + 16)*REGSIZE(sp) | ||
| SFREG f24,(24 + 16)*REGSIZE(sp) | ||
| SFREG f25,(25 + 16)*REGSIZE(sp) | ||
| SFREG f26,(26 + 16)*REGSIZE(sp) | ||
| SFREG f27,(27 + 16)*REGSIZE(sp) | ||
| SFREG f28,(28 + 16)*REGSIZE(sp) | ||
| SFREG f29,(29 + 16)*REGSIZE(sp) | ||
| SFREG f30,(30 + 16)*REGSIZE(sp) | ||
| SFREG f31,(31 + 16)*REGSIZE(sp) | ||
| #endif | ||
| call handleInterrupt | ||
| #ifdef __riscv_flen | ||
| LFREG f0, (31 + 16)*REGSIZE(sp) | ||
| LFREG f1, (30 + 16)*REGSIZE(sp) | ||
| LFREG f2, (29 + 16)*REGSIZE(sp) | ||
| LFREG f3, (28 + 16)*REGSIZE(sp) | ||
| LFREG f4, (27 + 16)*REGSIZE(sp) | ||
| LFREG f5, (26 + 16)*REGSIZE(sp) | ||
| LFREG f6, (25 + 16)*REGSIZE(sp) | ||
| LFREG f7, (24 + 16)*REGSIZE(sp) | ||
| LFREG f8, (23 + 16)*REGSIZE(sp) | ||
| LFREG f9, (22 + 16)*REGSIZE(sp) | ||
| LFREG f10,(21 + 16)*REGSIZE(sp) | ||
| LFREG f11,(20 + 16)*REGSIZE(sp) | ||
| LFREG f12,(19 + 16)*REGSIZE(sp) | ||
| LFREG f13,(18 + 16)*REGSIZE(sp) | ||
| LFREG f14,(17 + 16)*REGSIZE(sp) | ||
| LFREG f15,(16 + 16)*REGSIZE(sp) | ||
| LFREG f16,(15 + 16)*REGSIZE(sp) | ||
| LFREG f17,(14 + 16)*REGSIZE(sp) | ||
| LFREG f18,(13 + 16)*REGSIZE(sp) | ||
| LFREG f19,(12 + 16)*REGSIZE(sp) | ||
| LFREG f20,(11 + 16)*REGSIZE(sp) | ||
| LFREG f21,(10 + 16)*REGSIZE(sp) | ||
| LFREG f22,(9 + 16)*REGSIZE(sp) | ||
| LFREG f23,(8 + 16)*REGSIZE(sp) | ||
| LFREG f24,(7 + 16)*REGSIZE(sp) | ||
| LFREG f25,(6 + 16)*REGSIZE(sp) | ||
| LFREG f26,(5 + 16)*REGSIZE(sp) | ||
| LFREG f27,(4 + 16)*REGSIZE(sp) | ||
| LFREG f28,(3 + 16)*REGSIZE(sp) | ||
| LFREG f29,(2 + 16)*REGSIZE(sp) | ||
| LFREG f30,(1 + 16)*REGSIZE(sp) | ||
| LFREG f31,(0 + 16)*REGSIZE(sp) | ||
| #endif | ||
| LREG t6, 15*REGSIZE(sp) | ||
| LREG t5, 14*REGSIZE(sp) | ||
| LREG t4, 13*REGSIZE(sp) | ||
| LREG t3, 12*REGSIZE(sp) | ||
| LREG a7, 11*REGSIZE(sp) | ||
| LREG a6, 10*REGSIZE(sp) | ||
| LREG a5, 9*REGSIZE(sp) | ||
| LREG a4, 8*REGSIZE(sp) | ||
| LREG a3, 7*REGSIZE(sp) | ||
| LREG a2, 6*REGSIZE(sp) | ||
| LREG a1, 5*REGSIZE(sp) | ||
| LREG a0, 4*REGSIZE(sp) | ||
| LREG t2, 3*REGSIZE(sp) | ||
| LREG t1, 2*REGSIZE(sp) | ||
| LREG t0, 1*REGSIZE(sp) | ||
| LREG ra, 0*REGSIZE(sp) | ||
| addi sp, sp, NREG*REGSIZE | ||
| mret |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.