1/*
2 * Copyright (c) Justin Watson 2017
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6/dts-v1/;
7
8#include <atmel/sam4s16c.dtsi>
9
10/ {
11	model = "Atmel SAM4S Xplained Board with an Atmel SAM4S16C SoC";
12	compatible = "atmel,sam4s_xplained", "atmel,sam4s16c", "atmel,sam4s";
13
14	aliases {
15		i2c-0 = &twi0;
16		i2c-1 = &twi1;
17		led0 = &yellow_led_1;
18		led1 = &yellow_led_2;
19		sw0 = &user_button;
20	};
21
22	chosen {
23		zephyr,console = &uart0;
24		zephyr,shell-uart = &uart0;
25		zephyr,sram = &sram0;
26		zephyr,flash = &flash0;
27	};
28
29	leds {
30		compatible = "gpio-leds";
31		yellow_led_1: led_1 {
32			gpios = <&pioc 10 GPIO_ACTIVE_LOW>;
33			label = "LED 1";
34		};
35		yellow_led_2: led_2 {
36			gpios = <&pioc 17 GPIO_ACTIVE_LOW>;
37			label = "LED 2";
38		};
39	};
40
41	gpio_keys {
42		compatible = "gpio-keys";
43		user_button: button_1 {
44			label = "User Button";
45			gpios = <&pioa 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
46		};
47	};
48
49	xplained1_header: xplained-connector1 {
50		compatible = "atmel-xplained-header";
51		#gpio-cells = <2>;
52		gpio-map-mask = <0xffffffff 0xffffffc0>;
53		gpio-map-pass-thru = <0 0x3f>;		/*           Shared */
54		gpio-map =	<0 0 &pioa  3 0>,	/* TWD0           y */
55				<1 0 &pioa  4 0>,	/* TWCK0          y */
56				<2 0 &piob  2 0>,	/* URXD1            */
57				<3 0 &piob  3 0>,	/* UTXD1            */
58				<4 0 &pioa 31 0>,	/* SPI(CS)          */
59				<5 0 &pioa 13 0>,	/* SPI(MOSI)      y */
60				<6 0 &pioa 12 0>,	/* SPI(MISO)      y */
61				<7 0 &pioa 14 0>;	/* SPI(SCK)       y */
62							/* GND              */
63							/* +3.3V            */
64	};
65
66	xplained2_header: xplained-connector2 {
67		compatible = "atmel-xplained-header";
68		#gpio-cells = <2>;
69		gpio-map-mask = <0xffffffff 0xffffffc0>;
70		gpio-map-pass-thru = <0 0x3f>;		/*           Shared */
71		gpio-map =	<0 0 &pioa 22 0>,	/* GPIO             */
72				<1 0 &pioc 12 0>,	/* GPIO             */
73				<2 0 &piob  0 0>,	/* GPIO             */
74				<3 0 &piob  1 0>,	/* GPIO             */
75				<4 0 &pioa 17 0>,	/* GPIO             */
76				<5 0 &pioa 21 0>,	/* GPIO             */
77				<6 0 &pioc 13 0>,	/* GPIO             */
78				<7 0 &pioc 15 0>;	/* GPIO             */
79							/* GND              */
80							/* +3.3V            */
81	};
82
83	xplained3_header: xplained-connector3 {
84		compatible = "atmel-xplained-header";
85		#gpio-cells = <2>;
86		gpio-map-mask = <0xffffffff 0xffffffc0>;
87		gpio-map-pass-thru = <0 0x3f>;		/*           Shared */
88		gpio-map =	<0 0 &pioa 20 0>,	/* GPIO             */
89				<1 0 &pioa 11 0>,	/* GPIO             */
90				<2 0 &pioa 23 0>,	/* GPIO             */
91				<3 0 &pioa 18 0>,	/* GPIO             */
92				<4 0 &pioa 15 0>,	/* GPIO             */
93				<5 0 &pioa 16 0>,	/* GPIO             */
94				<6 0 &pioa  2 0>,	/* GPIO             */
95				<7 0 &pioc  2 0>;	/* GPIO             */
96							/* GND              */
97							/* +3.3V            */
98	};
99
100	xplained4_header: xplained-connector4 {
101		compatible = "atmel-xplained-header";
102		#gpio-cells = <2>;
103		gpio-map-mask = <0xffffffff 0xffffffc0>;
104		gpio-map-pass-thru = <0 0x3f>;		/*           Shared */
105		gpio-map =	<0 0 &pioa  3 0>,	/* TWD0           y */
106				<1 0 &pioa  4 0>,	/* TWCK0          y */
107				<2 0 &piob  2 0>,	/* URXD1            */
108				<3 0 &piob  3 0>,	/* UTXD1            */
109				<4 0 &pioa 30 0>,	/* SPI(CS)          */
110				<5 0 &pioa 13 0>,	/* SPI(MOSI)      y */
111				<6 0 &pioa 12 0>,	/* SPI(MISO)      y */
112				<7 0 &pioa 14 0>;	/* SPI(SCK)       y */
113							/* GND              */
114							/* +3.3V            */
115	};
116};
117
118&cpu0 {
119	clock-frequency = <120000000>;
120};
121
122&twi0 {
123	status = "okay";
124};
125
126&spi0 {
127	pinctrl-0 = <&pa12a_spi_miso
128		     &pa13a_spi_mosi
129		     &pa14a_spi_spck
130		     &pa31a_spi_npcs1
131		     &pa30b_spi_npcs2>;
132	cs-gpios = <&pioa 31 GPIO_ACTIVE_LOW>,
133		   <&pioa 30 GPIO_ACTIVE_LOW>;
134	status = "okay";
135};
136
137&uart0 {
138	current-speed = <115200>;
139	status = "okay";
140};
141
142&uart1 {
143	current-speed = <115200>;
144	status = "okay";
145};
146
147&wdt {
148	status = "okay";
149};
150
151xplained1_i2c: &twi0 {
152};
153
154xplained1_spi: &spi0 {
155};
156
157xplained1_serial: &uart1 {
158};
159
160xplained4_i2c: &twi0 {
161};
162
163xplained4_spi: &spi0 {
164};
165
166xplained4_serial: &uart1 {
167};
168