1/*
2 * Copyright (c) 2022, Rtone.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7
8#include <gigadevice/gd32f4xx/gd32f450xk.dtsi>
9#include "gd32f450z_eval-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "GigaDevice GD32F450Z-EVAL";
14	compatible = "gd,gd32f450z-eval";
15
16	chosen {
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19		zephyr,console = &usart0;
20		zephyr,shell-uart = &usart0;
21		zephyr,flash-controller = &fmc;
22	};
23
24	leds {
25		compatible = "gpio-leds";
26		led1: led1 {
27			gpios = <&gpiod 4 GPIO_ACTIVE_HIGH>;
28			label = "LED1";
29		};
30		led2: led2 {
31			gpios = <&gpiod 5 GPIO_ACTIVE_HIGH>;
32			label = "LED2";
33		};
34		led3: led3 {
35			gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>;
36			label = "LED3";
37		};
38	};
39
40	gpio_keys {
41		compatible = "gpio-keys";
42		wakeup_key: wakeup_key {
43			label = "WAKEUP_KEY";
44			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
45			zephyr,code = <INPUT_KEY_WAKEUP>;
46		};
47		tamper_key: tamper_key {
48			label = "TAMPER_KEY";
49			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
50			zephyr,code = <INPUT_KEY_0>;
51		};
52		user_key: user_key {
53			label = "USER_KEY";
54			gpios = <&gpiob 14 GPIO_ACTIVE_LOW>;
55			zephyr,code = <INPUT_KEY_1>;
56		};
57	};
58
59	pwmleds {
60		compatible = "pwm-leds";
61
62		/* NOTE: bridge TIMER1_CH2 (PB10) and LED1 (PE2) */
63		pwm_led: pwm_led {
64			pwms = <&pwm1 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
65		};
66	};
67
68	aliases {
69		led0 = &led1;
70		led1 = &led2;
71		sw0 = &user_key;
72		pwm-led0 = &pwm_led;
73		eeprom-0 = &eeprom0;
74		spi-flash0 = &nor_flash;
75		watchdog0 = &fwdgt;
76	};
77};
78
79&gpioa {
80	status = "okay";
81};
82
83&gpiob {
84	status = "okay";
85};
86
87&gpioc {
88	status = "okay";
89};
90
91&gpiod {
92	status = "okay";
93};
94
95&gpiog {
96	status = "okay";
97};
98
99&usart0 {
100	status = "okay";
101	current-speed = <115200>;
102	pinctrl-0 = <&usart0_default>;
103	pinctrl-names = "default";
104};
105
106&dac {
107	status = "okay";
108	pinctrl-0 = <&dac_default>;
109	pinctrl-names = "default";
110};
111
112&timer1 {
113	status = "okay";
114
115	pwm1: pwm {
116		status = "okay";
117		pinctrl-0 = <&pwm1_default>;
118		pinctrl-names = "default";
119	};
120};
121
122&i2c0 {
123	status = "okay";
124	pinctrl-0 = <&i2c0_default>;
125	pinctrl-names = "default";
126
127	eeprom0: eeprom@50 {
128		compatible = "atmel,at24";
129		reg = <0x50>;
130		status = "okay";
131		size = <256>;
132		pagesize = <8>;
133		address-width = <8>;
134		timeout = <5>;
135	};
136};
137
138&spi5 {
139	status = "okay";
140	pinctrl-0 = <&spi5_default>;
141	pinctrl-names = "default";
142	cs-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>;
143
144	nor_flash: gd25q16@0 {
145		compatible ="jedec,spi-nor";
146		size = <0x1000000>;
147		reg = <0>;
148		spi-max-frequency = <4000000>;
149		status = "okay";
150		jedec-id = [c8 40 15];
151	};
152};
153
154&fwdgt {
155	status = "okay";
156};
157