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