xref: /freebsd/sys/contrib/device-tree/src/arm/st/ste-nomadik-nhk15.dts (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0
2*f126890aSEmmanuel Vadot/*
3*f126890aSEmmanuel Vadot * Device Tree for the ST Microelectronics Nomadik NHK8815 board
4*f126890aSEmmanuel Vadot */
5*f126890aSEmmanuel Vadot
6*f126890aSEmmanuel Vadot/dts-v1/;
7*f126890aSEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h>
8*f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
9*f126890aSEmmanuel Vadot#include "ste-nomadik-stn8815.dtsi"
10*f126890aSEmmanuel Vadot
11*f126890aSEmmanuel Vadot/ {
12*f126890aSEmmanuel Vadot	model = "Nomadik STN8815NHK";
13*f126890aSEmmanuel Vadot	compatible = "st,nomadik-nhk-15";
14*f126890aSEmmanuel Vadot
15*f126890aSEmmanuel Vadot	chosen {
16*f126890aSEmmanuel Vadot		bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk";
17*f126890aSEmmanuel Vadot	};
18*f126890aSEmmanuel Vadot
19*f126890aSEmmanuel Vadot	aliases {
20*f126890aSEmmanuel Vadot		serial0 = &uart0;
21*f126890aSEmmanuel Vadot		serial1 = &uart1;
22*f126890aSEmmanuel Vadot		stmpe-i2c0 = &stmpe0;
23*f126890aSEmmanuel Vadot		stmpe-i2c1 = &stmpe1;
24*f126890aSEmmanuel Vadot	};
25*f126890aSEmmanuel Vadot
26*f126890aSEmmanuel Vadot	pinctrl {
27*f126890aSEmmanuel Vadot		uart0 {
28*f126890aSEmmanuel Vadot			uart0_nhk_mode: uart0_mux {
29*f126890aSEmmanuel Vadot				u0_default_mux {
30*f126890aSEmmanuel Vadot					function = "u0";
31*f126890aSEmmanuel Vadot					groups = "u0txrx_a_1", "u0ctsrts_a_1";
32*f126890aSEmmanuel Vadot				};
33*f126890aSEmmanuel Vadot			};
34*f126890aSEmmanuel Vadot		};
35*f126890aSEmmanuel Vadot
36*f126890aSEmmanuel Vadot		stmpe2401_1 {
37*f126890aSEmmanuel Vadot			stmpe2401_1_nhk_mode: stmpe2401_1_nhk {
38*f126890aSEmmanuel Vadot				nhk_cfg1 {
39*f126890aSEmmanuel Vadot					pins = "GPIO76_B20"; // IRQ line
40*f126890aSEmmanuel Vadot					ste,input = <0>;
41*f126890aSEmmanuel Vadot				};
42*f126890aSEmmanuel Vadot				nhk_cfg2 {
43*f126890aSEmmanuel Vadot					pins = "GPIO77_B8"; // reset line
44*f126890aSEmmanuel Vadot					ste,output = <1>;
45*f126890aSEmmanuel Vadot				};
46*f126890aSEmmanuel Vadot			};
47*f126890aSEmmanuel Vadot		};
48*f126890aSEmmanuel Vadot		stmpe2401_2 {
49*f126890aSEmmanuel Vadot			stmpe2401_2_nhk_mode: stmpe2401_2_nhk {
50*f126890aSEmmanuel Vadot				nhk_cfg1 {
51*f126890aSEmmanuel Vadot					pins = "GPIO78_A8"; // IRQ line
52*f126890aSEmmanuel Vadot					ste,input = <0>;
53*f126890aSEmmanuel Vadot				};
54*f126890aSEmmanuel Vadot				nhk_cfg2 {
55*f126890aSEmmanuel Vadot					pins = "GPIO79_C9"; // reset line
56*f126890aSEmmanuel Vadot					ste,output = <1>;
57*f126890aSEmmanuel Vadot				};
58*f126890aSEmmanuel Vadot			};
59*f126890aSEmmanuel Vadot		};
60*f126890aSEmmanuel Vadot		lis3lv02dl {
61*f126890aSEmmanuel Vadot			lis3lv02dl_nhk_mode: lis3lv02dl_nhk {
62*f126890aSEmmanuel Vadot				nhk_cfg1 {
63*f126890aSEmmanuel Vadot					pins = "GPIO82_C10"; // IRQ line
64*f126890aSEmmanuel Vadot					ste,input = <0>;
65*f126890aSEmmanuel Vadot				};
66*f126890aSEmmanuel Vadot			};
67*f126890aSEmmanuel Vadot		};
68*f126890aSEmmanuel Vadot	};
69*f126890aSEmmanuel Vadot	src@101e0000 {
70*f126890aSEmmanuel Vadot		/* These chrystal outputs are not used on this board */
71*f126890aSEmmanuel Vadot		disable-sxtalo;
72*f126890aSEmmanuel Vadot		disable-mxtalo;
73*f126890aSEmmanuel Vadot	};
74*f126890aSEmmanuel Vadot
75*f126890aSEmmanuel Vadot	/* This is where the interrupt is routed on the NHK-15 debug board */
76*f126890aSEmmanuel Vadot	external-bus@34000000 {
77*f126890aSEmmanuel Vadot		compatible = "simple-bus";
78*f126890aSEmmanuel Vadot		reg = <0x34000000 0x1000000>;
79*f126890aSEmmanuel Vadot		#address-cells = <1>;
80*f126890aSEmmanuel Vadot		#size-cells = <1>;
81*f126890aSEmmanuel Vadot		ranges = <0 0x34000000 0x1000000>;
82*f126890aSEmmanuel Vadot		ethernet@300 {
83*f126890aSEmmanuel Vadot			compatible = "smsc,lan91c111";
84*f126890aSEmmanuel Vadot			reg = <0x300 0x0fd00>;
85*f126890aSEmmanuel Vadot			reg-io-width = <2>;
86*f126890aSEmmanuel Vadot			reset-gpios = <&stmpe_gpio44 10 GPIO_ACTIVE_HIGH>;
87*f126890aSEmmanuel Vadot			interrupt-parent = <&stmpe_gpio44>;
88*f126890aSEmmanuel Vadot			interrupts = <11 IRQ_TYPE_EDGE_RISING>;
89*f126890aSEmmanuel Vadot		};
90*f126890aSEmmanuel Vadot	};
91*f126890aSEmmanuel Vadot
92*f126890aSEmmanuel Vadot	i2c0 {
93*f126890aSEmmanuel Vadot		lis3lv02dl@1d {
94*f126890aSEmmanuel Vadot			/* Accelerometer */
95*f126890aSEmmanuel Vadot			compatible = "st,lis3lv02dl-accel";
96*f126890aSEmmanuel Vadot			interrupt-parent = <&gpio2>;
97*f126890aSEmmanuel Vadot			interrupts = <18 IRQ_TYPE_EDGE_RISING>; // GPIO 82
98*f126890aSEmmanuel Vadot			pinctrl-0 = <&lis3lv02dl_nhk_mode>;
99*f126890aSEmmanuel Vadot			pinctrl-names = "default";
100*f126890aSEmmanuel Vadot			reg = <0x1d>;
101*f126890aSEmmanuel Vadot		};
102*f126890aSEmmanuel Vadot		stmpe0: port-expander@43 {
103*f126890aSEmmanuel Vadot			compatible = "st,stmpe2401";
104*f126890aSEmmanuel Vadot			reg = <0x43>;
105*f126890aSEmmanuel Vadot			reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; // GPIO77
106*f126890aSEmmanuel Vadot			interrupts = <12 IRQ_TYPE_EDGE_FALLING>; // GPIO76
107*f126890aSEmmanuel Vadot			interrupt-parent = <&gpio2>;
108*f126890aSEmmanuel Vadot			wakeup-source;
109*f126890aSEmmanuel Vadot			pinctrl-names = "default";
110*f126890aSEmmanuel Vadot			pinctrl-0 = <&stmpe2401_1_nhk_mode>;
111*f126890aSEmmanuel Vadot			stmpe_gpio43: gpio {
112*f126890aSEmmanuel Vadot				compatible = "st,stmpe-gpio";
113*f126890aSEmmanuel Vadot				gpio-controller;
114*f126890aSEmmanuel Vadot				#gpio-cells = <2>;
115*f126890aSEmmanuel Vadot				interrupt-controller;
116*f126890aSEmmanuel Vadot				#interrupt-cells = <2>;
117*f126890aSEmmanuel Vadot				/* Some pins in alternate functions */
118*f126890aSEmmanuel Vadot				st,norequest-mask = <0xf0f002>;
119*f126890aSEmmanuel Vadot			};
120*f126890aSEmmanuel Vadot			keyboard-controller {
121*f126890aSEmmanuel Vadot				compatible = "st,stmpe-keypad";
122*f126890aSEmmanuel Vadot				debounce-interval = <64>;
123*f126890aSEmmanuel Vadot				st,scan-count = <8>;
124*f126890aSEmmanuel Vadot				st,no-autorepeat;
125*f126890aSEmmanuel Vadot				keypad,num-rows = <8>;
126*f126890aSEmmanuel Vadot				keypad,num-columns = <8>;
127*f126890aSEmmanuel Vadot				linux,keymap = <0x00020072 // Vol down
128*f126890aSEmmanuel Vadot						0x00030073 // Vol up
129*f126890aSEmmanuel Vadot						0x0100009e // Back
130*f126890aSEmmanuel Vadot						0x010100e3 // TV out
131*f126890aSEmmanuel Vadot						0x01020098 // Lock
132*f126890aSEmmanuel Vadot						0x0103013b // Start
133*f126890aSEmmanuel Vadot						0x020000a3 // Next
134*f126890aSEmmanuel Vadot						0x020100a4 // Play
135*f126890aSEmmanuel Vadot						0x020200a5 // Prev
136*f126890aSEmmanuel Vadot						0x02030160 // OK
137*f126890aSEmmanuel Vadot						0x03000069 // Left
138*f126890aSEmmanuel Vadot						0x0301006a // Right
139*f126890aSEmmanuel Vadot						0x03020067 // Up
140*f126890aSEmmanuel Vadot						0x0303006c>; // Down
141*f126890aSEmmanuel Vadot			};
142*f126890aSEmmanuel Vadot			stmpe0_pwm: pwm {
143*f126890aSEmmanuel Vadot				compatible = "st,stmpe-pwm";
144*f126890aSEmmanuel Vadot				#pwm-cells = <2>;
145*f126890aSEmmanuel Vadot			};
146*f126890aSEmmanuel Vadot		};
147*f126890aSEmmanuel Vadot		stmpe1: port-expander@44 {
148*f126890aSEmmanuel Vadot			compatible = "st,stmpe2401";
149*f126890aSEmmanuel Vadot			reg = <0x44>;
150*f126890aSEmmanuel Vadot			reset-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; // GPIO79
151*f126890aSEmmanuel Vadot			interrupts = <14 IRQ_TYPE_EDGE_FALLING>; // GPIO78
152*f126890aSEmmanuel Vadot			interrupt-parent = <&gpio2>;
153*f126890aSEmmanuel Vadot			wakeup-source;
154*f126890aSEmmanuel Vadot			pinctrl-names = "default";
155*f126890aSEmmanuel Vadot			pinctrl-0 = <&stmpe2401_2_nhk_mode>;
156*f126890aSEmmanuel Vadot			stmpe_gpio44: gpio {
157*f126890aSEmmanuel Vadot				compatible = "st,stmpe-gpio";
158*f126890aSEmmanuel Vadot				gpio-controller;
159*f126890aSEmmanuel Vadot				#gpio-cells = <2>;
160*f126890aSEmmanuel Vadot				interrupt-controller;
161*f126890aSEmmanuel Vadot				#interrupt-cells = <2>;
162*f126890aSEmmanuel Vadot				/*
163*f126890aSEmmanuel Vadot				 * This will turn off SATA so that MMC/SD
164*f126890aSEmmanuel Vadot				 * can thrive
165*f126890aSEmmanuel Vadot				 */
166*f126890aSEmmanuel Vadot				mmcsd-hog {
167*f126890aSEmmanuel Vadot					gpio-hog;
168*f126890aSEmmanuel Vadot					gpios = <2 0x0>;
169*f126890aSEmmanuel Vadot					output-low;
170*f126890aSEmmanuel Vadot					line-name = "SATA EN";
171*f126890aSEmmanuel Vadot				};
172*f126890aSEmmanuel Vadot			};
173*f126890aSEmmanuel Vadot		};
174*f126890aSEmmanuel Vadot	};
175*f126890aSEmmanuel Vadot
176*f126890aSEmmanuel Vadot	amba {
177*f126890aSEmmanuel Vadot		clcd@10120000 {
178*f126890aSEmmanuel Vadot			status = "okay";
179*f126890aSEmmanuel Vadot			pinctrl-names = "default";
180*f126890aSEmmanuel Vadot			pinctrl-0 = <&clcd_24bit_mux>;
181*f126890aSEmmanuel Vadot			port {
182*f126890aSEmmanuel Vadot				nomadik_clcd: endpoint {
183*f126890aSEmmanuel Vadot					remote-endpoint = <&nomadik_clcd_panel>;
184*f126890aSEmmanuel Vadot					arm,pl11x,tft-r0g0b0-pads = <16 8 0>;
185*f126890aSEmmanuel Vadot				};
186*f126890aSEmmanuel Vadot			};
187*f126890aSEmmanuel Vadot
188*f126890aSEmmanuel Vadot		};
189*f126890aSEmmanuel Vadot
190*f126890aSEmmanuel Vadot		/* Activate RX/TX and CTS/RTS on UART 0 */
191*f126890aSEmmanuel Vadot		uart0: serial@101fd000 {
192*f126890aSEmmanuel Vadot			pinctrl-names = "default";
193*f126890aSEmmanuel Vadot			pinctrl-0 = <&uart0_nhk_mode>;
194*f126890aSEmmanuel Vadot			status = "okay";
195*f126890aSEmmanuel Vadot		};
196*f126890aSEmmanuel Vadot		mmcsd: mmc@101f6000 {
197*f126890aSEmmanuel Vadot			cd-gpios = <&stmpe_gpio44 7 GPIO_ACTIVE_LOW>;
198*f126890aSEmmanuel Vadot			wp-gpios = <&stmpe_gpio44 18 GPIO_ACTIVE_HIGH>;
199*f126890aSEmmanuel Vadot		};
200*f126890aSEmmanuel Vadot	};
201*f126890aSEmmanuel Vadot
202*f126890aSEmmanuel Vadot	spi {
203*f126890aSEmmanuel Vadot		compatible = "spi-gpio";
204*f126890aSEmmanuel Vadot		#address-cells = <1>;
205*f126890aSEmmanuel Vadot		#size-cells = <0>;
206*f126890aSEmmanuel Vadot
207*f126890aSEmmanuel Vadot		/*
208*f126890aSEmmanuel Vadot		 * As we're dealing with 3wire SPI, we only define SCK
209*f126890aSEmmanuel Vadot		 * and MOSI (in the spec MOSI is called "SDA").
210*f126890aSEmmanuel Vadot		 */
211*f126890aSEmmanuel Vadot		sck-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
212*f126890aSEmmanuel Vadot		mosi-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
213*f126890aSEmmanuel Vadot		cs-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
214*f126890aSEmmanuel Vadot		num-chipselects = <1>;
215*f126890aSEmmanuel Vadot
216*f126890aSEmmanuel Vadot		/*
217*f126890aSEmmanuel Vadot		 * WVGA connector 21
218*f126890aSEmmanuel Vadot		 * WVGA (800x480): 4.3" TPG110 TDO43MTEA2 24-bit RGB
219*f126890aSEmmanuel Vadot		 * with TPO touch screen.
220*f126890aSEmmanuel Vadot		  */
221*f126890aSEmmanuel Vadot		panel: display@0 {
222*f126890aSEmmanuel Vadot			/*
223*f126890aSEmmanuel Vadot			 * The TPO display driver is connected to a
224*f126890aSEmmanuel Vadot			 * 5.7" OSD OSD057VA01CT TFT display.
225*f126890aSEmmanuel Vadot			 */
226*f126890aSEmmanuel Vadot			compatible = "tpo,tpg110";
227*f126890aSEmmanuel Vadot			reg = <0>;
228*f126890aSEmmanuel Vadot			spi-3wire;
229*f126890aSEmmanuel Vadot			/* 320 ns min period ~= 3 MHz */
230*f126890aSEmmanuel Vadot			spi-max-frequency = <3000000>;
231*f126890aSEmmanuel Vadot			/* Width and height from the OSD data sheet */
232*f126890aSEmmanuel Vadot			width-mm = <116>;
233*f126890aSEmmanuel Vadot			height-mm = <87>;
234*f126890aSEmmanuel Vadot			grestb-gpios = <&stmpe_gpio44 5 GPIO_ACTIVE_LOW>;
235*f126890aSEmmanuel Vadot			backlight = <&bl>;
236*f126890aSEmmanuel Vadot
237*f126890aSEmmanuel Vadot			port {
238*f126890aSEmmanuel Vadot				nomadik_clcd_panel: endpoint {
239*f126890aSEmmanuel Vadot					remote-endpoint = <&nomadik_clcd>;
240*f126890aSEmmanuel Vadot				};
241*f126890aSEmmanuel Vadot			};
242*f126890aSEmmanuel Vadot		};
243*f126890aSEmmanuel Vadot	};
244*f126890aSEmmanuel Vadot
245*f126890aSEmmanuel Vadot	bl: backlight {
246*f126890aSEmmanuel Vadot		compatible = "pwm-backlight";
247*f126890aSEmmanuel Vadot		pwms = <&stmpe0_pwm 0 500000>;
248*f126890aSEmmanuel Vadot		pwm-names = "backlight";
249*f126890aSEmmanuel Vadot		brightness-levels = <
250*f126890aSEmmanuel Vadot			0  1  2  3  4  5  6  7  8  9
251*f126890aSEmmanuel Vadot			10 11 12 13 14 15 16 17 18 19
252*f126890aSEmmanuel Vadot			20 21 22 23 24 25 26 27 28 29
253*f126890aSEmmanuel Vadot			30 31 32 33 34 35 36 37 38 39
254*f126890aSEmmanuel Vadot			40 41 42 43 44 45 46 47 48 49
255*f126890aSEmmanuel Vadot			50 51 52 53 54 55 56 57 58 59
256*f126890aSEmmanuel Vadot			60 61 62 63 64 65 66 67 68 69
257*f126890aSEmmanuel Vadot			70 71 72 73 74 75 76 77 78 79
258*f126890aSEmmanuel Vadot			80 81 82 83 84 85 86 87 88 89
259*f126890aSEmmanuel Vadot			90 91 92 93 94 95 96 97 98 99
260*f126890aSEmmanuel Vadot			100
261*f126890aSEmmanuel Vadot		>;
262*f126890aSEmmanuel Vadot		default-brightness-level = <100>;
263*f126890aSEmmanuel Vadot	};
264*f126890aSEmmanuel Vadot};
265