1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright 2012 ST-Ericsson AB
4 */
5
6#include "ste-href-ab8500.dtsi"
7#include "ste-href.dtsi"
8
9/ {
10	model = "ST-Ericsson HREF (v60+) platform with Device Tree";
11	compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";
12
13	soc {
14		/* Name the GPIO muxed rails on the HREF boards */
15		gpio@8012e000 {
16			/* GPIOs 0 - 31 */
17			gpio-line-names =
18				     /* GPIO0,1 used for UART0 BT RX/TX */
19				     "", "",
20				     "UART_WAKE",
21				     "BT_WAKE",
22				     "",
23				     "SDMMC_1V8_3V_SEL",
24				     "FLASH_LED_SYNC (FLASH_CTRL_0)",
25				     "XENON_READY (FLASH_CTRL_1)",
26				     "", "", "", "", "", "", "", "",
27				     "", "", "", "",
28				     "",
29				     "FLASH_LED_EN (FLASH_CTRL_3)",
30				     "", "",
31				     "", "", "", "", "",
32				     /* Used by UART2 (console) */
33				     "", "",
34				     "MAGNETOMETER_INT";
35		};
36
37		gpio@8012e080 {
38			/* GPIOs 32 - 63 */
39			gpio-line-names =
40				     "MAGNETOMETER_DRDY",
41				     "", "", "", "", "", "", "",
42				     "", "", "", "", "", "", "", "",
43				     "", "", "", "", "", "", "", "",
44				     "", "", "", "", "", "", "", "";
45		};
46
47		gpio@8000e000 {
48			/* GPIOs 64 - 95 */
49			gpio-line-names = "XENON_EN2 (FLASH_CTRL_4)",
50				     "DISP1_RST",
51				     "DISP2_RST",
52				     "TOUCH_INT2",
53				     "LCD_VSI0_A",
54				     "LCD_VSI1_A",
55				     /* GPIO 70-77 used for ETM */
56				     "", "", "", "", "", "", "", "",
57				     /* GPIO 78-81 used for YCBCR */
58				     "", "", "", "",
59				     "ACCELEROMETER_INT1_RDY",
60				     "ACCELEROMETER_INT2",
61				     "TOUCH_INT",
62				     "WLAN_ENA",
63				     "", "", "", "", "",
64				     "FORCE_SENSING_INT",
65				     "FORCE_SENSING_RESET",
66				     "", "",
67				     "SDMMC_CD";
68		};
69
70		gpio@8000e080 {
71			/* GPIOs 96 - 127 */
72			gpio-line-names = "",
73				     "FORCE_SENSING_WU",
74				     "", "", "", "", "", "",
75				     "", "", "", "", "", "", "", "",
76				     "", "", "", "", "", "", "", "",
77				     "", "", "", "", "", "", "", "";
78		};
79
80		gpio@8000e100 {
81			/* GPIOs 128 - 159 */
82			gpio-line-names = "", "", "", "", "", "", "", "",
83				     "", "", "",
84				     "DIPRO_INT", /* GPIO139 */
85				     "XSHUTDOWN_SECONDARY_SENSOR",
86				     "XSHUTDOWN_PRIMARY_SENSOR",
87				     "NFC_RST (NFC_CTRL_",
88				     "TOUCH_RST",
89				     "NFC_IRQ (NFC_CTRL_1)",
90				     "HAL_SW",
91				     "TOUCH_RST2",
92				     "", "",
93				     "VAUDIO_HF_EN", /* GPIO149 */
94				     "", "", "", "", "", "", "", "", "", "";
95		};
96
97		gpio@8000e180 {
98			/* GPIOs 160 - 191 */
99			gpio-line-names = "", "", "", "", "", "", "", "",
100				     "",
101				     "SDMMC_EN",
102				     "XENON_CHARGE (FLASH_CONTROL_5)",
103				     "GBF_ENA_RESET",
104				     "", "", "", "",
105				     "", "", "", "", "", "", "", "",
106				     "", "", "", "", "", "", "", "";
107		};
108
109		gpio@8011e000 {
110			/* GPIOs 192 - 223 */
111			gpio-line-names = "HDTV_INTN",
112				     "", "", "",
113				     "HDTV_RSTN",
114				     "", "", "",
115				     "", /* GPIO200 */
116				     "", "", "", "", "", "", "",
117				     /* GPIO208-216 used for WGBF_MC1 */
118				     "", "", "", "", "", "", "", "", "",
119				     "SW_FRONT_PROXIMITY", /* GPIO217 */
120				     "KPD_CTRL_INT", /* Keypad controller */
121				     "", "", "", "", "";
122		};
123
124		gpio@8011e080 {
125			/* GPIOs 224 - 255 */
126			gpio-line-names = "", "",
127				     "HSIT_ACWAKE0",
128				     "", "", "", "", "",
129				     "", "", "", "", "", "", "", "",
130				     "", "", "", "", "", "", "", "",
131				     "", "", "", "", "", "", "", "";
132		};
133
134		// External Micro SD slot
135		sdi0_per1@80126000 {
136			cd-gpios  = <&gpio2 31 GPIO_ACTIVE_HIGH>; // 95
137		};
138
139		vmmci: regulator-gpio {
140			gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
141			enable-gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
142			enable-active-high;
143		};
144
145		pinctrl {
146			/*
147			 * Set this up using hogs, as time goes by and as seems fit, these
148			 * can be moved over to being controlled by respective device.
149			 */
150			pinctrl-names = "default";
151			pinctrl-0 = <&ipgpio_hrefv60_mode>,
152				  <&etm_hrefv60_mode>,
153				  <&nahj_hrefv60_mode>,
154				  <&nfc_hrefv60_mode>,
155				  <&force_hrefv60_mode>,
156				  <&dipro_hrefv60_mode>,
157				  <&vaudio_hf_hrefv60_mode>,
158				  <&gbf_hrefv60_mode>,
159				  <&hdtv_hrefv60_mode>,
160				  <&gpios_hrefv60_mode>;
161
162			sdi0 {
163				sdi0_default_mode: sdi0_default {
164					/* SD card detect GPIO pin, extend default state */
165					default_hrefv60_cfg1 {
166						pins = "GPIO95_E8";
167						ste,config = <&gpio_in_pu>;
168					};
169					/* VMMCI level-shifter enable */
170					default_hrefv60_cfg2 {
171						pins = "GPIO169_D22";
172						ste,config = <&gpio_out_hi>;
173					};
174					/* VMMCI level-shifter voltage select */
175					default_hrefv60_cfg3 {
176						pins = "GPIO5_AG6";
177						ste,config = <&gpio_out_hi>;
178					};
179				};
180			};
181			ipgpio {
182				/*
183				 * XENON Flashgun on image processor GPIO (controlled from image
184				 * processor firmware), mux in these image processor GPIO lines 0
185				 * (XENON_FLASH_ID), 1 (XENON_READY) and there is an assistant
186				 * LED on IP GPIO 4 (XENON_EN2) on altfunction C, that need bias
187				 * from GPIO21 so pull up 0, 1 and drive 4 and GPIO21 low as output.
188				 */
189				ipgpio_hrefv60_mode: ipgpio_hrefv60 {
190					hrefv60_mux {
191						function = "ipgpio";
192						groups = "ipgpio0_c_1", "ipgpio1_c_1", "ipgpio4_c_1";
193					};
194					hrefv60_cfg1 {
195						pins = "GPIO6_AF6", "GPIO7_AG5";
196						ste,config = <&in_pu>;
197					};
198					hrefv60_cfg2 {
199						pins = "GPIO21_AB3";
200						ste,config = <&gpio_out_lo>;
201					};
202					hrefv60_cfg3 {
203						pins = "GPIO64_F3";
204						ste,config = <&out_lo>;
205					};
206				};
207			};
208			etm {
209				/*
210				 * Drive D19-D23 for the ETM PTM trace interface low,
211				 * (presumably pins are unconnected therefore grounded here,
212				 * the "other alt C1" setting enables these pins)
213				 */
214				etm_hrefv60_mode: etm_hrefv60 {
215					hrefv60_cfg1 {
216						pins =
217						"GPIO70_G5",
218						"GPIO71_G4",
219						"GPIO72_H4",
220						"GPIO73_H3",
221						"GPIO74_J3";
222						ste,config = <&gpio_out_lo>;
223					};
224				 };
225			};
226			nahj {
227				nahj_hrefv60_mode: nahj_hrefv60 {
228					/* NAHJ CTRL on GPIO76 to low, CTRL_INV on GPIO216 to high */
229					hrefv60_cfg1 {
230						pins = "GPIO76_J2";
231						ste,config = <&gpio_out_lo>;
232					};
233					hrefv60_cfg2 {
234						pins = "GPIO216_AG12";
235						ste,config = <&gpio_out_hi>;
236					};
237				 };
238			};
239			nfc {
240				nfc_hrefv60_mode: nfc_hrefv60 {
241					/* NFC ENA and RESET to low, pulldown IRQ line */
242					hrefv60_cfg1 {
243						pins =
244						"GPIO77_H1", /* NFC_ENA */
245						"GPIO142_C11"; /* NFC_RESET */
246						ste,config = <&gpio_out_lo>;
247					};
248					hrefv60_cfg2 {
249						pins = "GPIO144_B13"; /* NFC_IRQ */
250						ste,config = <&gpio_in_pd>;
251					};
252				 };
253			};
254			force {
255				force_hrefv60_mode: force_hrefv60 {
256					hrefv60_cfg1 {
257						pins = "GPIO91_B6"; /* FORCE_SENSING_INT */
258						ste,config = <&gpio_in_pu>;
259					};
260					hrefv60_cfg2 {
261						pins =
262						"GPIO92_D6", /* FORCE_SENSING_RST */
263						"GPIO97_D9"; /* FORCE_SENSING_WU */
264						ste,config = <&gpio_out_lo>;
265					};
266				 };
267			};
268			dipro {
269				dipro_hrefv60_mode: dipro_hrefv60 {
270					hrefv60_cfg1 {
271						pins = "GPIO139_C9"; /* DIPRO_INT */
272						ste,config = <&gpio_in_pu>;
273					};
274				 };
275			};
276			vaudio_hf {
277				vaudio_hf_hrefv60_mode: vaudio_hf_hrefv60 {
278					/* Audio Amplifier HF enable GPIO */
279					hrefv60_cfg1 {
280						pins = "GPIO149_B14"; /* VAUDIO_HF_EN, enable MAX8968 */
281						ste,config = <&gpio_out_hi>;
282					};
283				 };
284			};
285			gbf {
286				gbf_hrefv60_mode: gbf_hrefv60 {
287					/*
288					 * GBF (GPS, Bluetooth, FM-radio) interface,
289					 * pull low to reset state
290					 */
291					hrefv60_cfg1 {
292						pins = "GPIO171_D23"; /* GBF_ENA_RESET */
293						ste,config = <&gpio_out_lo>;
294					};
295				 };
296			};
297			hdtv {
298				hdtv_hrefv60_mode: hdtv_hrefv60 {
299					/* MSP : HDTV INTERFACE GPIO line */
300					hrefv60_cfg1 {
301						pins = "GPIO192_AJ27";
302						ste,config = <&gpio_in_pd>;
303					};
304				 };
305			};
306			mcde {
307				lcd_hrefv60_mode: lcd_hrefv60 {
308					/*
309					 * Display Interface 1 uses GPIO 65 for RST (reset).
310					 * Display Interface 2 uses GPIO 66 for RST (reset).
311					 * Drive DISP1 reset high (not reset), driver DISP2 reset low (reset)
312					 */
313					hrefv60_cfg1 {
314						pins ="GPIO65_F1";
315						ste,config = <&gpio_out_hi>;
316					};
317					hrefv60_cfg2 {
318						pins ="GPIO66_G3";
319						ste,config = <&gpio_out_lo>;
320					};
321				};
322			};
323			gpios {
324				/* Dangling GPIO pins */
325				gpios_hrefv60_mode: gpios_hrefv60 {
326					default_cfg1 {
327						/* Normally UART1 RXD, now dangling */
328						pins = "GPIO4_AH6";
329						ste,config = <&in_pu>;
330					};
331				};
332			};
333		};
334	};
335};
336