Skip to content

Commit cbb1ae2

Browse files
committed
dts: wch: Enable using whole flash with CH32V208
Enables using the whole flash on CH32V208 Signed-off-by: Camille BAUD <[email protected]>
1 parent e4679e4 commit cbb1ae2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

dts/riscv/wch/ch32v208/ch32v208.dtsi

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
pll: pll {
3838
#clock-cells = <0>;
3939
compatible = "wch,ch32v20x_30x-pll-clock";
40-
mul = <18>;
40+
mul = <15>;
4141
status = "disabled";
4242
};
4343
};
@@ -54,9 +54,9 @@
5454
#address-cells = <1>;
5555
#size-cells = <1>;
5656

57-
flash0: flash@0 {
57+
flash0: flash@8000000 {
5858
compatible = "soc-nv-flash";
59-
reg = <0 DT_SIZE_K(128)>;
59+
reg = <0x08000000 DT_SIZE_K(480)>;
6060
};
6161
};
6262

@@ -153,5 +153,5 @@
153153
};
154154

155155
&cpu0 {
156-
clock-frequency = <DT_FREQ_M(144)>;
156+
clock-frequency = <DT_FREQ_M(120)>;
157157
};

soc/wch/ch32v/qingke_v4c/vector.S

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ GTEXT(__initialize)
1818

1919
SECTION_FUNC(vectors, ivt)
2020
.option norvc
21+
/* Jump to 0x08000008, into the main flash zone where j __start is */
22+
lui x5, 0x8000
23+
jr 0x8(x5)
2124
j __start
2225
.rept CONFIG_VECTOR_TABLE_SIZE
2326
.word _isr_wrapper
2427
.endr
2528

2629
SECTION_FUNC(vectors, __start)
27-
li a0, 3
30+
li a0, 0xf
2831
csrw mtvec, a0
2932
j __initialize

0 commit comments

Comments
 (0)