xref: /freebsd/sys/contrib/device-tree/src/arm/st/ste-ab8500.dtsi (revision 397e83df75e0fcd0d3fcb95ae4d794cb7600fc89)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright 2012 Linaro Ltd
4 */
5
6#include <dt-bindings/clock/ste-ab8500.h>
7
8/ {
9	/* Essential housekeeping hardware monitors */
10	iio-hwmon {
11		compatible = "iio-hwmon";
12		io-channels = <&gpadc 0x02>, /* Battery temperature */
13			    <&gpadc 0x03>, /* Main charger voltage */
14			    <&gpadc 0x08>, /* Main battery voltage */
15			    <&gpadc 0x09>, /* VBUS */
16			    <&gpadc 0x0a>, /* Main charger current */
17			    <&gpadc 0x0b>, /* USB charger current */
18			    <&gpadc 0x0c>, /* Backup battery voltage */
19			    <&gpadc 0x0d>, /* Die temperature */
20			    <&gpadc 0x12>; /* Crystal temperature */
21	};
22
23	soc {
24		prcmu@80157000 {
25			ab8500 {
26				compatible = "stericsson,ab8500";
27				interrupt-parent = <&intc>;
28				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
29				interrupt-controller;
30				#interrupt-cells = <2>;
31				#address-cells = <1>;
32				#size-cells = <0>;
33
34				ab8500_clock: clock-controller {
35					compatible = "stericsson,ab8500-clk";
36					#clock-cells = <1>;
37				};
38
39				ab8500_gpio: gpio {
40					compatible = "stericsson,ab8500-gpio";
41					gpio-controller;
42					#gpio-cells = <2>;
43				};
44
45				rtc {
46					compatible = "stericsson,ab8500-rtc";
47					interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
48						     <18 IRQ_TYPE_LEVEL_HIGH>;
49					interrupt-names = "60S", "ALARM";
50				};
51
52				gpadc: adc {
53					compatible = "stericsson,ab8500-gpadc";
54					interrupts = <32 IRQ_TYPE_LEVEL_HIGH>,
55						     <39 IRQ_TYPE_LEVEL_HIGH>;
56					interrupt-names = "HW_CONV_END", "SW_CONV_END";
57					vddadc-supply = <&ab8500_ldo_tvout_reg>;
58					#address-cells = <1>;
59					#size-cells = <0>;
60					#io-channel-cells = <1>;
61
62					/* GPADC channels */
63					bat_ctrl: channel@1 {
64						reg = <0x01>;
65					};
66					btemp_ball: channel@2 {
67						reg = <0x02>;
68					};
69					main_charger_v: channel@3 {
70						reg = <0x03>;
71					};
72					acc_detect1: channel@4 {
73						reg = <0x04>;
74					};
75					acc_detect2: channel@5 {
76						reg = <0x05>;
77					};
78					adc_aux1: channel@6 {
79						reg = <0x06>;
80					};
81					adc_aux2: channel@7 {
82						reg = <0x07>;
83					};
84					main_batt_v: channel@8 {
85						reg = <0x08>;
86					};
87					vbus_v: channel@9 {
88						reg = <0x09>;
89					};
90					main_charger_c: channel@a {
91						reg = <0x0a>;
92					};
93					usb_charger_c: channel@b {
94						reg = <0x0b>;
95					};
96					bk_bat_v: channel@c {
97						reg = <0x0c>;
98					};
99					die_temp: channel@d {
100						reg = <0x0d>;
101					};
102					usb_id: channel@e {
103						reg = <0x0e>;
104					};
105					xtal_temp: channel@12 {
106						reg = <0x12>;
107					};
108					vbat_true_meas: channel@13 {
109						reg = <0x13>;
110					};
111					bat_ctrl_and_ibat: channel@1c {
112						reg = <0x1c>;
113					};
114					vbat_meas_and_ibat: channel@1d {
115						reg = <0x1d>;
116					};
117					vbat_true_meas_and_ibat: channel@1e {
118						reg = <0x1e>;
119					};
120					bat_temp_and_ibat: channel@1f {
121						reg = <0x1f>;
122					};
123				};
124
125				thermal {
126					compatible = "stericsson,abx500-temp";
127					interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
128					interrupt-names = "ABX500_TEMP_WARM";
129				};
130
131				ab8500_fg {
132					compatible = "stericsson,ab8500-fg";
133					interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
134						     <8 IRQ_TYPE_LEVEL_HIGH>,
135						     <28 IRQ_TYPE_LEVEL_HIGH>,
136						     <27 IRQ_TYPE_LEVEL_HIGH>,
137						     <26 IRQ_TYPE_LEVEL_HIGH>;
138					interrupt-names = "NCONV_ACCU",
139							  "BATT_OVV",
140							  "LOW_BAT_F",
141							  "CC_INT_CALIB",
142							  "CCEOC";
143					monitored-battery = <&battery>;
144					io-channels = <&gpadc 0x08>;
145					io-channel-names = "main_bat_v";
146				};
147
148				ab8500_btemp {
149					compatible = "stericsson,ab8500-btemp";
150					interrupts = <20 IRQ_TYPE_LEVEL_HIGH>,
151						     <80 IRQ_TYPE_LEVEL_HIGH>,
152						     <83 IRQ_TYPE_LEVEL_HIGH>,
153						     <81 IRQ_TYPE_LEVEL_HIGH>,
154						     <82 IRQ_TYPE_LEVEL_HIGH>;
155					interrupt-names = "BAT_CTRL_INDB",
156							  "BTEMP_LOW",
157							  "BTEMP_HIGH",
158							  "BTEMP_LOW_MEDIUM",
159							  "BTEMP_MEDIUM_HIGH";
160					monitored-battery = <&battery>;
161					io-channels = <&gpadc 0x02>,
162						      <&gpadc 0x01>;
163					io-channel-names = "btemp_ball",
164							"bat_ctrl";
165				};
166
167				ab8500_charger {
168					compatible = "stericsson,ab8500-charger";
169					interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
170						     <11 IRQ_TYPE_LEVEL_HIGH>,
171						     <0 IRQ_TYPE_LEVEL_HIGH>,
172						     <107 IRQ_TYPE_LEVEL_HIGH>,
173						     <106 IRQ_TYPE_LEVEL_HIGH>,
174						     <14 IRQ_TYPE_LEVEL_HIGH>,
175						     <15 IRQ_TYPE_LEVEL_HIGH>,
176						     <79 IRQ_TYPE_LEVEL_HIGH>,
177						     <105 IRQ_TYPE_LEVEL_HIGH>,
178						     <104 IRQ_TYPE_LEVEL_HIGH>,
179						     <89 IRQ_TYPE_LEVEL_HIGH>,
180						     <22 IRQ_TYPE_LEVEL_HIGH>,
181						     <21 IRQ_TYPE_LEVEL_HIGH>,
182						     <16 IRQ_TYPE_LEVEL_HIGH>;
183					interrupt-names = "MAIN_CH_UNPLUG_DET",
184							  "MAIN_CHARGE_PLUG_DET",
185							  "MAIN_EXT_CH_NOT_OK",
186							  "MAIN_CH_TH_PROT_R",
187							  "MAIN_CH_TH_PROT_F",
188							  "VBUS_DET_F",
189							  "VBUS_DET_R",
190							  "USB_LINK_STATUS",
191							  "USB_CH_TH_PROT_R",
192							  "USB_CH_TH_PROT_F",
193							  "USB_CHARGER_NOT_OKR",
194							  "VBUS_OVV",
195							  "CH_WD_EXP",
196							  "VBUS_CH_DROP_END";
197					monitored-battery = <&battery>;
198					vddadc-supply = <&ab8500_ldo_tvout_reg>;
199					io-channels = <&gpadc 0x03>,
200						      <&gpadc 0x0a>,
201						      <&gpadc 0x09>,
202						      <&gpadc 0x0b>;
203					io-channel-names = "main_charger_v",
204							"main_charger_c",
205							"vbus_v",
206							"usb_charger_c";
207				};
208
209				ab8500_chargalg {
210					compatible = "stericsson,ab8500-chargalg";
211					monitored-battery = <&battery>;
212				};
213
214				ab8500_usb: phy {
215					compatible = "stericsson,ab8500-usb";
216					interrupts = <90 IRQ_TYPE_LEVEL_HIGH>,
217						     <96 IRQ_TYPE_LEVEL_HIGH>,
218						     <14 IRQ_TYPE_LEVEL_HIGH>,
219						     <15 IRQ_TYPE_LEVEL_HIGH>,
220						     <79 IRQ_TYPE_LEVEL_HIGH>,
221						     <74 IRQ_TYPE_LEVEL_HIGH>,
222						     <75 IRQ_TYPE_LEVEL_HIGH>;
223					interrupt-names = "ID_WAKEUP_R",
224							  "ID_WAKEUP_F",
225							  "VBUS_DET_F",
226							  "VBUS_DET_R",
227							  "USB_LINK_STATUS",
228							  "USB_ADP_PROBE_PLUG",
229							  "USB_ADP_PROBE_UNPLUG";
230					vddulpivio18-supply = <&ab8500_ldo_intcore_reg>;
231					v-ape-supply = <&db8500_vape_reg>;
232					musb_1v8-supply = <&db8500_vsmps2_reg>;
233					clocks = <&prcmu_clk PRCMU_SYSCLK>;
234					clock-names = "sysclk";
235					#phy-cells = <0>;
236				};
237
238				key {
239					compatible = "stericsson,ab8500-poweron-key";
240					interrupts = <6 IRQ_TYPE_LEVEL_HIGH>,
241						     <7 IRQ_TYPE_LEVEL_HIGH>;
242					interrupt-names = "ONKEY_DBF", "ONKEY_DBR";
243				};
244
245				ab8500-sysctrl {
246					compatible = "stericsson,ab8500-sysctrl";
247				};
248
249				pwm@1 {
250					compatible = "stericsson,ab8500-pwm";
251					reg = <1>;
252					clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
253					clock-names = "intclk";
254					#pwm-cells = <1>;
255				};
256
257				pwm@2 {
258					compatible = "stericsson,ab8500-pwm";
259					reg = <2>;
260					clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
261					clock-names = "intclk";
262					#pwm-cells = <1>;
263				};
264
265				pwm@3 {
266					compatible = "stericsson,ab8500-pwm";
267					reg = <3>;
268					clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
269					clock-names = "intclk";
270					#pwm-cells = <1>;
271				};
272
273				codec: codec {
274					compatible = "stericsson,ab8500-codec";
275
276					V-AUD-supply = <&ab8500_ldo_audio_reg>;
277					V-AMIC1-supply = <&ab8500_ldo_anamic1_reg>;
278					V-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;
279					V-DMIC-supply = <&ab8500_ldo_dmic_reg>;
280
281					clocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;
282					clock-names = "audioclk";
283
284					stericsson,earpeice-cmv = <950>; /* Units in mV. */
285				};
286
287				ext_regulators: regulator-external {
288					compatible = "stericsson,ab8500-ext-regulator";
289
290					ab8500_ext1_reg: ab8500_ext1 {
291						regulator-min-microvolt = <1800000>;
292						regulator-max-microvolt = <1800000>;
293						regulator-boot-on;
294						regulator-always-on;
295					};
296
297					ab8500_ext2_reg: ab8500_ext2 {
298						regulator-min-microvolt = <1360000>;
299						regulator-max-microvolt = <1360000>;
300						regulator-boot-on;
301						regulator-always-on;
302					};
303
304					ab8500_ext3_reg: ab8500_ext3 {
305						regulator-min-microvolt = <3400000>;
306						regulator-max-microvolt = <3400000>;
307						regulator-boot-on;
308					};
309				};
310
311				regulator {
312					compatible = "stericsson,ab8500-regulator";
313					vin-supply = <&ab8500_ext3_reg>;
314
315					// supplies to the display/camera
316					ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
317						regulator-min-microvolt = <2800000>;
318						regulator-max-microvolt = <3300000>;
319						regulator-boot-on;
320						/* BUG: If turned off MMC will be affected. */
321						regulator-always-on;
322					};
323
324					// supplies to the on-board eMMC
325					ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
326						regulator-min-microvolt = <1100000>;
327						regulator-max-microvolt = <3300000>;
328					};
329
330					// supply for VAUX3; SDcard slots
331					ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
332						regulator-min-microvolt = <1100000>;
333						regulator-max-microvolt = <3300000>;
334					};
335
336					// supply for v-intcore12; VINTCORE12 LDO
337					ab8500_ldo_intcore_reg: ab8500_ldo_intcore {
338					};
339
340					// supply for tvout; gpadc; TVOUT LDO
341					ab8500_ldo_tvout_reg: ab8500_ldo_tvout {
342					};
343
344					// supply for ab8500-vaudio; VAUDIO LDO
345					ab8500_ldo_audio_reg: ab8500_ldo_audio {
346					};
347
348					// supply for v-anamic1 VAMIC1 LDO
349					ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
350					};
351
352					// supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1
353					ab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {
354					};
355
356					// supply for v-dmic; VDMIC LDO
357					ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
358					};
359
360					// supply for U8500 CSI/DSI; VANA LDO
361					ab8500_ldo_ana_reg: ab8500_ldo_ana {
362					};
363				};
364			};
365		};
366
367		sound {
368			stericsson,audio-codec = <&codec>;
369			clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
370			clock-names = "sysclk", "ulpclk", "intclk";
371		};
372
373		mcde@a0350000 {
374			vana-supply = <&ab8500_ldo_ana_reg>;
375
376			dsi@a0351000 {
377				vana-supply = <&ab8500_ldo_ana_reg>;
378			};
379			dsi@a0352000 {
380				vana-supply = <&ab8500_ldo_ana_reg>;
381			};
382			dsi@a0353000 {
383				vana-supply = <&ab8500_ldo_ana_reg>;
384			};
385		};
386
387		usb_per5@a03e0000 {
388			phys = <&ab8500_usb>;
389			phy-names = "usb";
390		};
391	};
392};
393