1/*
2 * Copyright (c) 2018 Henrik Brix Andersen <henrik@brixandersen.dk>
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 "adafruit_feather_m0_lora-pinctrl.dtsi"
11#include "feather_connector.dtsi"
12
13/ {
14	model = "Adafruit Feather M0 LoRa";
15	compatible = "adafruit,feather-m0-lora", "atmel,samd21g18a",
16			"atmel,samd21";
17
18	chosen {
19		zephyr,console = &sercom0;
20		zephyr,shell-uart = &sercom0;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23		zephyr,code-partition = &code_partition;
24	};
25
26	/* These aliases are provided for compatibility with samples */
27	aliases {
28		led0 = &led0;
29		lora0 = &lora;
30	};
31
32	leds {
33		compatible = "gpio-leds";
34		led0: led_0 {
35			gpios = <&porta 17 0>;
36			label = "LED";
37		};
38	};
39};
40
41&cpu0 {
42	clock-frequency = <48000000>;
43};
44
45&sercom0 {
46	status = "okay";
47	compatible = "atmel,sam0-uart";
48	current-speed = <115200>;
49	rxpo = <3>;
50	txpo = <1>;
51
52	pinctrl-0 = <&sercom0_uart_default>;
53	pinctrl-names = "default";
54};
55
56&sercom3 {
57	status = "okay";
58	compatible = "atmel,sam0-i2c";
59	clock-frequency = <I2C_BITRATE_FAST>;
60	#address-cells = <1>;
61	#size-cells = <0>;
62
63	pinctrl-0 = <&sercom3_i2c_default>;
64	pinctrl-names = "default";
65};
66
67&sercom4 {
68	status = "okay";
69	compatible = "atmel,sam0-spi";
70	#address-cells = <1>;
71	#size-cells = <0>;
72	dipo = <0>;
73	dopo = <1>;
74
75	pinctrl-0 = <&sercom4_spi_default>;
76	pinctrl-names = "default";
77
78	cs-gpios = <&porta 6 GPIO_ACTIVE_LOW>;
79	lora: radio@0 {
80		reg = <0>;
81		compatible = "semtech,sx1276";
82		reset-gpios = <&porta 8 GPIO_ACTIVE_LOW>;
83		dio-gpios = <&porta 9 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
84		spi-max-frequency = <10000000>;
85		power-amplifier-output = "pa-boost";
86	};
87};
88
89&flash0 {
90	partitions {
91		compatible = "fixed-partitions";
92		#address-cells = <1>;
93		#size-cells = <1>;
94
95		boot_partition: partition@0 {
96			label = "sam-ba";
97			reg = <0x00000000 DT_SIZE_K(8)>;
98			read-only;
99		};
100
101		code_partition: partition@2000 {
102			label = "code";
103			reg = <0x2000 DT_SIZE_K(232)>;
104			read-only;
105		};
106
107		/*
108		 * The final 16 KiB is reserved for the application.
109		 * Storage partition will be used by FCB/LittleFS/NVS
110		 * if enabled.
111		 */
112		storage_partition: partition@3c000 {
113			label = "storage";
114			reg = <0x0003c000 DT_SIZE_K(16)>;
115		};
116	};
117};
118
119&usb0 {
120	status = "okay";
121
122	pinctrl-0 = <&usb_dc_default>;
123	pinctrl-names = "default";
124};
125