1// SPDX-License-Identifier: GPL-2.0+
2// Copyright 2019 Jonathan Neuschäfer
3//
4// The Kobo Aura e-book reader, model N514. The mainboard is marked as E606F0B.
5
6/dts-v1/;
7#include "imx50.dtsi"
8#include <dt-bindings/input/input.h>
9
10/ {
11	model = "Kobo Aura (N514)";
12	compatible = "kobo,aura", "fsl,imx50";
13
14	chosen {
15		stdout-path = "serial1:115200n8";
16	};
17
18	memory@70000000 {
19		device_type = "memory";
20		reg = <0x70000000 0x10000000>;
21	};
22
23	gpio-leds {
24		compatible = "gpio-leds";
25		pinctrl-names = "default";
26		pinctrl-0 = <&pinctrl_leds>;
27
28		on {
29			label = "kobo_aura:orange:on";
30			gpios = <&gpio6 24 GPIO_ACTIVE_LOW>;
31			panic-indicator;
32		};
33	};
34
35	gpio-keys {
36		compatible = "gpio-keys";
37		pinctrl-names = "default";
38		pinctrl-0 = <&pinctrl_gpiokeys>;
39
40		power {
41			label = "Power Button";
42			gpios = <&gpio4 10 GPIO_ACTIVE_LOW>;
43			linux,code = <KEY_POWER>;
44		};
45
46		hallsensor {
47			label = "Hallsensor";
48			gpios = <&gpio5 15 GPIO_ACTIVE_LOW>;
49			linux,code = <KEY_RESERVED>;
50			linux,input-type = <EV_SW>;
51		};
52
53		frontlight {
54			label = "Frontlight";
55			gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
56			linux,code = <KEY_DISPLAYTOGGLE>;
57		};
58	};
59
60	sd2_pwrseq: pwrseq {
61		compatible = "mmc-pwrseq-simple";
62		pinctrl-names = "default";
63		pinctrl-0 = <&pinctrl_sd2_reset>;
64		reset-gpios = <&gpio4 17 GPIO_ACTIVE_LOW>;
65	};
66
67	sd2_vmmc: gpio-regulator {
68		compatible = "regulator-gpio";
69		pinctrl-names = "default";
70		pinctrl-0 = <&pinctrl_sd2_vmmc>;
71		regulator-name = "vmmc";
72		states = <3300000 0>;
73		regulator-min-microvolt = <3300000>;
74		regulator-max-microvolt = <3300000>;
75		enable-gpio = <&gpio4 12 GPIO_ACTIVE_LOW>;
76		startup-delay-us = <100000>;
77	};
78};
79
80&esdhc1 {
81	pinctrl-names = "default";
82	pinctrl-0 = <&pinctrl_sd1>;
83	max-frequency = <50000000>;
84	bus-width = <4>;
85	cd-gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
86	disable-wp;
87	status = "okay";
88
89	/* External µSD card */
90};
91
92&esdhc2 {
93	pinctrl-names = "default";
94	pinctrl-0 = <&pinctrl_sd2>;
95	bus-width = <4>;
96	max-frequency = <50000000>;
97	disable-wp;
98	mmc-pwrseq = <&sd2_pwrseq>;
99	vmmc-supply = <&sd2_vmmc>;
100	status = "okay";
101
102	/* CyberTan WC121 SDIO WiFi (BCM43362) */
103};
104
105&esdhc3 {
106	pinctrl-names = "default";
107	pinctrl-0 = <&pinctrl_sd3>;
108	bus-width = <8>;
109	non-removable;
110	max-frequency = <50000000>;
111	disable-wp;
112	status = "okay";
113
114	/* Internal eMMC */
115};
116
117&i2c1 {
118	pinctrl-names = "default";
119	pinctrl-0 = <&pinctrl_i2c1>;
120	status = "okay";
121
122	/* TODO: ektf2132 touch controller at 0x15 */
123};
124
125&i2c2 {
126	pinctrl-names = "default";
127	pinctrl-0 = <&pinctrl_i2c2>;
128	status = "okay";
129
130	/* TODO: TPS65185 PMIC for E Ink at 0x68 */
131};
132
133&i2c3 {
134	pinctrl-names = "default";
135	pinctrl-0 = <&pinctrl_i2c3>;
136	status = "okay";
137
138	/* TODO: embedded controller at 0x43 */
139};
140
141&iomuxc {
142	pinctrl_gpiokeys: gpiokeys {
143		fsl,pins = <
144			MX50_PAD_CSPI_MISO__GPIO4_10		0x0
145			MX50_PAD_SD2_D7__GPIO5_15		0x0
146			MX50_PAD_KEY_ROW0__GPIO4_1		0x0
147		>;
148	};
149
150	pinctrl_i2c1: i2c1 {
151		fsl,pins = <
152			MX50_PAD_I2C1_SCL__I2C1_SCL		0x400001fd
153			MX50_PAD_I2C1_SDA__I2C1_SDA		0x400001fd
154		>;
155	};
156
157	pinctrl_i2c2: i2c2 {
158		fsl,pins = <
159			MX50_PAD_I2C2_SCL__I2C2_SCL		0x400001fd
160			MX50_PAD_I2C2_SDA__I2C2_SDA		0x400001fd
161		>;
162	};
163
164	pinctrl_i2c3: i2c3 {
165		fsl,pins = <
166			MX50_PAD_I2C3_SCL__I2C3_SCL		0x400001fd
167			MX50_PAD_I2C3_SDA__I2C3_SDA		0x400001fd
168		>;
169	};
170
171	pinctrl_leds: leds {
172		fsl,pins = <
173			MX50_PAD_PWM1__GPIO6_24			0x0
174		>;
175	};
176
177	pinctrl_sd1: sd1 {
178		fsl,pins = <
179			MX50_PAD_SD1_CMD__ESDHC1_CMD		0x1e4
180			MX50_PAD_SD1_CLK__ESDHC1_CLK		0xd4
181			MX50_PAD_SD1_D0__ESDHC1_DAT0		0x1d4
182			MX50_PAD_SD1_D1__ESDHC1_DAT1		0x1d4
183			MX50_PAD_SD1_D2__ESDHC1_DAT2		0x1d4
184			MX50_PAD_SD1_D3__ESDHC1_DAT3		0x1d4
185
186			MX50_PAD_SD2_CD__GPIO5_17		0x0
187		>;
188	};
189
190	pinctrl_sd2: sd2 {
191		fsl,pins = <
192			MX50_PAD_SD2_CMD__ESDHC2_CMD		0x1e4
193			MX50_PAD_SD2_CLK__ESDHC2_CLK		0xd4
194			MX50_PAD_SD2_D0__ESDHC2_DAT0		0x1d4
195			MX50_PAD_SD2_D1__ESDHC2_DAT1		0x1d4
196			MX50_PAD_SD2_D2__ESDHC2_DAT2		0x1d4
197			MX50_PAD_SD2_D3__ESDHC2_DAT3		0x1d4
198		>;
199	};
200
201	pinctrl_sd2_reset: sd2-reset {
202		fsl,pins = <
203			MX50_PAD_ECSPI2_MOSI__GPIO4_17		0x0
204		>;
205	};
206
207	pinctrl_sd2_vmmc: sd2-vmmc {
208		fsl,pins = <
209			MX50_PAD_ECSPI1_SCLK__GPIO4_12		0x0
210		>;
211	};
212
213	pinctrl_sd3: sd3 {
214		fsl,pins = <
215			MX50_PAD_SD3_CMD__ESDHC3_CMD		0x1e4
216			MX50_PAD_SD3_CLK__ESDHC3_CLK		0xd4
217			MX50_PAD_SD3_D0__ESDHC3_DAT0		0x1d4
218			MX50_PAD_SD3_D1__ESDHC3_DAT1		0x1d4
219			MX50_PAD_SD3_D2__ESDHC3_DAT2		0x1d4
220			MX50_PAD_SD3_D3__ESDHC3_DAT3		0x1d4
221			MX50_PAD_SD3_D4__ESDHC3_DAT4		0x1d4
222			MX50_PAD_SD3_D5__ESDHC3_DAT5		0x1d4
223			MX50_PAD_SD3_D6__ESDHC3_DAT6		0x1d4
224			MX50_PAD_SD3_D7__ESDHC3_DAT7		0x1d4
225		>;
226	};
227
228	pinctrl_uart2: uart2 {
229		fsl,pins = <
230			MX50_PAD_UART2_TXD__UART2_TXD_MUX	0x1e4
231			MX50_PAD_UART2_RXD__UART2_RXD_MUX	0x1e4
232		>;
233	};
234
235	pinctrl_usbphy: usbphy {
236		fsl,pins = <
237			MX50_PAD_ECSPI2_SS0__GPIO4_19		0x0
238		>;
239	};
240};
241
242&uart2 {
243	pinctrl-names = "default";
244	pinctrl-0 = <&pinctrl_uart2>;
245	status = "okay";
246};
247
248&usbotg {
249	phy_type = "utmi_wide";
250	dr_mode = "peripheral";
251	status = "okay";
252};
253
254&usbphy0 {
255	pinctrl-names = "default";
256	pinctrl-0 = <&pinctrl_usbphy>;
257	vbus-detect-gpio = <&gpio4 19 GPIO_ACTIVE_LOW>;
258};
259