-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Add board from SCDZ with SOC from wch ch32v307 #90872
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
base: main
Are you sure you want to change the base?
Add board from SCDZ with SOC from wch ch32v307 #90872
Conversation
Is linkale, untested
Hello @SoftwareArchitekt, and thank you very much for your first pull request to the Zephyr project! |
Nice! Some starter comments: could you squash these commits so things like 'revert to the original main.c' go away, and use the Zephyr commit message style? I'll have a look at the contents now... |
@@ -0,0 +1,91 @@ | |||
.. zephyr:board:: ch32v307evt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a link to the board (home page, store link, or similar) and schematic?
Overview | ||
******** | ||
|
||
The `SCDZ`_ CH32V307EVT hardware provides support for QingKe 32-bit RISC-V4F |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How attached are you to the 'evt' part of the name? I ask as WCH make a series that end with evt, but this board is by a different vendor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nzmichaelh yes, I have the 307-Board from wch here too. I use these name with endin evt here, because it is writen in this kind on the pcb. The wch-Board is named CH32V307V-R2-1v1 on the pcb. This (wch 307) I will do after this board is finished.
Overview | ||
******** | ||
|
||
The `SCDZ`_ CH32V307EVT hardware provides support for QingKe 32-bit RISC-V4F |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it was adapted from the other WCH READMEs. These were recently updated to fix some of the wording and style - could you pull in the same changes please?
soc { | ||
sram0: memory@20000000 { | ||
compatible = "mmio-sram"; | ||
reg = <0x20000000 DT_SIZE_K(32)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
32 k or 64 k?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit complex, as it's possible to configure the amount of RAM you need (you can configure part of your ram to be a copy of the flash).
To change this configuration, you need to write some registers in sequence then reset. But, if I recall correctly, minichlink always write these bits so if you flash with minichlink you are kinda stuck in the state with 32 KB.
}; | ||
|
||
&cpu0 { | ||
clock-frequency = <DT_FREQ_M(127)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
127 or 120?
SECTION_FUNC(vectors, ivt) | ||
.option norvc | ||
/* Jump to 0x08000008, into the main flash zone where j __start is */ | ||
//lui x5, 0x8000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop or uncomment the commented block
SECTION_FUNC(vectors, __start) | ||
li a0, 0xf | ||
csrw mtvec, a0 | ||
j __initialize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a blank line at the end of file
I see there are a few files that were renamed. Please drop those changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SoftwareArchitekt - like Michael mentioned, git history needs to be cleaned up a bit.
Maybe
- rebase this branch onto the latest
main
- reset back to main (leaving a number of staged changes
- revert the changes that are unwanted / unneeded
- Create a first commit for the soc changes
- Create a second commit for the board changes
I think that should do it.
@@ -0,0 +1,226 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the packages on the model of the other SoCs
|
||
/dts-v1/; | ||
|
||
#include <wch/ch32v307/ch32v307.dtsi> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use package there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @VynDragon , I don't understand what you mean here. Could you please explain more detailed for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at this PR: #90992, it fixes the same issue
dts/riscv/wch/ch32v307/ch32v307.dtsi
Outdated
reg = <0x40010800 0x20>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
ngpios = <8>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngpios should be 16 (for all the nodes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
squash commits
@SoftwareArchitekt https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History, this commit history is not good for merging, you need to reorganize the whole PR. |
|
Add a board from SCDZ named ch32v307evt
this board has a SOC from wch named ch32v307
inside SOC is a Qinke_v4f Core
There are some diffences to the wch-ch32v307 board, which I will add in the next step: Core Speed, LED, Switches
As it is my first PR for this project, forgive me if I had made mistakes