|
6 | 6 |
|
7 | 7 | #include <freq.h> |
8 | 8 | #include <mem.h> |
| 9 | +#include <wch/qingke-v2.dtsi> |
9 | 10 | #include <zephyr/dt-bindings/gpio/gpio.h> |
10 | 11 | #include <zephyr/dt-bindings/i2c/i2c.h> |
11 | 12 | #include <zephyr/dt-bindings/clock/ch32v00x-clocks.h> |
12 | 13 |
|
13 | 14 | / { |
14 | | - #address-cells = <1>; |
15 | | - #size-cells = <1>; |
16 | | - |
17 | | - cpus { |
18 | | - #address-cells = <1>; |
19 | | - #size-cells = <0>; |
20 | | - |
21 | | - cpu0: cpu@0 { |
22 | | - device_type = "cpu"; |
23 | | - compatible = "wch,qingke-v2"; |
24 | | - reg = <0>; |
25 | | - clock-frequency = <DT_FREQ_M(48)>; |
26 | | - }; |
27 | | - }; |
28 | | - |
29 | 15 | clocks { |
30 | 16 | clk_hse: clk-hse { |
31 | 17 | #clock-cells = <0>; |
|
55 | 41 | }; |
56 | 42 |
|
57 | 43 | soc { |
58 | | - #address-cells = <1>; |
59 | | - #size-cells = <1>; |
60 | | - compatible = "simple-bus"; |
61 | | - ranges; |
62 | | - |
63 | 44 | sram0: memory@20000000 { |
64 | 45 | compatible = "mmio-sram"; |
65 | | - reg = <0x20000000 0x800>; |
| 46 | + reg = <0x20000000 DT_SIZE_K(2)>; |
66 | 47 | }; |
67 | 48 |
|
68 | 49 | flash: flash-controller@40022000 { |
|
74 | 55 |
|
75 | 56 | flash0: flash@0 { |
76 | 57 | compatible = "soc-nv-flash"; |
77 | | - reg = <0 0x4000>; |
| 58 | + reg = <0 DT_SIZE_K(16)>; |
78 | 59 | }; |
79 | 60 | }; |
80 | 61 |
|
81 | | - pfic: interrupt-controller@e000e000 { |
82 | | - compatible = "wch,pfic"; |
83 | | - #address-cells = <0>; |
84 | | - #interrupt-cells = <1>; |
85 | | - interrupt-controller; |
86 | | - reg = <0xe000e000 16>; |
87 | | - status = "okay"; |
88 | | - }; |
89 | | - |
90 | | - systick: systimer@e000f000 { |
91 | | - compatible = "wch,systick"; |
92 | | - reg = <0xe000f000 16>; |
93 | | - status = "okay"; |
94 | | - interrupt-parent = <&pfic>; |
95 | | - interrupts = <12>; |
96 | | - }; |
97 | | - |
98 | 62 | pwr: pwr@40007000 { |
99 | 63 | compatible = "wch,pwr"; |
100 | | - reg = <0x40007000 16>; |
| 64 | + reg = <0x40007000 0x10>; |
101 | 65 | }; |
102 | 66 |
|
103 | 67 | pinctrl: pin-controller@40010000 { |
104 | 68 | compatible = "wch,afio"; |
105 | | - reg = <0x40010000 16>; |
| 69 | + reg = <0x40010000 0x10>; |
106 | 70 | #address-cells = <1>; |
107 | 71 | #size-cells = <1>; |
108 | 72 | status = "okay"; |
109 | 73 |
|
110 | 74 | gpioa: gpio@40010800 { |
111 | 75 | compatible = "wch,gpio"; |
112 | | - reg = <0x40010800 32>; |
| 76 | + reg = <0x40010800 0x20>; |
113 | 77 | gpio-controller; |
114 | 78 | #gpio-cells = <2>; |
115 | 79 | ngpios = <8>; |
| 80 | + gpio-reserved-ranges = <0 1>, <3 5>; |
116 | 81 | clocks = <&rcc CH32V00X_CLOCK_IOPA>; |
117 | 82 | }; |
118 | 83 |
|
119 | 84 | gpioc: gpio@40011000 { |
120 | 85 | compatible = "wch,gpio"; |
121 | | - reg = <0x40011000 32>; |
| 86 | + reg = <0x40011000 0x20>; |
122 | 87 | gpio-controller; |
123 | 88 | #gpio-cells = <2>; |
124 | 89 | ngpios = <8>; |
|
127 | 92 |
|
128 | 93 | gpiod: gpio@40011400 { |
129 | 94 | compatible = "wch,gpio"; |
130 | | - reg = <0x40011400 32>; |
| 95 | + reg = <0x40011400 0x20>; |
131 | 96 | gpio-controller; |
132 | 97 | #gpio-cells = <2>; |
133 | 98 | ngpios = <8>; |
|
137 | 102 |
|
138 | 103 | usart1: uart@40013800 { |
139 | 104 | compatible = "wch,usart"; |
140 | | - reg = <0x40013800 16>; |
| 105 | + reg = <0x40013800 0x10>; |
141 | 106 | clocks = <&rcc CH32V00X_CLOCK_USART1>; |
142 | 107 | interrupt-parent = <&pfic>; |
143 | 108 | interrupts = <32>; |
144 | 109 | }; |
145 | 110 |
|
146 | 111 | rcc: rcc@40021000 { |
147 | 112 | compatible = "wch,rcc"; |
148 | | - reg = <0x40021000 16>; |
| 113 | + reg = <0x40021000 0x10>; |
149 | 114 | #clock-cells = <1>; |
150 | 115 | status = "okay"; |
151 | 116 | }; |
152 | 117 | }; |
153 | 118 | }; |
| 119 | + |
| 120 | +&cpu0 { |
| 121 | + clock-frequency = <DT_FREQ_M(48)>; |
| 122 | +}; |
0 commit comments