Skip to content

Commit e953825

Browse files
committed
soc: nuvoton: numaker: add support for m333x series
Add initial support for Nuvoton NuMaker-M333x SoC series, including basic initialization and device tree includes. Signed-off-by: cyliang tw <[email protected]>
1 parent 73ea941 commit e953825

File tree

14 files changed

+835
-1
lines changed

14 files changed

+835
-1
lines changed

dts/arm/nuvoton/m3334kig.dtsi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2025 Nuvoton Technology Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <nuvoton/m333x.dtsi>
9+
10+
/ {
11+
sram0: memory@20000000 {
12+
compatible = "mmio-sram";
13+
reg = <0x20000000 DT_SIZE_K(320)>;
14+
};
15+
16+
soc {
17+
fmc: flash-controller@4000c000 {
18+
flash0: flash@0 {
19+
reg = <0 DT_SIZE_K(512)>;
20+
};
21+
};
22+
};
23+
};

dts/arm/nuvoton/m333x.dtsi

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
/*
2+
* Copyright (c) 2025 Nuvoton Technology Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/armv8-m.dtsi>
8+
#include <mem.h>
9+
#include <freq.h>
10+
#include <zephyr/dt-bindings/clock/numaker_m333x_clock.h>
11+
#include <zephyr/dt-bindings/reset/numaker_m333x_reset.h>
12+
#include <zephyr/dt-bindings/gpio/gpio.h>
13+
14+
/ {
15+
chosen {
16+
zephyr,flash-controller = &fmc;
17+
};
18+
19+
aliases {
20+
rtc = &rtc;
21+
};
22+
23+
cpus {
24+
#address-cells = <1>;
25+
#size-cells = <0>;
26+
27+
cpu@0 {
28+
device_type = "cpu";
29+
compatible = "arm,cortex-m33";
30+
reg = <0>;
31+
};
32+
};
33+
34+
sysclk: system-clock {
35+
compatible = "fixed-clock";
36+
clock-frequency = <DT_FREQ_M(180)>;
37+
#clock-cells = <0>;
38+
};
39+
40+
soc {
41+
scc: system-clock-controller@40000200 {
42+
compatible = "nuvoton,numaker-scc";
43+
reg = <0x40000200 0x100>;
44+
#clock-cells = <0>;
45+
lxt = "enable";
46+
hirc48m = "enable";
47+
clk-pclkdiv = <(NUMAKER_CLK_PCLKDIV_APB0DIV_DIV2 |
48+
NUMAKER_CLK_PCLKDIV_APB1DIV_DIV2)>;
49+
core-clock = <DT_FREQ_M(180)>;
50+
powerdown-mode = <NUMAKER_CLK_PMUCTL_PDMSEL_DPD>;
51+
52+
pcc: peripheral-clock-controller {
53+
compatible = "nuvoton,numaker-pcc";
54+
#clock-cells = <3>;
55+
};
56+
};
57+
58+
rst: reset-controller@40000000 {
59+
compatible = "nuvoton,numaker-rst";
60+
reg = <0x40000000 0x20>;
61+
#reset-cells = <1>;
62+
};
63+
64+
fmc: flash-controller@4000c000 {
65+
compatible = "nuvoton,numaker-fmc";
66+
reg = <0x4000c000 0x1000>;
67+
#address-cells = <1>;
68+
#size-cells = <1>;
69+
70+
flash0: flash@0 {
71+
compatible = "soc-nv-flash";
72+
erase-block-size = <1024>;
73+
write-block-size = <4>;
74+
};
75+
};
76+
77+
uart0: serial@40070000 {
78+
compatible = "nuvoton,numaker-uart";
79+
reg = <0x40070000 0x1000>;
80+
interrupts = <36 0>;
81+
resets = <&rst NUMAKER_UART0_RST>;
82+
clocks = <&pcc NUMAKER_UART0_MODULE NUMAKER_CLK_CLKSEL1_UART0SEL_HIRC
83+
NUMAKER_CLK_CLKDIV0_UART0(1)>;
84+
status = "disabled";
85+
};
86+
87+
uart1: serial@40071000 {
88+
compatible = "nuvoton,numaker-uart";
89+
reg = <0x40071000 0x1000>;
90+
interrupts = <37 0>;
91+
resets = <&rst NUMAKER_UART1_RST>;
92+
clocks = <&pcc NUMAKER_UART1_MODULE NUMAKER_CLK_CLKSEL1_UART1SEL_HIRC
93+
NUMAKER_CLK_CLKDIV0_UART1(1)>;
94+
status = "disabled";
95+
};
96+
97+
uart2: serial@40072000 {
98+
compatible = "nuvoton,numaker-uart";
99+
reg = <0x40072000 0x1000>;
100+
interrupts = <48 0>;
101+
resets = <&rst NUMAKER_UART2_RST>;
102+
clocks = <&pcc NUMAKER_UART2_MODULE NUMAKER_CLK_CLKSEL3_UART2SEL_HIRC
103+
NUMAKER_CLK_CLKDIV1_UART2(1)>;
104+
status = "disabled";
105+
};
106+
107+
uart3: serial@40073000 {
108+
compatible = "nuvoton,numaker-uart";
109+
reg = <0x40073000 0x1000>;
110+
interrupts = <49 0>;
111+
resets = <&rst NUMAKER_UART3_RST>;
112+
clocks = <&pcc NUMAKER_UART3_MODULE NUMAKER_CLK_CLKSEL3_UART3SEL_HIRC
113+
NUMAKER_CLK_CLKDIV1_UART3(1)>;
114+
status = "disabled";
115+
};
116+
117+
uart4: serial@40074000 {
118+
compatible = "nuvoton,numaker-uart";
119+
reg = <0x40074000 0x1000>;
120+
interrupts = <74 0>;
121+
resets = <&rst NUMAKER_UART4_RST>;
122+
clocks = <&pcc NUMAKER_UART4_MODULE NUMAKER_CLK_CLKSEL3_UART4SEL_HIRC
123+
NUMAKER_CLK_CLKDIV1_UART4(1)>;
124+
status = "disabled";
125+
};
126+
127+
pinctrl: pin-controller@40000080 {
128+
compatible = "nuvoton,numaker-pinctrl";
129+
reg = <0x40000080 0x20
130+
0x40000500 0x80>;
131+
reg-names = "mfos", "mfp";
132+
};
133+
134+
gpioa: gpio@40004000 {
135+
compatible = "nuvoton,numaker-gpio";
136+
gpio-controller;
137+
#gpio-cells = <2>;
138+
reg = <0x40004000 0x40>;
139+
clocks = <&pcc NUMAKER_GPA_MODULE 0 0>;
140+
status = "disabled";
141+
interrupts = <16 2>;
142+
};
143+
144+
gpiob: gpio@40004040 {
145+
compatible = "nuvoton,numaker-gpio";
146+
gpio-controller;
147+
#gpio-cells = <2>;
148+
reg = <0x40004040 0x40>;
149+
clocks = <&pcc NUMAKER_GPB_MODULE 0 0>;
150+
status = "disabled";
151+
interrupts = <17 2>;
152+
};
153+
154+
gpioc: gpio@40004080 {
155+
compatible = "nuvoton,numaker-gpio";
156+
gpio-controller;
157+
#gpio-cells = <2>;
158+
reg = <0x40004080 0x40>;
159+
clocks = <&pcc NUMAKER_GPC_MODULE 0 0>;
160+
status = "disabled";
161+
interrupts = <18 2>;
162+
};
163+
164+
gpiod: gpio@400040c0 {
165+
compatible = "nuvoton,numaker-gpio";
166+
gpio-controller;
167+
#gpio-cells = <2>;
168+
reg = <0x400040c0 0x40>;
169+
clocks = <&pcc NUMAKER_GPD_MODULE 0 0>;
170+
status = "disabled";
171+
interrupts = <19 2>;
172+
};
173+
174+
gpioe: gpio@40004100 {
175+
compatible = "nuvoton,numaker-gpio";
176+
gpio-controller;
177+
#gpio-cells = <2>;
178+
reg = <0x40004100 0x40>;
179+
clocks = <&pcc NUMAKER_GPE_MODULE 0 0>;
180+
status = "disabled";
181+
interrupts = <20 2>;
182+
};
183+
184+
gpiof: gpio@40004140 {
185+
compatible = "nuvoton,numaker-gpio";
186+
gpio-controller;
187+
#gpio-cells = <2>;
188+
reg = <0x40004140 0x40>;
189+
clocks = <&pcc NUMAKER_GPF_MODULE 0 0>;
190+
status = "disabled";
191+
interrupts = <21 2>;
192+
};
193+
194+
gpiog: gpio@40004180 {
195+
compatible = "nuvoton,numaker-gpio";
196+
gpio-controller;
197+
#gpio-cells = <2>;
198+
reg = <0x40004180 0x40>;
199+
clocks = <&pcc NUMAKER_GPG_MODULE 0 0>;
200+
status = "disabled";
201+
interrupts = <72 2>;
202+
};
203+
204+
gpioh: gpio@400041c0 {
205+
compatible = "nuvoton,numaker-gpio";
206+
gpio-controller;
207+
#gpio-cells = <2>;
208+
reg = <0x400041c0 0x40>;
209+
clocks = <&pcc NUMAKER_GPH_MODULE 0 0>;
210+
status = "disabled";
211+
interrupts = <88 2>;
212+
};
213+
214+
rtc: rtc@40041000 {
215+
compatible = "nuvoton,numaker-rtc";
216+
reg = <0x40041000 0x138>;
217+
interrupts = <6 0>;
218+
oscillator = "lxt";
219+
clocks = <&pcc NUMAKER_RTC_MODULE 0 0>;
220+
alarms-count = <1>;
221+
};
222+
223+
wwdt: watchdog@40096000 {
224+
compatible = "nuvoton,numaker-wwdt";
225+
reg = <0x40096000 0x10>;
226+
interrupts = <9 0>;
227+
clocks = <&pcc NUMAKER_WWDT0_MODULE NUMAKER_CLK_CLKSEL1_WWDT0SEL_LIRC 0>;
228+
status = "disabled";
229+
};
230+
};
231+
};
232+
233+
&nvic {
234+
arm,num-irq-priority-bits = <3>;
235+
};

0 commit comments

Comments
 (0)