1/*
2 * at91-sama5d2_ptc_ek.dts - Device Tree file for SAMA5D2 PTC EK board
3 *
4 *  Copyright (C) 2017 Microchip Technology Inc,
5 *		       Ludovic Desroches <ludovic.desroches@microchip.com>
6 *
7 * This file is dual-licensed: you can use it either under the terms
8 * of the GPL or the X11 license, at your option. Note that this dual
9 * licensing only applies to this file, and not this project as a
10 * whole.
11 *
12 *  a) This file is free software; you can redistribute it and/or
13 *     modify it under the terms of the GNU General Public License as
14 *     published by the Free Software Foundation; either version 2 of the
15 *     License, or (at your option) any later version.
16 *
17 *     This file is distributed in the hope that it will be useful,
18 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 *     GNU General Public License for more details.
21 *
22 * Or, alternatively,
23 *
24 *  b) Permission is hereby granted, free of charge, to any person
25 *     obtaining a copy of this software and associated documentation
26 *     files (the "Software"), to deal in the Software without
27 *     restriction, including without limitation the rights to use,
28 *     copy, modify, merge, publish, distribute, sublicense, and/or
29 *     sell copies of the Software, and to permit persons to whom the
30 *     Software is furnished to do so, subject to the following
31 *     conditions:
32 *
33 *     The above copyright notice and this permission notice shall be
34 *     included in all copies or substantial portions of the Software.
35 *
36 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43 *     OTHER DEALINGS IN THE SOFTWARE.
44 */
45/dts-v1/;
46#include <dt-bindings/gpio/gpio.h>
47#include "sama5d2.dtsi"
48#include "sama5d2-pinfunc.h"
49
50/ {
51	model = "Atmel SAMA5D2 PTC EK";
52	compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5";
53
54	chosen {
55		u-boot,dm-pre-reloc;
56		stdout-path = &uart0;
57	};
58
59	ahb {
60		usb0: gadget@00300000 {
61			atmel,vbus-gpio = <&pioA PIN_PA27 GPIO_ACTIVE_HIGH>;
62			pinctrl-names = "default";
63			pinctrl-0 = <&pinctrl_usba_vbus>;
64			status = "okay";
65		};
66
67		usb1: ohci@00400000 {
68			num-ports = <3>;
69			atmel,vbus-gpio = <0
70					   &pioA PIN_PB12 GPIO_ACTIVE_HIGH
71					   0
72					  >;
73			pinctrl-names = "default";
74			pinctrl-0 = <&pinctrl_usb_default>;
75			status = "okay";
76		};
77
78		usb2: ehci@00500000 {
79			status = "okay";
80		};
81
82		sdmmc0: sdio-host@a0000000 {
83			bus-width = <8>;
84			pinctrl-names = "default";
85			pinctrl-0 = <&pinctrl_sdmmc0_cmd_dat_default &pinctrl_sdmmc0_ck_cd_default>;
86			status = "okay";
87			u-boot,dm-pre-reloc;
88		};
89
90		sdmmc1: sdio-host@b0000000 {
91			bus-width = <4>;
92			pinctrl-names = "default";
93			pinctrl-0 = <&pinctrl_sdmmc1_cmd_dat_default &pinctrl_sdmmc1_ck_cd_default>;
94			status = "disabled"; /* conflicts with nand and qspi0*/
95			u-boot,dm-pre-reloc;
96		};
97
98		apb {
99			macb0: ethernet@f8008000 {
100				pinctrl-names = "default";
101				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq>;
102				phy-mode = "rmii";
103				status = "okay";
104
105				ethernet-phy@1 {
106					reg = <0x1>;
107				};
108			};
109
110			uart0: serial@f801c000 {
111				pinctrl-names = "default";
112				pinctrl-0 = <&pinctrl_uart0_default>;
113				status = "okay";
114				u-boot,dm-pre-reloc;
115			};
116
117			i2c1: i2c@fc028000 {
118				pinctrl-names = "default";
119				pinctrl-0 = <&pinctrl_i2c1_default>;
120				status = "okay";
121
122				i2c_eeprom: i2c_eeprom@50 {
123					compatible = "atmel,24mac402";
124					reg = <0x50>;
125				};
126			};
127
128			pioA: gpio@fc038000 {
129				pinctrl {
130					pinctrl_i2c1_default: i2c1_default {
131						pinmux = <PIN_PC6__TWD1>,
132							 <PIN_PC7__TWCK1>;
133						bias-disable;
134					};
135
136					pinctrl_macb0_phy_irq: macb0_phy_irq {
137						pinmux = <PIN_PB24__GPIO>;
138						bias-disable;
139					};
140
141					pinctrl_macb0_rmii: macb0_rmii {
142						pinmux = <PIN_PB14__GTXCK>,
143							 <PIN_PB15__GTXEN>,
144							 <PIN_PB16__GRXDV>,
145							 <PIN_PB17__GRXER>,
146							 <PIN_PB18__GRX0>,
147							 <PIN_PB19__GRX1>,
148							 <PIN_PB20__GTX0>,
149							 <PIN_PB21__GTX1>,
150							 <PIN_PB22__GMDC>,
151							 <PIN_PB23__GMDIO>;
152						bias-disable;
153					};
154
155					pinctrl_sdmmc0_cmd_dat_default: sdmmc0_cmd_dat_default {
156						pinmux = <PIN_PA1__SDMMC0_CMD>,
157							 <PIN_PA2__SDMMC0_DAT0>,
158							 <PIN_PA3__SDMMC0_DAT1>,
159							 <PIN_PA4__SDMMC0_DAT2>,
160							 <PIN_PA5__SDMMC0_DAT3>,
161							 <PIN_PA6__SDMMC0_DAT4>,
162							 <PIN_PA7__SDMMC0_DAT5>,
163							 <PIN_PA8__SDMMC0_DAT6>,
164							 <PIN_PA9__SDMMC0_DAT7>;
165						bias-pull-up;
166						u-boot,dm-pre-reloc;
167					};
168
169					pinctrl_sdmmc0_ck_cd_default: sdmmc0_ck_cd_default {
170						pinmux = <PIN_PA0__SDMMC0_CK>,
171							 <PIN_PA10__SDMMC0_RSTN>,
172							 <PIN_PA11__SDMMC0_VDDSEL>,
173							 <PIN_PA13__SDMMC0_CD>;
174						bias-disable;
175						u-boot,dm-pre-reloc;
176					};
177
178					pinctrl_sdmmc1_cmd_dat_default: sdmmc1_cmd_dat_default {
179						pinmux = <PIN_PA28__SDMMC1_CMD>,
180							 <PIN_PA18__SDMMC1_DAT0>,
181							 <PIN_PA19__SDMMC1_DAT1>,
182							 <PIN_PA20__SDMMC1_DAT2>,
183							 <PIN_PA21__SDMMC1_DAT3>;
184						bias-pull-up;
185						u-boot,dm-pre-reloc;
186					};
187
188					pinctrl_sdmmc1_ck_cd_default: sdmmc1_ck_cd_default {
189						pinmux = <PIN_PA22__SDMMC1_CK>,
190							 <PIN_PA30__SDMMC1_CD>;
191						bias-disable;
192						u-boot,dm-pre-reloc;
193					};
194
195					pinctrl_uart0_default: uart0_default {
196						pinmux = <PIN_PB26__URXD0>,
197							 <PIN_PB27__UTXD0>;
198						bias-disable;
199						u-boot,dm-pre-reloc;
200					};
201
202					pinctrl_usb_default: usb_default {
203						pinmux = <PIN_PB12__GPIO>;
204						bias-disable;
205					};
206
207					pinctrl_usba_vbus: usba_vbus {
208						pinmux = <PIN_PB11__GPIO>;
209						bias-disable;
210					};
211				};
212			};
213		};
214	};
215};
216