1/*
2 * Copyright (c) 2020 Alexander Falb <fal3xx@gmail.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <atmel/samd21.dtsi>
9#include <atmel/samx2xx18.dtsi>
10#include "serpente-pinctrl.dtsi"
11
12/ {
13	model = "Serpente";
14	compatible = "arturo182,serpente";
15
16	chosen {
17		zephyr,console = &sercom2;
18		zephyr,shell-uart = &sercom2;
19		zephyr,sram = &sram0;
20		zephyr,flash = &flash0;
21		zephyr,code-partition = &code_partition;
22	};
23
24	aliases {
25		led0 = &red_led;
26		led1 = &green_led;
27		led2 = &blue_led;
28		red-led = &red_led;
29		green-led = &green_led;
30		blue-led = &blue_led;
31
32		pwm-led0 = &red_pwm_led;
33		pwm-led1 = &green_pwm_led;
34		pwm-led2 = &blue_pwm_led;
35		red-pwm-led = &red_pwm_led;
36		green-pwm-led = &green_pwm_led;
37		blue-pwm-led = &blue_pwm_led;
38	};
39
40	leds {
41		compatible = "gpio-leds";
42		red_led: led_0 {
43			gpios = <&porta 22 GPIO_ACTIVE_LOW>;
44			label = "Red LED";
45		};
46		green_led: led_1 {
47			gpios = <&porta 19 GPIO_ACTIVE_LOW>;
48			label = "Green LED";
49		};
50		blue_led: led_2 {
51			gpios = <&porta 23 GPIO_ACTIVE_LOW>;
52			label = "Blue LED";
53		};
54	};
55
56	pwmleds {
57		compatible = "pwm-leds";
58		red_pwm_led: pwm_led_0 {
59			pwms = <&tcc0 0 PWM_MSEC(20)>;
60			label = "Red PWM LED";
61		};
62		green_pwm_led: pwm_led_1 {
63			pwms = <&tcc0 3 PWM_MSEC(20)>;
64			label = "Green PWM LED";
65		};
66		blue_pwm_led: pwm_led_2 {
67			pwms = <&tcc0 1 PWM_MSEC(20)>;
68			label = "Blue PWM LED";
69		};
70	};
71};
72
73&cpu0 {
74	clock-frequency = <48000000>;
75};
76
77&sercom0 {
78	status = "okay";
79};
80
81&sercom2 {
82	status = "okay";
83	compatible = "atmel,sam0-uart";
84	current-speed = <115200>;
85	rxpo = <1>;
86	txpo = <0>;
87
88	pinctrl-0 = <&sercom2_uart_default>;
89	pinctrl-names = "default";
90};
91
92&sercom3 {
93	status = "okay";
94	compatible = "atmel,sam0-spi";
95	dipo = <1>;
96	dopo = <1>;
97	#address-cells = <1>;
98	#size-cells = <0>;
99
100	pinctrl-0 = <&sercom3_spi_default>;
101	pinctrl-names = "default";
102};
103
104zephyr_udc0: &usb0 {
105	status = "okay";
106
107	pinctrl-0 = <&usb_dc_default>;
108	pinctrl-names = "default";
109};
110
111&tcc0 {
112	status = "okay";
113	compatible = "atmel,sam0-tcc-pwm";
114	prescaler = <4>;
115	#pwm-cells = <2>;
116
117	pinctrl-0 = <&pwm_default>;
118	pinctrl-names = "default";
119};
120
121&flash0 {
122	partitions {
123		compatible = "fixed-partitions";
124		#address-cells = <1>;
125		#size-cells = <1>;
126
127		boot_partition: partition@0 {
128			label = "uf2";
129			reg = <0x00000000 DT_SIZE_K(8)>;
130			read-only;
131		};
132
133		code_partition: partition@2000 {
134			label = "code";
135			reg = <0x2000 DT_SIZE_K(256-8)>;
136			read-only;
137		};
138	};
139};
140